AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How can i start my script as a service?

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Gosugenji



Joined: 07 May 2008
Posts: 35
Location: In your Internets

PostPosted: Tue Jun 17, 2008 11:27 pm    Post subject: How can i start my script as a service? Reply with quote

I already have it set in services.msc but my script doesnt execute with winidows for some reason.

The service is set to automatically launch, with allow service to interact with desktop checked, and set as system.
Back to top
View user's profile Send private message
Zippo()
Guest





PostPosted: Wed Jun 18, 2008 6:05 am    Post subject: Reply with quote

Have you seen this topic? http://www.autohotkey.com/forum/topic796.html+script+service
Back to top
Gosugenji



Joined: 07 May 2008
Posts: 35
Location: In your Internets

PostPosted: Thu Jun 19, 2008 11:02 pm    Post subject: Reply with quote

I have searched through the forums quite thoroughly and have seen that already.

My problem is when the user logs off, the .ahk script dies also. I want the script to remain in memory even if the user logs off..

EDIT: I have gotten the program to remain running, the only issue i have now is to have the ahk process run by system to log off the current user.. without closing the system ahk
Back to top
View user's profile Send private message
Sean



Joined: 12 Feb 2007
Posts: 1359

PostPosted: Fri Jun 20, 2008 2:17 am    Post subject: Reply with quote

Gosugenji wrote:
My problem is when the user logs off, the .ahk script dies also. I want the script to remain in memory even if the user logs off..

I think it's because AHK is a GUI app. Enough/hint said. I won't spit out any further on this.
Back to top
View user's profile Send private message
poo_noo



Joined: 08 Dec 2006
Posts: 103
Location: Sydney Australia

PostPosted: Fri Jun 20, 2008 4:15 am    Post subject: Reply with quote

I have used this http://www.autohotkey.com/forum/viewtopic.php?t=16870. See n-l-i-d 's post
_________________
Paul O
Back to top
View user's profile Send private message Visit poster's website
Gosugenji



Joined: 07 May 2008
Posts: 35
Location: In your Internets

PostPosted: Sun Jun 22, 2008 6:17 pm    Post subject: Reply with quote

i resolved this myself with a dll call Smile to make the script ignore closing and reload upon new user login.

OnMessage(WM_ENDSESSION := 0x0016, "ignore_logoff")

ignore_logoff(wParam, lParam) {
ENDSESSION_LOGOFF = 0x80000000
if (lParam & ENDSESSION_LOGOFF)
return true ; somehow this makes MainWindowProc() fail to see this.
else
ExitApp ; allow graceful shutdown
}
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group