chrislock
asked on
Delphi 7 How can I programatically suppress Windows advisory messages?
D7 XP
Hi,
I need to run an application so that only the main form of the application is always displayed. I wish to temporarily suppress all Windows messages (I hope all exceptions are handled within the app!!) whilst the app. is running. Can I do this programatically?
e.g.
'hiding your inactive icons'
'your hardware is ready;' (USB)
'Windows has altered time to BST'
etc.
etc.
Chris
Hi,
I need to run an application so that only the main form of the application is always displayed. I wish to temporarily suppress all Windows messages (I hope all exceptions are handled within the app!!) whilst the app. is running. Can I do this programatically?
e.g.
'hiding your inactive icons'
'your hardware is ready;' (USB)
'Windows has altered time to BST'
etc.
etc.
Chris
You can try the 3rd party component MadExcept.
Check http://www.madshi.net/madExceptDescription.htm
This component is very easy to use and can handle any kind of exception, inside your application or from the OS.
Very useful for this cases.
Check http://www.madshi.net/madExceptDescription.htm
This component is very easy to use and can handle any kind of exception, inside your application or from the OS.
Very useful for this cases.
ASKER
big_one01
I dont really understand what MadExcept has to do with the question!!!!!????
Chris
I dont really understand what MadExcept has to do with the question!!!!!????
Chris
ASKER
TheRealLok
Your code certainly works in part. How do I return to the original desktop?
I save the existing desktop
create the new desktop.
get a handle by calling opendesktop
switch desktop to desk
delay
then switch back
then ....
If the software closes the desktop (CloseDesktop(Desk);) then nothing seems to happen and I'm still stuck with the blank desktop and its a hard reboot. Am I missing something?
olddesk:=windows.getdeskto pwindow();
Desk := Windows.CreateDesktop(PCha r('Desktop Name'), nil, nil, 0, MAXIMUM_ALLOWED, nil);
Desk :=OpenDesktop(PChar('Deskt opName'), DF_ALLOWOTHERACCOUNTHOOK, False, MAXIMUM_ALLOWED);
Sleep(100);
SwitchDesktop(Desk);// activate the new desktop
sleep(2000);
SwitchDesktop(oldDesk);// activate the old desktop
CloseDesktop(Desk);
Chris
Your code certainly works in part. How do I return to the original desktop?
I save the existing desktop
create the new desktop.
get a handle by calling opendesktop
switch desktop to desk
delay
then switch back
then ....
If the software closes the desktop (CloseDesktop(Desk);) then nothing seems to happen and I'm still stuck with the blank desktop and its a hard reboot. Am I missing something?
olddesk:=windows.getdeskto
Desk := Windows.CreateDesktop(PCha
Desk :=OpenDesktop(PChar('Deskt
Sleep(100);
SwitchDesktop(Desk);// activate the new desktop
sleep(2000);
SwitchDesktop(oldDesk);// activate the old desktop
CloseDesktop(Desk);
Chris
ASKER
I've just found this:
https://www.experts-exchange.com/questions/10688741/createdesktop-switchdesktop.html
I think theres a bit more to it than this!!!
There must be another way to suppress windows messages !
Chris
https://www.experts-exchange.com/questions/10688741/createdesktop-switchdesktop.html
I think theres a bit more to it than this!!!
There must be another way to suppress windows messages !
Chris
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
if you do decide to go the desktop way, and get stuck in a limbo desktop, just do a ctrl-shift-escape, then "new task" explorer.exe
I think the main desktop is called "default" try switching to that,
I can't look it up right now, away from dev pc sorry
I think the main desktop is called "default" try switching to that,
I can't look it up right now, away from dev pc sorry
ASKER
Sorry - forgot to say thanks for all the help anyway.
all system messages should go to the main desktop.
just make sure you close your created desktop when your app ends or you will be stuck in a limbo desktop :-)
something like ...
var Desk: HDESK;
Desk := Windows.CreateDesktop(PCha
...
Desk:=OpenDesktop(PChar(De
Sleep(100);
SwitchDesktop(Desk);
...
CloseDesktop(Desk);
...
might pay to read up on them first so you know what you're getting into, but not too bad