| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | WINSHUTDOWN & REBOOT |
DL> It must be reasonably simple to do, but I have had no luck getting
DL> WinShutdown() to work, nor the code I've seen around
PF>I beleive the WinShutdownSystem() call will allow PM programs to stop and
PF>wait for input ("Are You sure you want to quit??" type crap).
PF>DosShutdown(), on the other hand, will _for sure_ shut the filesystems
PF>down clean (without closing any programs). If this is ok, here's the
PF>32bit version of the reboot program you couldn't get working (because you
PF>had 16bit source):
Oh, Thank You!. I also found out why my program wouldn't work right. It would
get closed itself by the call to WinShutdownSystem and never reach the boot
code. I fixed that by making it a detached process from the main program
instead of a separate thread from the main program. I still can't use
WinShutdownSystem() though because it DOES pop up those "Are You Sure?"
messsages. So what I am doing now is sending a WM_SAVEAPPLICATION to each windo
returned by a WinBeginEnumWindows, WinGetNextWindow, WindEndEnumWindows loop,
followed by posting a WM_QUIT to each after the send of the WM_SAVEAPPLICATION
returns. IF anything is left over after that, I post a WM_CLOSE to each
remaining window then kill all remaining processes after that. I then call
DosShutdown and reboot. This seems to work OK. I still get the "Are
You Sure"
messages popping up, but at least my code is still in control because I posted
them instead of sending them. The only problem is that some windows seem to di
before they actually get to close cleanly. I do wait until all of the windows
posted to become invalid handles before proceeding on to the next step, but it
seems as if something is blocking the system message queue or the queues of the
individual windows and they leave "litter" on the screen.. Not a
big problem bu
it makes my code look like a quick hack . The process that does all of this
does not itself create a window, but does have a message queue and anchor block
in order to allow it to call the Win functions. There is no message dispatch
loop because I don't think it would be getting any messages without a window to
"capture" mouse, keyboard, paint messages.
___
* MR/2 1.52 NR * I'm fat. You're ugly. I can diet.
--- WILDMAIL!/WC v4.11
* Origin: Freezing Point BBS - WDNet HQ - Mpls MN: (1:282/85.0)SEEN-BY: 12/2442 620/243 624/50 632/348 640/820 690/660 711/409 410 413 430 SEEN-BY: 711/807 808 809 934 942 949 712/353 515 713/888 800/1 7877/2809 @PATH: 282/85 1 270/101 396/1 3615/50 229/2 12/2442 711/409 808 809 934 |
|
| SOURCE: echomail via fidonet.ozzmosis.com | |
Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.