Jump to content

Elusive handle


Go to solution Solved by SorryButImaNewbie,

Recommended Posts

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)

post-88591-0-26989900-1423470421_thumb.p

Edited by SorryButImaNewbie
Link to comment
Share on other sites

  • Solution

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 by SorryButImaNewbie
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...