SorryButImaNewbie Posted February 9, 2015 Posted February 9, 2015 (edited) Hello! I try to make a simple script, where a function is going to exit from a program I tried to get it fone with wingetprocess and processclose, but it gave back -1 so I tried to get the win handle and use that to get the process, it returns: 0x0000000 (+/- a few 0) which implies that it found the window. However If he found the window, he should return the handle, and I'm not sure if 0x0000000 is a handle My code, I used for debugging: Func UD_uszi_kilepes() Sleep(500) Local $UD_usziGUIHandle Local $UD_usziPID $UD_usziGUIHandle = WinGetHandle("UD Üszi - verzió") MsgBox(0, "Flag", $UD_usziGUIHandle) ;0x00000000 $UD_usziPID = WinGetProcess($UD_usziGUIHandle) MsgBox(0, "Flag", "Lefutok papa!" & $UD_usziPID &"") ;Daddy, I run! -1 ProcessClose($UD_usziPID) $UD_uszi_kilepesRun = False ;Flag that runs the operation when true, I change it with a button to true, and check for it in the idle loop. Also its global and declered false at the beginning of the code EndFunc ;==>UD_uszi_kilepes it doesnt find the window with WinExists("UD Üszi - verzió : 3.0.1") (I want to avoid version number), and couldn't use WinKill neither. Anyidea, why I can't find the window/process? Thank you for your insight! Edit: tried with TUDUsziMainForm (Class of the window) (attached a png of the au3 info tool about the window) Edited February 9, 2015 by SorryButImaNewbie
Solution SorryButImaNewbie Posted February 9, 2015 Author Solution Posted February 9, 2015 (edited) Hello again! I was able to found an older >thread where Master Monamo wrote a script to a guy to list all window handle to an array! Well If you read it Mr Monamo, then thank you! My debugger MsgBox showed a reutrn value of 1 instead of 0. I'm gonna try it in my original script, but I'm pretty sure that it will work! (edit: it worked) (Now my question is, how come that WinList shows a different title, then the AU3 info? just to educate myself) Edited February 9, 2015 by SorryButImaNewbie
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