How to Get desktop coordinates.
-
HI, I am creating Window using window class. I added just a menu bar. I need couple of coordinates to give flexibilities to my window. 1. How I will get the height and with of a desktop, cause i may use this application in multiple resolution desktops. 2. Inside the window I have a menu bar only. I need to know the coordinates of left-bottom corner of that menu bar so that I can create other control inside my window. Thanks in advance...
birajendu SonicWALL Bangalore India
-
HI, I am creating Window using window class. I added just a menu bar. I need couple of coordinates to give flexibilities to my window. 1. How I will get the height and with of a desktop, cause i may use this application in multiple resolution desktops. 2. Inside the window I have a menu bar only. I need to know the coordinates of left-bottom corner of that menu bar so that I can create other control inside my window. Thanks in advance...
birajendu SonicWALL Bangalore India
hai 1: try to explore GetSystemmetrics or getdesktopwindow() function. 2: AFAIK, i guess, for what ever the resolution maybe, the menu bar size(height) will be same in pixels, wrt the window. so, you can hardcode it. or you can use GetWindowRect to get the bounds of your menu bar.
-------------------------------------------- Suggestion to the members: Please prefix your main thread subject with [SOLVED] if it is solved. thanks. chandu.
modified on Thursday, June 18, 2009 11:58 PM
-
HI, I am creating Window using window class. I added just a menu bar. I need couple of coordinates to give flexibilities to my window. 1. How I will get the height and with of a desktop, cause i may use this application in multiple resolution desktops. 2. Inside the window I have a menu bar only. I need to know the coordinates of left-bottom corner of that menu bar so that I can create other control inside my window. Thanks in advance...
birajendu SonicWALL Bangalore India
For determining the resolution(xMax X yMax), you can use
xMax = GetSystemMetrics(SM_CXSCREEN)
yMax = GetSystemMetrics(SM_CYSCREEN)and for knowing the coordinates, use GetClientRect and change it to screen coordinates, if required, by using
ClientToScreen
API. -
HI, I am creating Window using window class. I added just a menu bar. I need couple of coordinates to give flexibilities to my window. 1. How I will get the height and with of a desktop, cause i may use this application in multiple resolution desktops. 2. Inside the window I have a menu bar only. I need to know the coordinates of left-bottom corner of that menu bar so that I can create other control inside my window. Thanks in advance...
birajendu SonicWALL Bangalore India
See some handy information - Multi Monotor Program Basics[^]
-Sarath. "Great hopes make everything great possible" - Benjamin Franklin
My blog - Sharing My Thoughts
-
For determining the resolution(xMax X yMax), you can use
xMax = GetSystemMetrics(SM_CXSCREEN)
yMax = GetSystemMetrics(SM_CYSCREEN)and for knowing the coordinates, use GetClientRect and change it to screen coordinates, if required, by using
ClientToScreen
API. -
hai 1: try to explore GetSystemmetrics or getdesktopwindow() function. 2: AFAIK, i guess, for what ever the resolution maybe, the menu bar size(height) will be same in pixels, wrt the window. so, you can hardcode it. or you can use GetWindowRect to get the bounds of your menu bar.
-------------------------------------------- Suggestion to the members: Please prefix your main thread subject with [SOLVED] if it is solved. thanks. chandu.
modified on Thursday, June 18, 2009 11:58 PM