Solved

Resisting Quit (or WM_QUIT)

Posted on 1997-08-27
3
274 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
  • 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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

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.  …
In this article, I will show how to use the Ribbon IDs Tool Window to assign the built-in Office icons to a ribbon button.  This tool will help us to find the OfficeImageId that corresponds to our desired built-in Office icon. The tool is part of…
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…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

758 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now