How to identify a Modal and Modeless dialog in VC++ code

Lord Nemesis

Overlord
Skilled
In one of my programs I am writing, I have to indentify whether the top dialog on screen is modeless or not. I have the HWND of the window. No MFC involved here. I need to do this using only Win32 API. Is there any way to do this. the modeless dialog can have any size and style(With or without Caption Bars etc). Suggestions regarding this would be greatly appreciated.
 
Well, as far as I know, modeless dialogs cannot be minimised. So if you can send the message that minimises a window/dialog to that dialog, and see what happens, or is there some way to get a list of messages that a window specifically responds to (not talking about default pass ons)
 
KingKrool said:
Well, as far as I know, modeless dialogs cannot be minimised. So if you can send the message that minimises a window/dialog to that dialog, and see what happens, or is there some way to get a list of messages that a window specifically responds to (not talking about default pass ons)
Its the other way round isnt it? I thought modeless dialogs are like normal windows :S.
 
Yes, its the other way around, Modal dialogs cannot be minimized as there is no point in minimizing them. But still this is not a fool proof way as we can also remove the minimize button for a modeless dialog. so how can we be sure?
 
I'm not sure if it's of any help, but there's a win32 function called "GetWindowInfo()" to which u can pass a HWND and a windowinfo struct and get various attributes of the window from it. Not exactly sure if it can get you the state of the window!
 
modal
A window or form is modal if it retains the focus until you explicitly close it. Dialog boxes and messages are usually modal. For example, in a modal dialog box, you can't access another window until you choose OK in the dialog box.

(from MSDN)

You guys are right, I was confused there (never really did Win32, gave up on it cos I had better stuff to do)
 
Back
Top