View Full Version : Visual Patch 3.0 - g_EnsureProgramIsClosed()
GnaisH
08-21-2007, 12:32 PM
Anybody notice that this function does not work in a 64bit Windows OS? I realized that when I tried to output all the running processes using the following code, the processes paths are empty.
tblProcesses = Window.EnumerateProcesses();
if(tblProcesses)then
strOutput = "";
for handle,path in tblProcesses do
strOutput = strOutput..handle.."="..path.."\r\n";
end
Dialog.Message("Output",strOutput);
end
The attached screenshot shows the results in a Windows 64bit Vista. The only process that is seen is our software's TrueUpdate running in the background.
All of this code works properly on a 32bit Windows OS. Does anybody know how to find running processes in a 64bit Windows OS? or even making the g_EnsureProgramIsClose function in Visual Patch work in a 64bit Windows OS?
Eagle
08-22-2007, 11:06 AM
cupple comments:
1. tblProcesses = Window.EnumerateProcesses();
will only acheive this: for 32bit And 64bit.
"Note: In order for a window to be classified as a top level window, it must not have an owner window and must be visible."
whereas:
tblProcesses = Window.EnumerateProcesses(false);
will reveal some more..(set to 'all levels' visible or not)
open_processes = System.EnumerateProcesses();
usually shows all proccesses(images) running on a 32 bit
one reason why some of these actions don't reveal all on ANY 64Bit
OS is that IR runtimes are 32bit(x86), so any non 32 bit system resource
or other true 64bit Image (.exe, .dll) will more than likely not be available
to the IR action because of this '32bit limitation'
which to be open about it, is showing up as time goes on, the lack of 64bit support
with regards to:
function g_IsProcessRunning(FileName)
local tblProcesses = Window.EnumerateProcesses();
local bProcessFound = false;
if(tblProcesses)then
local strProcessName;
local nHandle;
for nHandle, strProcessName in tblProcesses do
if(String.Find(strProcessName,FileName,1,false) ~= -1)then
bProcessFound = true;
end
end
end
return bProcessFound;
end
I would prefer : String.Find(...) be changed to String.CompareNoCase(...)
to cover the occassional scenario where 'myapp'.exe could be part
of another unrelated Application or running proccess name:
eg billys'myapp'.exe
in otherwords it is either the exact target name(upper\lowercase) or it
just plain well is'nt. - just my 2 bob 'constructive comments' hopefully :)
as an asside: temporarily Disabling 'file system redirection' on
verified 64bit OSs may solve some of the 32bit Runtime 'action issues'
if I'm off target with any of this please feel free to cut me off at the neck .
Eagle
08-23-2007, 02:24 PM
this may help you out a little:
http://www.indigorose.com/forums/showthread.php?p=107019#post107019
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.