mircea Posted May 19, 2011 Share Posted May 19, 2011 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 expandcollapse popupautoItSetOption("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 Link to comment Share on other sites More sharing options...
martin Posted May 19, 2011 Share Posted May 19, 2011 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 expandcollapse popupautoItSetOption("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. Link to comment Share on other sites More sharing options...
Blue_Drache Posted May 19, 2011 Share Posted May 19, 2011 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 Link to comment Share on other sites More sharing options...
mircea Posted May 19, 2011 Author Share Posted May 19, 2011 (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 May 19, 2011 by mircea Link to comment Share on other sites More sharing options...
enaiman Posted May 19, 2011 Share Posted May 19, 2011 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") 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 :) Link to comment Share on other sites More sharing options...
mircea Posted May 20, 2011 Author Share Posted May 20, 2011 Yes, thank you very much enaiman, you opened my eyes with this one Link to comment Share on other sites More sharing options...
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