how to get the current dialog box position ?

Started by
1 comment, last by kevlur 18 years, 11 months ago
Hi all, when i have a dialog box open, how can i get its current position? i need to know the min(x,y) and max(x,y) of the dialog box to test if the mouse cursor is over it. Thanks in advance Kev
Advertisement
I haven't actually tried this solution myself but if you already know the title of the dialog box, you may use the FindWindow(LPCTSTR, LPCTSTR) function of the Windows API to retrieve the window handle of the dialog box. You may then use the GetWindowRect(HWND, LPRECT) function of the Windows API to retrieve the x, y, width, and height of the dialog box. You must pass the HWND you got from using FindWindow(LPCTSTR, LPCTSTR) function to the GetWindowRect(HWND, LPRECT) function. The GetWindowRect(HWND, LPRECT) function will fill the LPRECT with information about the size of the dialog box.
Thanks :)

This topic is closed to new replies.

Advertisement