forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Closing program when exiting windows

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
jwfv
Valued Contributor
Valued Contributor


Joined: 19 Mar 2002
Posts: 422
Location: Beaufort, SC

PostPosted: Wed May 20, 2009 1:22 pm    Post subject: Closing program when exiting windows Reply with quote

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
View user's profile Send private message
PGWARE
Web Host


Joined: 29 Dec 2001
Posts: 1565

PostPosted: Wed May 20, 2009 4:42 pm    Post subject: Reply with quote

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
View user's profile Send private message
jwfv
Valued Contributor
Valued Contributor


Joined: 19 Mar 2002
Posts: 422
Location: Beaufort, SC

PostPosted: Wed May 20, 2009 6:02 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
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

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group