Archived

This topic is now archived and is closed to further replies.

system modal dialog in winXP

This topic is 5088 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

how would I create a system modal dialog box in windows XP, I have seen some ways of doing it for old 16-bit windows but everything that I have tried doesn''t work. Can''t just set the system modal property in the dialog editor within VS.NET. For any one that doesn''t know system modal dialog boxes wont allow you to do anything until the dialog is closed. Like with Antivirus software (pop up when a virus is detected). Thanks

Share this post


Link to post
Share on other sites

That would explain why I couldn''t find info on it beyond 16-bit windows.

how would I recreate the effect then? Have the system freeze everything until my dialog box is closed. Other software do, do it somehow, like Antivirus software when they pop up "Virus Detected what da ya wanna do now".

Intercept some system messages?

Thanks

Share this post


Link to post
Share on other sites
I''d guess that it would be done with a kernel driver because that should be the only way to completely stop system activities in a protected mode OS. My virus scanner doesn''t do that though, and I would hate any program that did. If there is an activity that might cause something bad to happen, just stop that single activity instead of the whole system.

Share this post


Link to post
Share on other sites
quote:
Original post by Anonymous Poster
I'm pretty sure it's impossible to stop a CTRL+ALT+DEL.


Not so, ALT+CTRL+DEL as well as the CTRL+SHIFT+ESC hotkeys can be intercepted in Windows 2000 and XP- using a combination of DLL injection and sucblassing you can set the SAS Window in WINLOGON.EXE to a WinProc() in your injected .DLL file.

But that's beside the point- do you have any idea of how many hotkeys you'd need to disable for the purpose of making a system modal dialog box? It just doesn't strike a compromise... and what if your application stops responding? The system [and user] is not going to be happy. Seriously... you just can't do it, mate...

quote:
Original post by Extrarius
I'd guess that it would be done with a kernel driver because that should be the only way to completely stop system activities in a protected mode OS.



Kernel development has nothing to do with graphical features- and drivera still follows the principles of thread priority... you can't even put a driver into state where only it gets all the system resources for an unlimited time.




The way I'd do it is use EnumWindows() to enumerate through all the top level windows in the system, storing each in an array and then calling EnableWindow(hwnd[ i ], FALSE); after doing a stricmp() on the window names obtained by GetWindowText() to make sure YOUR dialog/window will not be disabled. If you want to make sure you're truly disabling every window/dialog- you could also use EnumChildWindows() with each handle you get from EnumWindows()

You could also check out ZwQuerySystemInformation()- you can use that to get a handle to all the running processes/threads and then call SuspendThread() for each. This will 'pause all the processes'- obviously you make sure you don't disable yours too.

I've never done the following- but I have heard of a solution that involves creating a thing called a desktop- much like winlogon.exe does in 2000 when you press ALT+CTRL+DEL... [well, it actually switches to one]

I know the first method would work- and if I am correct, you'll even disable the winlogon SAS window which is responsible for ALT+CTRL+DEL... if not, EnumDesktopWindows() for it...

[edited by - Metro_Mystery on January 6, 2004 10:03:05 PM]

Share this post


Link to post
Share on other sites