Jump to content

ControlSend()


Recommended Posts

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
Link to comment
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

Link to comment
Share on other sites

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

Link to comment
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
Link to comment
Share on other sites

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

Link to comment
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

Link to comment
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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
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

Link to comment
Share on other sites

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
Link to comment
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??)
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...