You're drawing the button inside the window right? When you create a button with CreateWindow, you're using client coordinates of the main window. So don't you just need to know how big your window's client area is? Why do you need to care how big the screen is?