| View previous topic :: View next topic |
| Author |
Message |
Gosugenji
Joined: 07 May 2008 Posts: 35 Location: In your Internets
|
Posted: Tue Jun 17, 2008 11:27 pm Post subject: How can i start my script as a service? |
|
|
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 |
|
 |
Zippo() Guest
|
|
| Back to top |
|
 |
Gosugenji
Joined: 07 May 2008 Posts: 35 Location: In your Internets
|
Posted: Thu Jun 19, 2008 11:02 pm Post subject: |
|
|
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 |
|
 |
Sean
Joined: 12 Feb 2007 Posts: 1359
|
Posted: Fri Jun 20, 2008 2:17 am Post subject: |
|
|
| 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 |
|
 |
poo_noo
Joined: 08 Dec 2006 Posts: 103 Location: Sydney Australia
|
|
| Back to top |
|
 |
Gosugenji
Joined: 07 May 2008 Posts: 35 Location: In your Internets
|
Posted: Sun Jun 22, 2008 6:17 pm Post subject: |
|
|
i resolved this myself with a dll call 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 |
|
 |
|