JohnOne Posted October 14, 2010 Share Posted October 14, 2010 Sorry if this is obvious but I've never came across it in a thread. See how by default you click the running script tray icon and it pauses your script? Is the a way to programatically achieve that within autoit other that automating the system tray? AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Mat Posted October 14, 2010 Share Posted October 14, 2010 We know that the menu is a resource in AutoIt3.exe, and we also know the command id's of the items (look yourself ). We assume that the menu is controled by the AutoIt hidden window (I checked this a few months ago when I did some work with setting the icon for the default systray item). From that, you know that you just need to send the same message to the AutoIt hidden window with the command id. Simple? Try it. I don't have autoit now but I'll do some testing for you later. If you want to cheat then use winspector or something similar to get the message queue for the window, but it's not really necessary, we know that it uses standard menu events. AutoIt Project Listing Link to comment Share on other sites More sharing options...
JohnOne Posted October 14, 2010 Author Share Posted October 14, 2010 <stares blankly at screen> Thanks mat, way over my head though buddy, but I'll look into it. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Mat Posted October 14, 2010 Share Posted October 14, 2010 (edited) I'm onto it now, it's actually something I was thinking of the other day. Edit: Here is my example of changing the icon of the default systray item: http://www.autoitscript.com/forum/index.php?showtopic=115222 Edited October 14, 2010 by Mat AutoIt Project Listing Link to comment Share on other sites More sharing options...
JohnOne Posted October 14, 2010 Author Share Posted October 14, 2010 Sound good they way you describe it Mat, and since the interpeter is included when it becomes a compiled script, would I be right assume it would still work? AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Mat Posted October 14, 2010 Share Posted October 14, 2010 Yes... The only problem is that it doesn't work. I think that AutoIt only uses the messages when the menu is in use, so the menu needs to be in use for this method to work. This is what I was testing: ;~ See this page for details on WM_COMMAND: ;~ * http://msdn.microsoft.com/en-us/library/ms647591(VS.85).aspx #include<SendMessage.au3> #include<WindowsConstants.au3> $sTitle = 'B41A52A8-B1E5-42AF-A5E9-E1A1C1C414BE' ; Unique? AutoItWinSetTitle($sTitle) $CmdId = 167 ; From reshacker $hWnd = WinGetHandle($sTitle) MsgBox(0, "Pause test", StringFormat("Command ID: %d\r\nWindow Handle: 0x%x", $CmdId, $hWnd)) $ret = _SendMessage($hWnd, $WM_COMMAND, $CmdId) MsgBox(0, "Pause test", StringFormat("Return: %d", $ret)) AutoIt Project Listing Link to comment Share on other sites More sharing options...
JohnOne Posted October 14, 2010 Author Share Posted October 14, 2010 Ah well, good effort anyway. Thanks Mat. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. 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