Solved

Resisting Quit (or WM_QUIT)

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
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…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

685 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