|
Posted by Uri Dimant on July 11, 2006, 5:04 am
If you were Registered and logged in, you could reply and use other advanced thread options Thanks
However, I see, now that the OP upgrated the memory to 1.5gb the problem is
occured. .Well, I'm going to give my PC to the out technical person to
check out any hardware issues.
Thank you again
>> Vova (speak russian)?
>
> :) Yes we can, but the rest of the group would not understand us, plus the
> msnews.microsoft.com will not accept cyrrilcs in this NG.
>
> [...]
>> Cn you point me to the OP's solution or the app's code?
>
> You may read the whole thread:
>
http://groups.google.com/group/microsoft.public.development.device.drivers/browse_frm/thread/ee0b892e1f0e7a8d/6d7005fbb9585df5?tvc=1&q=computer+is+shutdowning#6d7005fbb9585df5
>
> I don't remember whether he provided his source code but it should be
> trivial. Make the window, in it's window procedure handle
> WM_QUERYENDSESSION message. So, basically the code will look like this:
> (it may not compile cause I was getting it from MSDN/my memory)
>
> void DoCancelShutdown()
> {
> HWND hMainWndHandle = CreateWindow("STATIC", "szTitle",
> WS_OVERLAPPEDWINDOW, 0, 0, 13, 13, NULL, NULL, g_hInstance, NULL);
>
> if (hMainWndHandle != NULL)
> {
> LONG lPrev = SetWindowLong(m_hMainWndHandle , GWL_WNDPROC,
> reinterpret_cast<LONG>(MainPartWndProc));
>
> MSG msg = ;
> BOOL bRet;
>
> while( (bRet = GetMessage( &msg, NULL, 0, 0 )) != 0)
> {
> if (bRet == -1)
> {
> // handle the error and possibly exit
> }
> else
> {
> TranslateMessage(&msg);
> DispatchMessage(&msg);
> }
> }
>
> }
> }
>
> /* wnd proc */
> LRESULT WINAPI MainPartWndProc(HWND hWnd, UINT uMessage, WPARAM wParam,
> LPARAM lParam)
> {
> switch (uMessage)
> {
> case WM_QUERYENDSESSION:
> return FALSE; /// RETURN FALSE
> break;
> case WM_ENDSESSION:
> return FALSE; /// RETURN FALSE
> break;
> }
>
> return DefWindowProc(hWnd, uMessage, wParam, lParam);
> }
>
> --
> Vladimir
>
>
|