Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Windows exit trigger
#1
I am wondering whether a macro triggered by a windows exit trigger can prevent windows from turning-off, under certain conditions.

Thanks in advance.
#2
No.

Read in MSDN about WM_QUERYENDSESSION message. You'll need a window that exists all the time. When it receves the message, let it return 0.
Not tested.
#3
Dear Gintaras,

Thanks. I used a toolbar hooked to a procedure which it receives a WM_QUERYENDSESSION message :

Function Test_TWT_Proc
Code:
Copy      Help
,case WM_QUERYENDSESSION
,out "Got it"

It works. However, I am not sure whether I should add a command in the form "ret 0" to prevent windows from shutting down. I tried it, but it failed. I would appreciate any further advice.

Regards

Simos
#4
From 'Extended toolbars' topic in QM Help:

Quote:If the hook procedure returns a nonzero value, the message is not further processed in the default window procedure. Some messages (see below) also are not processed in the default toolbar window procedure. To return 0 without further processing, declare the function as long (function% ...), and return 0x100000000.
#5
Thanks, indeed.


Forum Jump:


Users browsing this thread: 1 Guest(s)