2012-12-22, 05:36
(2012-12-22, 03:42)harSon Wrote: I've used the code and compiled it into an exe, and when I launch it, XBMC does minimize and the game starts up but eventghost does not close and my xpadder keys don't work (it's open, but I'd imagine ghostevent is overriding it):
You might try changing eventghost.exe to EventGhost.exe in the script above,however you probably just want to kill the process.
The previous script suspends the eventghost.exe. this one kills it:
Code:
#NoEnv
#Singleinstance force
DetectHiddenWindows, On
SendMode Input
SetWorkingDir %A_ScriptDir%
SetTitleMatchMode, 3
Autotrim, off
MouseMove, 9999,-9999
WinHide, ahk_class Shell_TrayWnd
WinHide, Start ahk_class Button
WinMinimize, XBMC
Process, Exist, xbmc.exe
xbmc_pid=%errorLevel%
If (xbmc_pid = 0)
{
{
If ! errorLevel
{
}
}
}
else
{
Process_Suspend("xbmc.exe")
run, taskkill /F /IM EventGhost.exe
}
Run, "C:\program files (x86)\xpadder\xpadder.exe" /m CODBO2.xpadderprofile
Runwait, "C:\Program Files (x86)\Activision\Call of Duty Black Ops II\t6sp.exe" "%1%"
Run, "C:\program files (x86)\xpadder\xpadder.exe" /m nolayout1.xpadderprofile
Process_Resume("xbmc.exe")
Run, "C:\Program Files (x86)\EventGhost\EventGhost.exe"
Process_Resume("EventGhost.exe")
WinShow, ahk_class Shell_TrayWnd
WinShow, Start ahk_class Button
WinRestore, XBMC
exitapp
esc::
exit
ProcExist(PID_or_Name=""){
Process, Exist, % (PID_or_Name="") ? DllCall("GetCurrentProcessID") : PID_or_Name
Return Errorlevel
}
Process_Resume(PID_or_Name){
PID := (InStr(PID_or_Name,".")) ? ProcExist(PID_or_Name) : PID_or_Name
h:=DllCall("OpenProcess", "uInt", 0x1F0FFF, "Int", 0, "Int", pid)
If !h
Return -1
DllCall("ntdll.dll\NtResumeProcess", "Int", h)
DllCall("CloseHandle", "Int", h)
}
Process_Suspend(PID_or_Name){
PID := (InStr(PID_or_Name,".")) ? ProcExist(PID_or_Name) : PID_or_Name
h:=DllCall("OpenProcess", "uInt", 0x1F0FFF, "Int", 0, "Int", pid)
If !h
Return -1
DllCall("ntdll.dll\NtSuspendProcess", "Int", h)
DllCall("CloseHandle", "Int", h)
}