azman Posted March 10, 2005 Share Posted March 10, 2005 (edited) I made small script to insert data into a grid with C#. I want when insert invalid data a messagebox will appear! How can i check this mess..box exist?. I also want when mess..box exist, this script will write in notepad the invalid data( to make report ). Please give me your opion! Thanks!!!! Edited March 10, 2005 by azman Link to comment Share on other sites More sharing options...
WHRobin566 Posted March 13, 2005 Share Posted March 13, 2005 (edited) well if the Box is called somin then you can do winwaitactive("whatever its called") if not then you chould do a pixelsearch for it like this and just search for somin on the window if pixelgetcolor(0, 0) = 0 Then except in 0 0 0 enter cords and color if you need somin to do that use spy. if you dont got that then heres a script to do it Hotkeyset("{F8}", "Debug") Func Debug() $Mouse = MouseGetPos() $pix = PixelGetColor($mouse[0], $mouse[1]) MsgBox (0, "MousePos", "X: " & $mouse[0] & "Y: " & $mouse[1] & "Color: "& $pix) EndFunc While 1 Sleep(10) Wend put the if pixelgetcolor where the part is that the box appears in your script. then well if it dosent find it then it will just skip it and thats all i have to say. as for notepad thats easy run("notepad.exe") winwaitactive("Untitled - Notepad") send("Error or whatever you want it to say") now if you want it show error then i got no clue on that. or maybe you chould do somin like after the if pixelsearch whatnot. Hotkeyset("{F3}", "Error") func Error() msgbox(0, "Error", "You had a error") endfunc This after pixsearch Send("{F3}") But im not sure if that whould stop script hmm well im not gonna test lol. also on notepad thing you might wanna activate other script back with. WinActivate("Title", Optional "Text") i think it is or it might be called somin else. Hope this helps! Edited March 13, 2005 by WHRobin566 Witch Hunter Robin Link to comment Share on other sites More sharing options...
azman Posted March 14, 2005 Author Share Posted March 14, 2005 well if the Box is called somin then you can dowinwaitactive("whatever its called")if not then you chould do a pixelsearch for it like this and just search for somin on the windowif pixelgetcolor(0, 0) = 0 Thenexcept in 0 0 0 enter cords and color if you need somin to do that use spy. if you dont got that then heres a script to do it Hotkeyset("{F8}", "Debug")Func Debug()$Mouse = MouseGetPos()$pix = PixelGetColor($mouse[0], $mouse[1])MsgBox (0, "MousePos", "X: " & $mouse[0] & "Y: " & $mouse[1] & "Color: "& $pix)EndFuncWhile 1Sleep(10)Wendput the if pixelgetcolor where the part is that the box appears in your script.then well if it dosent find it then it will just skip it and thats all i have to say.as for notepad thats easyrun("notepad.exe")winwaitactive("Untitled - Notepad")send("Error or whatever you want it to say")now if you want it show error then i got no clue on that.or maybe you chould do somin likeafter the if pixelsearch whatnot.Hotkeyset("{F3}", "Error")func Error()msgbox(0, "Error", "You had a error")endfuncThis after pixsearchSend("{F3}")But im not sure if that whould stop script hmm well im not gonna test lol.also on notepad thing you might wanna activate other script back with.WinActivate("Title", Optional "Text") i think it is or it might be called somin else.Hope this helps! <{POST_SNAPBACK}>Thanks! I thinks I can check a Mess exist!!! 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