Click here to Skip to main content
16,005,206 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralWindows Calculator on 2003 Pin
harropj29-Jul-04 23:57
harropj29-Jul-04 23:57 
GeneralRe: Windows Calculator on 2003 Pin
Antti Keskinen30-Jul-04 2:22
Antti Keskinen30-Jul-04 2:22 
Generalwhen the system shuts down...... Pin
Anonymous29-Jul-04 22:53
Anonymous29-Jul-04 22:53 
GeneralRe: when the system shuts down...... Pin
Michael P Butler29-Jul-04 23:11
Michael P Butler29-Jul-04 23:11 
GeneralRe: when the system shuts down...... Pin
Anonymous29-Jul-04 23:41
Anonymous29-Jul-04 23:41 
GeneralRe: when the system shuts down...... Pin
Michael P Butler30-Jul-04 0:01
Michael P Butler30-Jul-04 0:01 
GeneralRe: when the system shuts down...... Pin
Antony M Kancidrowski30-Jul-04 0:23
Antony M Kancidrowski30-Jul-04 0:23 
GeneralRe: when the system shuts down......[modified] Pin
Antony M Kancidrowski30-Jul-04 0:04
Antony M Kancidrowski30-Jul-04 0:04 
This is not that straight forward. The flags that are sent are in the LPARAM of the message but are not directly accessable from the OnEndSession virtual function.

If you override the MFC message handler you can check the LPARAM for ENDSESSION_LOGOFF.

LRESULT CALLBACK CMainFrame::NewMsgHandlerFn(HWND hWnd,UINT uMsg,WPARAM wParam, LPARAM lParam)
{
  if( uMsg == WM_ENDSESSION )
  {
    // Check the lParam for ENDSESSION_LOGOFF
    if( lParam & ENDSESSION_LOGOFF )
    {
      // Do something to flag logoff
      return true;
    }

  }
  return CallWindowProc(s_pOldMsgHandler,hWnd,uMsg,wParam,lParam);
}


I hope that helps.

Ant.

I'm hard, yet soft.
I'm coloured, yet clear.
I'm fruity and sweet.
I'm jelly, what am I? Muse on it further, I shall return!
- David Williams (Little Britain)

GeneralRe: when the system shuts down......[modified] Pin
Michael P Butler30-Jul-04 0:35
Michael P Butler30-Jul-04 0:35 
GeneralRe: when the system shuts down......[modified] Pin
Antony M Kancidrowski30-Jul-04 1:08
Antony M Kancidrowski30-Jul-04 1:08 
GeneralRe: when the system shuts down......[modified] Pin
Michael P Butler30-Jul-04 1:11
Michael P Butler30-Jul-04 1:11 
GeneralRe: when the system shuts down......[modified] Pin
Anonymous30-Jul-04 1:21
Anonymous30-Jul-04 1:21 
GeneralRe: when the system shuts down......[modified] Pin
Anonymous30-Jul-04 0:42
Anonymous30-Jul-04 0:42 
GeneralRe: when the system shuts down......[modified] Pin
Antony M Kancidrowski30-Jul-04 0:53
Antony M Kancidrowski30-Jul-04 0:53 
Generalpassing parameters to a running program Pin
ting66829-Jul-04 22:35
ting66829-Jul-04 22:35 
GeneralRe: passing parameters to a running program [modified] Pin
Antony M Kancidrowski29-Jul-04 22:46
Antony M Kancidrowski29-Jul-04 22:46 
GeneralRe: passing parameters to a running program Pin
GDavy29-Jul-04 22:46
GDavy29-Jul-04 22:46 
GeneralBeginner - OLE DB - bind to grid control Pin
poptcat29-Jul-04 21:56
poptcat29-Jul-04 21:56 
Generalfailed to create empty document Pin
Anonymous29-Jul-04 21:24
Anonymous29-Jul-04 21:24 
GeneralRe: failed to create empty document Pin
Michael P Butler29-Jul-04 23:16
Michael P Butler29-Jul-04 23:16 
GeneralLogging data in MS-ACCESS......few problems!!! Pin
Anonymous29-Jul-04 20:48
Anonymous29-Jul-04 20:48 
GeneralRe: Logging data in MS-ACCESS......few problems!!! Pin
David Crow30-Jul-04 2:51
David Crow30-Jul-04 2:51 
GeneralRe: Logging data in MS-ACCESS......few problems!!! Pin
avenger_sb2530-Jul-04 8:28
avenger_sb2530-Jul-04 8:28 
GeneralNot able to set properties of newly developed Activex Control at run time Pin
samhita29-Jul-04 18:26
samhita29-Jul-04 18:26 
Generalfunction to determine the adminstrator and integration with a dialog based app Pin
Anonymous29-Jul-04 18:13
Anonymous29-Jul-04 18:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.