View Full Version : need help } if a window is detected then change something
nad46
04-27-2008, 06:40 AM
alright the title isnt clear but
what i want is when a specific EXE is open then a label is changed
such as
label game.EXE : not opened
and once it detects as the EXE as open
then
game.EXE : open
nad46
04-27-2008, 06:58 AM
im thinking may useing Window.EnumerateProcesses and the procsess game.EXE then label.settext to whatever
but im not sure can some 1 help me out:huh:huh
123456789
04-27-2008, 07:27 AM
Hi
This is for 50% of your work!
I can not other 50% ! because i'm newbie
run this project and then
you run the "game.exe" and see result in lable
screwed over
04-27-2008, 07:32 AM
function FindRunningEXE(exeName)
local eProc = Window.EnumerateProcesses(true);
for handle, ProcPath in eProc do
local spPath = String.SplitPath(ProcPath);
local lspPath = String.Lower(spPath.Filename..spPath.Extension);
local lexeName = String.Lower(exeName);
if lspPath == lexeName then
return handle
end
end
end
handle = FindRunningEXE("game.exe")
if handle ~= nil then
Label.SetText("Label1", handle);
else
Label.SetText("Label1", "Not open");
end
returns nil if the process isnt running, it returns the window handle otherwise.
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.