🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.ms-windows.programmer.misc
Article #1633

how are IDCANCEL, WM_SYSCOMMAND/SC_CLOSE & WM_DESTROY related?

#1633
From: John Grant
Date: Thu, 15 Oct 1992 23:30
18 lines
1523 bytes
I have about a dozen dialog boxes and I want to be able to double click the
handle in the upper left or use ALT-F4 to close them.  All of the dialog
box procs call EndDialog upon receiving WM_DESTROY (that is correct, isn't it?)
Not all dialog boxes have both CANCEL & OK buttons - some have only OK buttons.

I have found that if the box has both OK & CANCEL, the double click or ALT-F4
action sends a WM_DESTROY and all is ok.  However, if the box has no CANCEL
button, nothing happens - all of the following fail:
	(a) double click on system menu
	(b) click system menu & 'close window'
	(c) alt-F4
In these cases, I have to intercept WM_SYSCOMMAND, wparam==SC_CLOSE and then
send myself a WM_DESTROY message.

Why does this happen?  Obviously, it is translating the action to WM_DESTROY
but only if there is a CANCEL button.  Where is this being done.  Can anyone
point me to the documentation for this behaviour.  Is my solution of processing
WM_SYSCOMMAND/SC_CLOSE & sending WM_DESTROY correct?
Technical Details
Message-ID: <1992Oct15.233010.26926@emr1.emr.ca>
Path: arc1-ca.pugleaf.net!sparky!uunet!utcsri!torn!cunews!nrcnet0!emr1!jagrant
References: <36560011@hpgrla.gr.hp.com> <1992Oct15.202628.13352@javelin.sim.es.com> <1992Oct15.232242.26579@emr1.emr.ca>

Show Full Headers
Complete Article Headers
Newsgroups: comp.os.ms-windows.programmer.misc
Path: arc1-ca.pugleaf.net!sparky!uunet!utcsri!torn!cunews!nrcnet0!emr1!jagrant
From: jagrant@emr1.emr.ca (John Grant)
Subject: how are IDCANCEL, WM_SYSCOMMAND/SC_CLOSE & WM_DESTROY related?
Message-ID: <1992Oct15.233010.26926@emr1.emr.ca>
Organization: Dept. of Energy, Mines, and Resources, Ottawa
References: <36560011@hpgrla.gr.hp.com> <1992Oct15.202628.13352@javelin.sim.es.com> <1992Oct15.232242.26579@emr1.emr.ca>
Date: Thu, 15 Oct 1992 23:30:10 GMT
Lines: 18