View Full Version : need help
Martin_SBT
10-07-2004, 10:17 AM
cant find how to do the following things:
read a reg key that contain the install path and make %AppFolder% equal to that value.
Read a reg key that contain actual software revision and display it into a dialog.
check to see if a process "test.exe" is running and if so force it to close, even if there are many instances of this process that are running.
thanks in advance for any help you can provide
Martin
Jason Pate
10-07-2004, 11:06 AM
ProductVer = INIFile.GetValue(_SourceDrive.."\\ver.inf", "Section", "Value");
SessionVar.Set("%MySessionVar%",ProductVer);
Is how I am doing it out of an INI for the vers
ProductVer = Registry.GetValue(HKEY_LOCAL_MACHINE, "\\software\\Product Name", "ver") Reg I take it would look something like this but ProductVer is what is on the screen at design time.
Martin_SBT
10-07-2004, 11:16 AM
Thanks much Jason, it did helped!
Now what about the processes part of my question? Anyone?
thanks
MT
Brett
10-07-2004, 12:27 PM
Here is a function that will find and close a process by name:
function FindAndCloseProcessByName(strName)
tblProcesses = Window.EnumerateProcesses();
local bProcessFound = false;
local nProcessHandle = nil;
if(tblProcesses)then
for nHandle, strProcessName in tblProcesses do
if(String.Find(strProcessName,strName,1,false) ~= -1)then
nProcessHandle = nHandle;
bProcessFound = true;
end
end
end
if(bProcessFound and nProcessHandle)then
Window.Close(nProcessHandle,CLOSEWND_SENDMESSAGE);
end
end
To use:
FindAndCloseProcessByName("test.exe");
Martin_SBT
10-07-2004, 12:43 PM
:yes
This is too cool Brett!
This works great!
Thanks so much
vBulletin® v3.7.3, Copyright ©2000-2009, Jelsoft Enterprises Ltd.