| View previous topic :: View next topic |
| Author |
Message |
jwfv Valued Contributor

Joined: 19 Mar 2002 Posts: 422 Location: Beaufort, SC
|
Posted: Wed May 20, 2009 1:22 pm Post subject: Closing program when exiting windows |
|
|
I have created a small utility that:
- creates a taskicon
- sits and waits for either a click on the taskicon or a hotkey event, which runs another program. The click displays a menu that gives the option to close the program
- if the program gets a "close" event, it closes itself
On my local computer, this works fine. When I log off, the program closes without a problem.
However, I have it running on a terminal server (Windows Server 2003) and when the user logs off, it does not close the program. I get no error message, but the session will not log off. Once I close my program, I can log off fine.
Here is the odd thing - on another server that we have, it works fine. It is something about that particular server that it doesn't seem to issue the correct "close" message to my program.
Has anyone ever come across this? Any suggestions?
Joe _________________ Joe Floyd |
|
| Back to top |
|
 |
PGWARE Web Host

Joined: 29 Dec 2001 Posts: 1565
|
Posted: Wed May 20, 2009 4:42 pm Post subject: |
|
|
| Windows sends a WM_QUERYENDSESSION message to all programs/windows opened, each app needs to return TRUE or FALSE immediately telling windows if it should shutdown. I think VDS taskicon apps have had this problem for awhile now. You may be able to use gadgetx to intercept this message and return TRUE to allow the shutdown. |
|
| Back to top |
|
 |
jwfv Valued Contributor

Joined: 19 Mar 2002 Posts: 422 Location: Beaufort, SC
|
Posted: Wed May 20, 2009 6:02 pm Post subject: |
|
|
I saw something about that on another thread, so I added the following lines to my program:
| Code: | OPTION MSGEVENT,$11,WM_QUERYENDSESSION,HANDLED
OPTION MSGEVENT,$16,WM_ENDSESSION,HANDLED
:WM_QUERYENDSESSION
stop
:WM_ENDSESSION
stop |
I never really work with MSGEVENT, so I'm not even sure if the above syntax is correct, but at any rate it didn't solve the problem. _________________ Joe Floyd |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|