narayanjr Posted April 23, 2008 Posted April 23, 2008 This is really starting to annoy me. I wrote this program once before but lost it so I tried again and now i cant get the Control send to work for some reason. When it its the ControlSend line @error is set to 0, meaning window/control was not found Well I have no control to send it to and i have tried just using, Zero and just empty "" to see if it works and it still doesn't The WinActivate works so I'm assuming that it is finding the window ok just not a control. But I don't know what to do for a control since there is none. There is no ControlId or ClassNameNN so I am out of ideas and sadly I forget how i did it last time. Thanks for any help. Window Info: There is no visible or hidden text >>>>>>>>>>>> Window Details <<<<<<<<<<<<< Title: C:\ItemLevel.exe Class: ConsoleWindowClass Size: X: 4 Y: 2 W: 669 H: 338 >>>>>>>>>>> Mouse Details <<<<<<<<<<< Screen: X: 309 Y: 283 Cursor ID: 15 >>>>>>>>>>> Pixel Color Under Mouse <<<<<<<<<<< RGB: Hex: 0x000000 Dec: 0 >>>>>>>>>>> Control Under Mouse <<<<<<<<<<< Size: Control ID: ClassNameNN: Text: HotKeySet("{SPACE}", "Enter") WinActivate("C:\ItemLevel.exe") $Hnd= WinGetHandle("C:\ItemLevel.exe") ConsoleWrite($Hnd& @CRLF) While 1 Sleep(4000) WEnd Func Enter() ControlSend($Hnd,"", 0 ,"{ENTER}") ConsoleWrite(@error & @CRLF) EndFunc
C2C Posted April 23, 2008 Posted April 23, 2008 Shouldnt it be ControlSend("C:\ItemLevel.exe","",$Hnd,"{ENTER}") ?!? ----------------------------------90% of teens today would die if Myspace,Bebo + FaceBook had a system failure and was completely destroyed. If you are one of the 10% that would be laughing, copy and paste this to your signature.----------------------------------Code to win, 'till you die, 'till the compiler dies from your linesCode to win, take it all, just keep coding till you fallDay by day, codin' all the way, I'm not cavin' inLet another App begin, code to win
narayanjr Posted April 23, 2008 Author Posted April 23, 2008 Well if that is how it is suppose to be it didn't work either Any other ideas?
C2C Posted April 23, 2008 Posted April 23, 2008 (edited) if you can put that itemlevel.exe on rapidshare maybe we can figure something out Edited April 23, 2008 by C2C ----------------------------------90% of teens today would die if Myspace,Bebo + FaceBook had a system failure and was completely destroyed. If you are one of the 10% that would be laughing, copy and paste this to your signature.----------------------------------Code to win, 'till you die, 'till the compiler dies from your linesCode to win, take it all, just keep coding till you fallDay by day, codin' all the way, I'm not cavin' inLet another App begin, code to win
AdmiralAlkex Posted April 23, 2008 Posted April 23, 2008 ControlSend($Hnd,"", 0 ,"{ENTER}")Are you sure the control-id is zero?? If you don't know you should send to "" like: ControlSend($Hnd,"", "" ,"{ENTER}") Shouldnt it be ControlSend("C:\ItemLevel.exe","",$Hnd,"{ENTER}") ?!?WTF?? You need some glasses or english-lessons.... .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface
flip209 Posted April 23, 2008 Posted April 23, 2008 (edited) ControlSend("C:\ItemLevel.exe","", "" ,"{ENTER}")ControlSend ( "title", "text", controlID, "string" [, flag] )Try that Edited April 23, 2008 by flip209 " I haven't failed. I've just found 10,000 ways that won't work." Thomas Edison "You cannot help men permanently by doing for them what they could and should do for themselves." Abraham Lincoln
C2C Posted April 23, 2008 Posted April 23, 2008 but the OP said Well I have no control to send it to and i have tried just using, Zero and just empty "" to see if it works and it still Im quite confused right about now ----------------------------------90% of teens today would die if Myspace,Bebo + FaceBook had a system failure and was completely destroyed. If you are one of the 10% that would be laughing, copy and paste this to your signature.----------------------------------Code to win, 'till you die, 'till the compiler dies from your linesCode to win, take it all, just keep coding till you fallDay by day, codin' all the way, I'm not cavin' inLet another App begin, code to win
flip209 Posted April 23, 2008 Posted April 23, 2008 Huh? " I haven't failed. I've just found 10,000 ways that won't work." Thomas Edison "You cannot help men permanently by doing for them what they could and should do for themselves." Abraham Lincoln
narayanjr Posted April 23, 2008 Author Posted April 23, 2008 (edited) There it is thats the program. I had already tried using 0 and also using Empty "" but neither workedItemLevel.exe Edited April 23, 2008 by narayanjr
C2C Posted April 23, 2008 Posted April 23, 2008 HotKeySet("{SPACE}", "Enter")WinActivate(@ScriptDir & "\ItemLevel.exe")$Hnd= WinGetHandle(@ScriptDir & "\ItemLevel.exe")ConsoleWrite($Hnd& @CRLF)While 1 Sleep(4000)WEndFunc Enter() ControlSend($Hnd,"","","{ENTER}") ConsoleWrite(@error & @CRLF)EndFuncseems to work but i dont have Diablo installed so it reports no handle of diable window ----------------------------------90% of teens today would die if Myspace,Bebo + FaceBook had a system failure and was completely destroyed. If you are one of the 10% that would be laughing, copy and paste this to your signature.----------------------------------Code to win, 'till you die, 'till the compiler dies from your linesCode to win, take it all, just keep coding till you fallDay by day, codin' all the way, I'm not cavin' inLet another App begin, code to win
narayanjr Posted April 23, 2008 Author Posted April 23, 2008 (edited) When you are testing it do you have the window active? because for some reason even though it sets @error to 0 it still sends Enter to the active window Edited April 23, 2008 by narayanjr
C2C Posted April 23, 2008 Posted April 23, 2008 (edited) I have the itemlevel.exe minimized yes though i put the script and the exe in the same directory Edited April 23, 2008 by C2C ----------------------------------90% of teens today would die if Myspace,Bebo + FaceBook had a system failure and was completely destroyed. If you are one of the 10% that would be laughing, copy and paste this to your signature.----------------------------------Code to win, 'till you die, 'till the compiler dies from your linesCode to win, take it all, just keep coding till you fallDay by day, codin' all the way, I'm not cavin' inLet another App begin, code to win
narayanjr Posted April 23, 2008 Author Posted April 23, 2008 hmm What is the ControlSend line you used?
C2C Posted April 23, 2008 Posted April 23, 2008 (edited) sends enter to handle of your exe without the text or the command id EDIT: Is it working or not? Edited April 23, 2008 by C2C ----------------------------------90% of teens today would die if Myspace,Bebo + FaceBook had a system failure and was completely destroyed. If you are one of the 10% that would be laughing, copy and paste this to your signature.----------------------------------Code to win, 'till you die, 'till the compiler dies from your linesCode to win, take it all, just keep coding till you fallDay by day, codin' all the way, I'm not cavin' inLet another App begin, code to win
narayanjr Posted April 23, 2008 Author Posted April 23, 2008 ControlSend($Hnd,"", "" ,"{ENTER}") I used that and it doesnt work
C2C Posted April 23, 2008 Posted April 23, 2008 I dont see how. The script i pasted is very similar to yours and works just fine ----------------------------------90% of teens today would die if Myspace,Bebo + FaceBook had a system failure and was completely destroyed. If you are one of the 10% that would be laughing, copy and paste this to your signature.----------------------------------Code to win, 'till you die, 'till the compiler dies from your linesCode to win, take it all, just keep coding till you fallDay by day, codin' all the way, I'm not cavin' inLet another App begin, code to win
narayanjr Posted April 23, 2008 Author Posted April 23, 2008 (edited) I dont know why it would, but is it possible it has something to do with my computer or something? I'm using Windows Xp Home SP2 Im on an Acct with Admin access and now I am really confused, I just tested ControlSend with Notepad, and it works, but I still get @error = 0 Edit: but i had to use a control ID for it to work with notepad just leaving it blank didnt work Edited April 24, 2008 by narayanjr
AdmiralAlkex Posted April 24, 2008 Posted April 24, 2008 and now I am really confused, I just tested ControlSend with Notepad, and it works, but I still get @error = 0And your point is?? (@error=0 means it was successful, wasn't that what you wanted??) .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface
narayanjr Posted April 24, 2008 Author Posted April 24, 2008 Return Value Success: Returns 1. Failure: Returns 0 if window/control is not found.
AdmiralAlkex Posted April 24, 2008 Posted April 24, 2008 (edited) Thats what the function RETURNS, not the ERROR value it sets. (and you claim to be from USA?? ) Edited April 24, 2008 by AdmiralAlkex .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface
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