| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | WinCancelShutdown |
DR>
> As far as how many threads get WM_QUITs, only one does. I have read
> that this thread is picked kind of at random so you need to call
> WinCancelShutdown() with the second parm TRUE for all of the threads
> who don't want to every get the WM_QUIT. But that does not seem true
> for the reasons mentioned above.
DR>
Well, I always tend to look at these things as how I would design
them, were I designing them. I would design the Window List to look
up the window handle for the highlighted entry, and post a WM_QUIT to
that window.
Since (in theory) windows are "owned" by anchor blocks, and each
thread has its own anchor block, I'd then expect the WM_QUIT to arrive
on the message queue of the thread that created the window.
Since it is logical to expect the thread that created a window to be
the same one that is executing the message loop for the message queue,
it follows that a "close" on the Window List would cause the thread
associated with that window to exit its message loop.
And since this would give the "logical" result to the user (the window
closed from the Window List is the one that actually closes), there's
no reason to suppose that it has been done any other way.
DR>
> But any way you cut it, there seems to be a major hole in the
> documentation for WinCancelShutdown() that needs to be filled.
DR>
I agree. The documentation is very patchy. A lot of multithreading
considerations are simply left for the application programmer (me) to
guess at.
WinSendMsg() is another very poorly documented call. The
documentation states
"If the window is of another thread or process, the operating system
switches to the appropriate thread that enters the necessary window
procedure recursively. The message is not placed in the queue of
the destination thread."
This implies that if the second thread is already processing a
message, it will somehow (magically) be interrupted to process another
message. That doesn't square up with my experience.
> JdeBP <
___
X MegaMail 2.10 #0:
--- Maximus/2 2.02
* Origin: DoNoR/2,Woking UK (01483-725167) (2:440/4)SEEN-BY: 12/2442 54/54 620/243 624/50 632/348 640/820 690/660 711/409 410 413 SEEN-BY: 711/430 807 808 809 934 942 949 712/353 623 713/888 800/1 @PATH: 440/4 141/209 270/101 396/1 3615/50 229/2 12/2442 711/409 54/54 @PATH: 711/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™.