Sign in to follow this  
Followers 0
narayanjr

ControlSend()

23 posts in this topic

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

Share this post


Link to post
Share on other sites



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

Share this post


Link to post
Share on other sites

Well if that is how it is suppose to be it didn't work either

Any other ideas?

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

if you can put that itemlevel.exe on rapidshare maybe we can figure something out

Edited 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

Share this post


Link to post
Share on other sites

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.... :D

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

ControlSend("C:\ItemLevel.exe","", "" ,"{ENTER}")

ControlSend ( "title", "text", controlID, "string" [, flag] )

Try that

Edited 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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

There it is thats the program.

I had already tried using 0 and also using Empty "" but neither worked

ItemLevel.exe

Edited by narayanjr

Share this post


Link to post
Share on other sites

HotKeySet("{SPACE}", "Enter")

WinActivate(@ScriptDir & "\ItemLevel.exe")

$Hnd= WinGetHandle(@ScriptDir & "\ItemLevel.exe")

ConsoleWrite($Hnd& @CRLF)

While 1

Sleep(4000)

WEnd

Func Enter()

ControlSend($Hnd,"","","{ENTER}")

ConsoleWrite(@error & @CRLF)

EndFunc

seems 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

Share this post


Link to post
Share on other sites

#11 ·  Posted (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 by narayanjr

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

I have the itemlevel.exe minimized yes

though i put the script and the exe in the same directory

Edited 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

Share this post


Link to post
Share on other sites

hmm

What is the ControlSend line you used?

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

sends enter to handle of your exe without the text or the command id

EDIT: Is it working or not?

Edited 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

Share this post


Link to post
Share on other sites

ControlSend($Hnd,"", "" ,"{ENTER}")

I used that and it doesnt work

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

#17 ·  Posted (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 by narayanjr

Share this post


Link to post
Share on other sites

and now I am really confused, I just tested ControlSend with Notepad, and it works, but I still get @error = 0

And your point is?? (@error=0 means it was successful, wasn't that what you wanted??)

Share this post


Link to post
Share on other sites

Return Value

Success: Returns 1. 
Failure: Returns 0 if window/control is not found.

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