Guest MrMagoo Posted July 15, 2004 Report Posted July 15, 2004 here is a snippet from my progs message handler... case WM_DESTROY: if( gBadBoy == 0 ) PostQuitMessage(0); break; case WM_CLOSE: if( gBadBoy == 1 ) break; DoDefault: default: lResult = DefWindowProc(hwnd, msg, wp, lp); break; NOTE: gBadBoy is a variable I use to keep track of whether to allow the app to close or not... gBadBoy = 0 means the opsys can close me down gBadBoy = 1 means the opsys cannot close me down so, if i don't want to close i ignore WM_CLOSE and if i do want to close i fall through into the DefWindowProc code. The other part of the puzzle is catching WM_DESTROY: if i dont want to close i dont do anything and if i do want to close i call PostQuitMessage simple once u have it really... hope this helps
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now