Sign in to follow this  
Followers 0
Vegar

Other alternative than Controlsend?

8 posts in this topic

Is there any other alternative to use when Controlsend does not work?

Share this post


Link to post
Share on other sites



AFAIK only MouseClick, or Send...

Sometime, when i get an error during a ControlClick, i solved it this way:

Do
    Sleep (10)
    $cc= ControlClick ("Title", "Text", "Control")
Until $cc = 1

Share this post


Link to post
Share on other sites

hmm...

cant get it to work ...

this is the line im trying to send

ControlSend("Spotify", "", "", "{ALTDOWN}f{ALTUP}{DOWN}{DOWN}{ENTER}")

i've tried you code to, but did not get any further

Share this post


Link to post
Share on other sites

The "Log out Vegar" menu item you see in your application you've previously posted about is probably posting a WM_COMMAND notification with a fixed ID number so you can use Spy++ or other tools like WinSpector to inspect the messages the menu item is posting and send these same massages or values to the window procedure of your application.

For example, sending F5 to the a minimized notepad window using ControlSend() won't trigger the menu item to output the current date to the text, but using _SendMessage() you can trigger the same message a F5 keystroke or clicking the menu item will trigger.

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

The "Log out Vegar" menu item you see in your application you've previously posted about is probably posting a WM_COMMAND notification with a fixed ID number so you can use Spy++ or other tools like WinSpector to inspect the messages the menu item is posting and send these same massages or values to the window procedure of your application.

For example, sending F5 to the a minimized notepad window using ControlSend() won't trigger the menu item to output the current date to the text, but using _SendMessage() you can trigger the same message a F5 keystroke or clicking the menu item will trigger.

little hard to understand, but i think i got it?

when i hit the "LogOut" button i got this message from Winspector:

WM_COMMAND
Code: 512
Control ID: 0
Control HWND: 0x0018038e

How can i use this?

Edited by Vegar

Share this post


Link to post
Share on other sites

Tried this:

#Include <SendMessage.au3>

$hWnd = WinGetTitle ("Spotify")

_SendMessage ($hWnd, "WM_COMMAND","0x0018038e")

and nothing happened

Share this post


Link to post
Share on other sites

Not wuite sure if it is the:

WM_COMMAND

Code: 512

Control ID: 0

Control HWND: 0x0018038e

that is the right one ...

but here is a picture of all WM_COMMAND id's i get when i "Log Out"

Posted Image

Someone that assume how i could do this? .. i'm very thankfull for all help :)

Sorry for my English.

Share this post


Link to post
Share on other sites

You should read the help file if you don't know what a function does or how to call it. Look in the help file for the _SendMessage() function, "WM_COMMAND" and $WM_COMMAND both are completely different values with different meaning.

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