Click here to Skip to main content
15,899,754 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Serializatoin Pin
jmkhael21-Mar-03 1:30
jmkhael21-Mar-03 1:30 
GeneralAbout CPropertyView Using Pin
liuxiaojun20-Mar-03 21:20
liuxiaojun20-Mar-03 21:20 
GeneralInternational Software Pin
Olli20-Mar-03 20:07
Olli20-Mar-03 20:07 
GeneralRe: International Software Pin
Roger Allen21-Mar-03 0:03
Roger Allen21-Mar-03 0:03 
GeneralRe: International Software Pin
Olli23-Mar-03 19:46
Olli23-Mar-03 19:46 
GeneralRe: International Software Pin
John R. Shaw21-Mar-03 10:27
John R. Shaw21-Mar-03 10:27 
GeneralRe: International Software Pin
Olli23-Mar-03 19:48
Olli23-Mar-03 19:48 
Generala small problem with windows messages (SDK) Pin
r i s h a b h s20-Mar-03 19:54
r i s h a b h s20-Mar-03 19:54 
dear all,
i've written a small piece of code ( a hidden window) which detects windows shutdown and then logs the timestamp in a file. i'm using the following code in the message loop-

while(GetMessage(&Msg, hwnd, 0, 0) > 0)
{
if (flg_shutdown == 1)
{
flg_shutdown = 0;
Run(); //logs time stamp in a file
ShutDown(); // shutsdown the system using ExitWindowsEx(...)
}
TranslateMessage(&Msg);
DispatchMessage(&Msg);
}

now my wm_queryendsession handler is as follows

case WM_QUERYENDSESSION:
{
if (lParam & ENDSESSION_LOGOFF)
flg_type = 1; //logoff
else
flg_type = 2; //shut down
flg_shutdown = 1;
return false; // don't shutdown now. shutdown after Run() is executed
}
break;

the problem is that when i logoff/shutdown nothing happens until i do something with the window (move cursor over it or click on it or resize it).
when i do so, everything works fine.

what could be the problem. i even tried the following message loop

while(GetMessage(&Msg, hwnd, 0, 0) > 0)
{
TranslateMessage(&Msg);
DispatchMessage(&Msg);
if (flg_shutdown == 1)
{
flg_shutdown = 0;
Run(); //logs time stamp in a file
ShutDown(); // shutsdown the system using ExitWindowsEx(...)
}
}
but same problem.

can someone help me out.

Thanx and Regards

GeneralRe: a small problem with messages (SDK) Pin
Oliver Anhuth20-Mar-03 20:58
Oliver Anhuth20-Mar-03 20:58 
GeneralRe: a small problem with messages (SDK) Pin
r i s h a b h s20-Mar-03 22:05
r i s h a b h s20-Mar-03 22:05 
GeneralRe: a small problem with messages (SDK) Pin
Oliver Anhuth20-Mar-03 22:12
Oliver Anhuth20-Mar-03 22:12 
Generalsocket question (listen, accept) Pin
Daniel Strigl20-Mar-03 19:42
Daniel Strigl20-Mar-03 19:42 
GeneralRe: socket question (listen, accept) Pin
Joaquín M López Muñoz20-Mar-03 20:00
Joaquín M López Muñoz20-Mar-03 20:00 
GeneralRe: socket question (listen, accept) Pin
Daniel Strigl20-Mar-03 20:10
Daniel Strigl20-Mar-03 20:10 
GeneralRe: socket question (listen, accept) Pin
Olli20-Mar-03 20:19
Olli20-Mar-03 20:19 
GeneralRe: socket question (listen, accept) Pin
Daniel Strigl20-Mar-03 21:08
Daniel Strigl20-Mar-03 21:08 
QuestionHow toget notification when any program or executable terminates Pin
Kumar Siddhartha20-Mar-03 18:51
Kumar Siddhartha20-Mar-03 18:51 
AnswerRe: How toget notification when any program or executable terminates Pin
Nish Nishant20-Mar-03 20:02
sitebuilderNish Nishant20-Mar-03 20:02 
GeneralRe: How toget notification when any program or executable terminates Pin
Anonymous20-Mar-03 20:56
Anonymous20-Mar-03 20:56 
GeneralEfficient string searching (advice required) Pin
paulhans20-Mar-03 18:21
paulhans20-Mar-03 18:21 
GeneralRe: Efficient string searching (advice required) Pin
Joaquín M López Muñoz20-Mar-03 20:08
Joaquín M López Muñoz20-Mar-03 20:08 
GeneralRe: Efficient string searching (advice required) Pin
Gunnar Bolle20-Mar-03 21:45
Gunnar Bolle20-Mar-03 21:45 
GeneralRe: Efficient string searching (advice required) Pin
Joaquín M López Muñoz20-Mar-03 21:54
Joaquín M López Muñoz20-Mar-03 21:54 
GeneralRe: Efficient string searching (advice required) Pin
Gunnar Bolle20-Mar-03 21:59
Gunnar Bolle20-Mar-03 21:59 
GeneralRe: Efficient string searching (advice required) Pin
jhwurmbach20-Mar-03 23:06
jhwurmbach20-Mar-03 23:06 

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.