cvocvo Posted July 30, 2010 Share Posted July 30, 2010 (edited) I've written a service in AutoIt using the _Service UDF:http://www.autoitscript.com/forum/index.php?showtopic=80201&st=0 Now what I want to do is send a custom command from a C# app to the AutoIt service. It's shown how this is done in a C# service here: http://arcanecode.com/2007/05/30/windows-services-in-c-sending-commands-to-your-windows-service-part-7/ But does anyone know how that might be accomplished for the AutoIt service or IF it can be done? Thanks Edited July 30, 2010 by cvocvo Link to comment Share on other sites More sharing options...
PsaltyDS Posted July 30, 2010 Share Posted July 30, 2010 You can use the WMI Win32_Service object and $oSvc.UserControlService($iCmd). Note $iCmd is defined by WMI as uint8 (one byte), so only 0 thru 255 are valid. Also, I've learned anything you could reach in WMI can be reached with a sufficiently clever DllCall() too, if you're willing to do a little research. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
ricky Posted July 31, 2010 Share Posted July 31, 2010 Hello,Did you do it with autoit? I want to do the same but with autoit...You can use the WMI Win32_Service object and $oSvc.UserControlService($iCmd). Note $iCmd is defined by WMI as uint8 (one byte), so only 0 thru 255 are valid.Also, I've learned anything you could reach in WMI can be reached with a sufficiently clever DllCall() too, if you're willing to do a little research. Link to comment Share on other sites More sharing options...
PsaltyDS Posted August 2, 2010 Share Posted August 2, 2010 Not sure. I thought you wanted to send commands to a service. You want an AutoIt-based service to receive such commands. That probably means setting up a COM event handler for when your service's object gets a "UserControlService" event, or something similar. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law 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