Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 42215

Detect modal form?

$
0
0
I've searched this forum and I searched the net, but I couldn't find an answer (therefore I think it's just not possible)..

Is there a way to detect (through API call or whatever) if a form in the Forms collection was opened as Modal?

I already tried to see if any of the windowstyle options was different, I had high hopes when I saw WS_EX_DLGMODALFRAME, but then I opened the same form modeless and the same WindowStyle appeared.. grrrr..

The reason I need this, is that I'm using DDE now for triggering 'commands' through URI or commandline (which opens my application, sees another instance and uses DDE to send the command to that instance or if none is found adds it to the new instance).
And there are ofcourse moments I really cannot do anything like with Messageboxes (that really blockes everything), but a modal form doesn't (always) block the DDE from reaching my 'commandcentre' ;)
at the moment I just add the command to a collection and wait until no form is disabled before executing the command, but there are a lot of forms that can be open (but are disabled) without a problem for executing the commands.
Only when a form is opened through Modal I need to block the command at the moment.

It's an old project that's still used a lot, so just rewriting everything in one go isn't possible, it has a lot of forms so I need to check all of them, and in the end also replace ALL messageboxes with our own implementation..

Viewing all articles
Browse latest Browse all 42215

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>