Sign in to follow this  
Followers 0
mircea

Dificulties with wingethandle

6 posts in this topic

Hello guys, i made a program to read some values and compare it with some i added (so i used wingethandle for what to search and to compare i use again the wingethandle) but i want to make the program that if he reads 2 times the same error (For example Test1) to add a image (for that i use splashtexton or splashimageon)

My problem is i want to make the program to remeber if he sees the error 2 times (1 after 1 ) to do splashscreen) and after that to rewait until he see again 2 errors from b or c. I tried with If and Else but no succes it goes directly to value 2.

Could you guys help me with this one

autoItSetOption("WinTitleMatchMode", 4)

$handle = WinGetHandle("classname=WindowsForms10.Window.8.app.0.378734a")

$a = WinGetHandle("classname=WindowsForms10.Window.8.app.0.378734a","Test1")
$b = WinGetHandle("classname=WindowsForms10.Window.8.app.0.378734a","Test2")
$c = WinGetHandle("classname=WindowsForms10.Window.8.app.0.378734a","Test3")




dim $a1, $a2, $a3, $a4


    
Switch $handle 
    Case $a 
        Msgbox(0,"Test A","Test A")
        $a1 = iniwrite("data.ini","Remeber","a","1")
            if iniread("data.ini","Remeber","a","1") then 
                    $a3 = iniwrite("data.ini","Remeber","a","2")
                        if iniread("data.ini","Remeber","a","2") then 
                            msgbox(0,"The error has bin 2 times ", "Two times error Test1")
                        Else 
                            msgbox(0,"error", "Problem at second If")
                        EndIf
            Else            
                msgbox(0,"error", "Problem at first If")
            EndIf
                            
                            
                            
                            
    Case $b
        Msgbox(0,"Test B","TEST B")
    Case $c
        msgbox(0,"Test C","Test C")
    EndSwitch

Share this post


Link to post
Share on other sites



Hello guys, i made a program to read some values and compare it with some i added (so i used wingethandle for what to search and to compare i use again the wingethandle) but i want to make the program that if he reads 2 times the same error (For example Test1) to add a image (for that i use splashtexton or splashimageon)

My problem is i want to make the program to remeber if he sees the error 2 times (1 after 1 ) to do splashscreen) and after that to rewait until he see again 2 errors from b or c. I tried with If and Else but no succes it goes directly to value 2.

Could you guys help me with this one

autoItSetOption("WinTitleMatchMode", 4)

$handle = WinGetHandle("classname=WindowsForms10.Window.8.app.0.378734a")

$a = WinGetHandle("classname=WindowsForms10.Window.8.app.0.378734a","Test1")
$b = WinGetHandle("classname=WindowsForms10.Window.8.app.0.378734a","Test2")
$c = WinGetHandle("classname=WindowsForms10.Window.8.app.0.378734a","Test3")




dim $a1, $a2, $a3, $a4


    
Switch $handle 
    Case $a 
        Msgbox(0,"Test A","Test A")
        $a1 = iniwrite("data.ini","Remeber","a","1")
            if iniread("data.ini","Remeber","a","1") then 
                    $a3 = iniwrite("data.ini","Remeber","a","2")
                        if iniread("data.ini","Remeber","a","2") then 
                            msgbox(0,"The error has bin 2 times ", "Two times error Test1")
                        Else 
                            msgbox(0,"error", "Problem at second If")
                        EndIf
            Else            
                msgbox(0,"error", "Problem at first If")
            EndIf
                            
                            
                            
                            
    Case $b
        Msgbox(0,"Test B","TEST B")
    Case $c
        msgbox(0,"Test C","Test C")
    EndSwitch

For me at least you need to give a very much clearer explanation of what you are trying to do before I could make any sensible suggestion.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

Your using the wrong function. $hwndVariable = WinGetHandle() does nothing but return the handle of a window. Window handles do not change as long as the window remains alive. Once that window is closed, that handle is released and may be attached to another window entirely.

What you need is a simple increment counter.

$iCounter += 1


Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Im trying to make an aplication which compares 2 values (The value that reads from the program and the value that reads from what i putted) example $A.

And if the program sees that error 2 times (If $handle = $a ) to appear a image (splahimageon) on which say hey you have a error. And after user press Enter to start again to wait for those errors.

The only problem that i have is how can i make to remeber the values and compare it.

I really need to specify im not trying to make any viruses, cracks, spy or anything or dunno what could think it will be. This is a program for automation for scanning and remebering the error.

@Blue_Drache

You are absolutley right, but if i use in this way

$handle = WinGetHandle("classname=WindowsForms10.window.8.app.0.378734a")

The handle scanns that classname and searchs for titles if he see there something like $a it gives me a error.

$a = WinGetHandle("classname=WindowsForms10.window.8.app.0.378734a","TestA")

Edited by mircea

Share this post


Link to post
Share on other sites

Gave @mircea an answer via PM.

I'll probably follow the issue with him to the end via PMs too.

@martin, @Blue_Drache

Don't worry about this issue. It's easier for me to help him because I can talk to @mircea in his own language (no "english barrier") :unsure:


SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

Share this post


Link to post
Share on other sites

Yes, thank you very much enaiman, you opened my eyes with this one

Share this post


Link to post
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
Sign in to follow this  
Followers 0