Bi0haZarD Posted March 6, 2006 Posted March 6, 2006 ok, not sure where to start with this one, but i'm hoping autoit can do this for me without the need of an external program..If you've ever used process explorer from Sysinternals then this should make some sence, if you click on an active process the bottom window has some data down there, i need to be able to close a specific Handle of a specific program.. heres an example...is that possible to do with autoit but without having to use send right clicks and stuff?thanks
cppman Posted March 7, 2006 Posted March 7, 2006 Are you trying to close the Actual program? or just like the child window or other window within the same application? If you just trying to close 1 application use ProcessClose ( "process" ) Miva OS Project
Moderators SmOke_N Posted March 7, 2006 Moderators Posted March 7, 2006 Have you tried using a combination of ProcessList()/WinList() to see if you can find the specific item that way? Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
Bi0haZarD Posted March 7, 2006 Author Posted March 7, 2006 i tried the processclose and processlist, neither one is what i'm lookin for. what i'm askin is every process runs multiple handles, such as in the screenshot above you can see the stuff in the bottom window, i need to be able to close the handle of a specific process without some external program (although i don't mind command line utilities as thats easy to do). the program i want to do this on checks for a specific handle to prevent multi instances.. if i manually close that handle i can run multiple instances of the app. (yes i know theres other ways to get around that but i'm hoping i don't have to make multiple local accounts and so on.) thanks
Moderators SmOke_N Posted March 7, 2006 Moderators Posted March 7, 2006 i tried the processclose and processlist, neither one is what i'm lookin for.what i'm askin is every process runs multiple handles, such as in the screenshot above you can see the stuff in the bottom window, i need to be able to close the handle of a specific process without some external program (although i don't mind command line utilities as thats easy to do).the program i want to do this on checks for a specific handle to prevent multi instances.. if i manually close that handle i can run multiple instances of the app. (yes i know theres other ways to get around that but i'm hoping i don't have to make multiple local accounts and so on.)thanksMy suggestion was not for ProcessList() alone, it was ProcessList()/WinList() combination. Have you tried that? Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
Moderators SmOke_N Posted March 7, 2006 Moderators Posted March 7, 2006 My suggestion was not for ProcessList() alone, it was ProcessList()/WinList() combination. Have you tried that?This is actually what I had in Mind.. (Not sure it will still work, but at least it's more than what you have been offered to this point)$GetWindowNamesAndHandles = GetWindowsFromEXE(ProcessExists('explorer.exe')); replace explorer with your actual exe name For $x = 1 To UBound($GetWindowNamesAndHandles) - 1 ConsoleWrite($GetWindowNamesAndHandles[$x] & @LF) Next Func GetWindowsFromEXE($exe_PID) Local $ListAll = '' Local $exe_WinList = WinList() For $i = 1 To $exe_WinList[0][0] $exe_WinPID = WinGetProcess($exe_WinList[$i][0]) If $exe_PID == $exe_WinPID Then $ListAll = $ListAll & 'EXE Window Name = ' & $exe_WinList[$i][0] & ' | ' & 'Handle of Window EXE = ' & $exe_WinList[$i][1] & Chr(01) EndIf Next Return StringSplit(StringTrimRight($ListAll, 1), Chr(01)) EndFunc Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
Onepissedpenguin Posted October 31, 2007 Posted October 31, 2007 so did you manage to get this thing running Biohazard? I am wanting to do the same thing because sometimes when I unmount my USB drive, explorer.exe still has a handle on the root of the drive, and I get the "cannot remove hardware/still in use/close open programs and try again" error. It is almost always explorer.exe that is the culprit and I either use sysinternals to close the program or (before I found sysinternals) i used to just close explorer.exe manually with the task manager. I don't want to use "force dismount" coz there might actually be something other than explorer.exe using the drive. Anyway, yeah that's my story and I'd like to know if you got this script working coz it would be a good solution. Eagles may soar, but weasels don't get sucked into jet engines.
Moderators SmOke_N Posted November 1, 2007 Moderators Posted November 1, 2007 so did you manage to get this thing running Biohazard? I am wanting to do the same thing because sometimes when I unmount my USB drive, explorer.exe still has a handle on the root of the drive, and I get the "cannot remove hardware/still in use/close open programs and try again" error. It is almost always explorer.exe that is the culprit and I either use sysinternals to close the program or (before I found sysinternals) i used to just close explorer.exe manually with the task manager.I don't want to use "force dismount" coz there might actually be something other than explorer.exe using the drive.Anyway, yeah that's my story and I'd like to know if you got this script working coz it would be a good solution.Last Seen: 3rd January 2007 - 12:43 AM Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now