Vegar Posted July 6, 2009 Share Posted July 6, 2009 Is there any other alternative to use when Controlsend does not work? Link to comment Share on other sites More sharing options...
MrChiliCheese Posted July 6, 2009 Share Posted July 6, 2009 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 Link to comment Share on other sites More sharing options...
Vegar Posted July 6, 2009 Author Share Posted July 6, 2009 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 Link to comment Share on other sites More sharing options...
Authenticity Posted July 6, 2009 Share Posted July 6, 2009 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. Link to comment Share on other sites More sharing options...
Vegar Posted July 6, 2009 Author Share Posted July 6, 2009 (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 July 6, 2009 by Vegar Link to comment Share on other sites More sharing options...
Vegar Posted July 6, 2009 Author Share Posted July 6, 2009 Tried this: #Include <SendMessage.au3> $hWnd = WinGetTitle ("Spotify") _SendMessage ($hWnd, "WM_COMMAND","0x0018038e") and nothing happened Link to comment Share on other sites More sharing options...
Vegar Posted July 6, 2009 Author Share Posted July 6, 2009 Not wuite sure if it is the:WM_COMMANDCode: 512Control ID: 0Control HWND: 0x0018038ethat is the right one ...but here is a picture of all WM_COMMAND id's i get when i "Log Out"Someone that assume how i could do this? .. i'm very thankfull for all help Sorry for my English. Link to comment Share on other sites More sharing options...
Authenticity Posted July 6, 2009 Share Posted July 6, 2009 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. 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