Solved

Resisting Quit (or WM_QUIT)

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

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

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

Suggested Solutions

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.  â€¦
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
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…

738 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