Solved

Resisting Quit (or WM_QUIT)

Posted on 1997-08-27
3
335 Views
Last Modified: 2013-12-03
I'm trying to make a Windows 95 program (in VC5.0 w/ MFC) without a QUIT option, either by graying out the X in the upper-right corner, or by reopening the application after a quit (but without making a wrapper program).  Any suggestions?
0
Comment
Question by:mrisher
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 4

Accepted Solution

by:
davmarc earned 50 total points
ID: 1404950
To be sure you could intercept the messages WM_QUIT, WM_CLOSE and WM_DESTROY in your main window and just discard them, instead of letting the default WndProc close everything.

Davide Marcato.
0
 

Author Comment

by:mrisher
ID: 1404951
I'm a bit more of a neophyte than that -- how do I discard a message?  I tried making an OnClose, etc, function which just returned, but it didn't seem to work.

Thanks.
0
 
LVL 4

Expert Comment

by:davmarc
ID: 1404952
Using ClassWizard, add an entry to the message map of the main window (did you check if it is being added to CMainFrame?) for WM_CLOSE. If the body is empty (don't even call the base implementation...) it should work.
If it doesn't add a comment and I'll try testing myself.

Davide Marcato.
0

Featured Post

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows a few slightly more advanced techniques for Windows 7 gadget programming, including how to save and restore user settings for your gadget and how to populate the "details" panel that is displayed in the Windows 7 gadget gallery.  …
This article shows how to make a Windows 7 gadget that extends its U/I with a flyout panel -- a window that pops out next to the gadget.  The example gadget shows several additional techniques:  How to automatically resize a gadget or flyout panel t…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question