![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Aug 2005
Location: India
Posts: 3
Rep Power: 0
![]() |
How can I differentiate Modal and Modeless Dialogs
I have the HWND of a Dialog Box and I have to find out whether it is Modal or modeless dialog. I have to do this using only the Win32 API's. I am not using MFC in my program. How can this be done. Another thing to note is that the modeless dialogs do not follow any perticular standard or style. Some have title bars, some dont etc.
|
|
|
|
|
|
#2 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
Well, what determines whether it's modal or not? Is there a variable that you set? Do you define a macro? I don't know how dialogs work, but there must be something.
|
|
|
|
|
|
#3 | |
|
Professional Programmer
Join Date: May 2005
Location: Bad Nauheim, Germany
Posts: 436
Rep Power: 4
![]() |
Quote:
![]() valiant effort ooble -Or was that just some "razzle-dazzle" postcount fluff to awe and bewilder those seeking wisdom and score another point?
__________________
-Steven "Is this a piece of your brain?" - Basil Fawlty |
|
|
|
|
|
|
#4 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
I'm just trying to get back into the swing of things. Leave me be, cursed one!
|
|
|
|
|
|
#5 |
|
Programming Guru
![]() |
Still doesn't help the OP though
__________________
"Put your hand on a hot stove for a minute, and it seems like an hour. Sit with a pretty girl for an hour, and it seems like a minute. THAT'S relativity." - Albert Einstein |
|
|
|
|
|
#6 |
|
Newbie
Join Date: Aug 2005
Location: India
Posts: 3
Rep Power: 0
![]() |
We have different API for creating Modal and Modeless Dialogs. So thats not a problem. But How can we differentiate after they are made and we have just the Handle of the Window.
|
|
|
|
|
|
#7 |
|
Programmer
Join Date: Jul 2005
Location: Germany
Posts: 69
Rep Power: 4
![]() |
Hi,
i'm not a win32 expert but there is a GetWindowStyleA or similar API .. and i believe whether a dialog is modeless or modal is controled via the style.
__________________
-= C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do succeed, you will blow away your whole leg. =- Bjarne Stroustrup |
|
|
|
|
|
#8 |
|
Hobbyist Programmer
Join Date: May 2005
Location: Indiana
Posts: 130
Rep Power: 4
![]() |
I have been searching for a while and didn't see it for win32 API (may want to look here
), however QT designer does have a IsModal() method in QDialog class, so next time forget win32, go QT Designer! |
|
|
|
|
|
#9 | |
|
Programmer
Join Date: Jul 2005
Location: Germany
Posts: 69
Rep Power: 4
![]() |
Quote:
I searched myself. There is no GetWindowStyle but there is a GetWindowInfo Prototype: BOOL GetWindowInfo(HWND h,PWINDOWINFO pwi); And then you get the WINDOWINFO structur holding both style and styleEX es members. Again, i dunno if this is the right way to go .. but i think it is sth to start from.
__________________
-= C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do succeed, you will blow away your whole leg. =- Bjarne Stroustrup |
|
|
|
|
|
|
#10 |
|
Professional Programmer
Join Date: May 2005
Location: Bad Nauheim, Germany
Posts: 436
Rep Power: 4
![]() |
If nothing else works, you may just have to store the information in a table when you instantiate a dialog. Something along the lines of a container as a static class variable, mapping HWNDs to bools.
__________________
-Steven "Is this a piece of your brain?" - Basil Fawlty |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|