JSThePatriot Posted August 28, 2006 Share Posted August 28, 2006 GetMessage. Good idea? I've never written an app that used OnEvent, never had issues with GetMessage. What will happen while you are in the middle of processing something the GUI will be un-responsive, where as in OnEvent mode the GUI will still get the messages it is supposed to most of the time, unless you are just running 100% CPU in a while loop, which I would recommend editing anyways. Below is a script that I use as my OnEvent template. Template - OnEventMode.au3expandcollapse popup;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ;Program Name: Template - OnEventMode ;Description: Template for OnEventMode GUI scripts ;Filename: Template - OnEventMode.au3 ;Used With: ;Created by: Jarvis J Stubblefield (support "at" vortexrevolutions "dot" com) ;Created on: 06/20/2006 ;Modified on: ;Modified by: ;Version: 0.0.1 ;Copyright: Copyright (C) 2006 Vortex Revolutions. All Rights Reserved. ;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ;---*** Declare Variables ***--- ;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Global $wHeight, $wWidth, $m_HWnd ;Window variables Global $wTitle ;Window variables II ;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ;---*** Preprocessor ***--- ;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< #include <GUIConstants.au3> Opt("GUIOnEventMode", 1) ;Set GUI to ONEvent Mode. ;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ;---*** File Installations ***--- ;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ;---*** Registry Information ***--- ;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ;---*** Command Line Options ***--- ;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< #cs UNCOMMENT FOR COMMANDLINE! If $CmdLine[0] > 0 Then If StringRight($CmdLine[1], 4) = ".ext" Then _SomeFunc($CmdLine[1]) Else _ErrorMsg("Incorret file extension. Please try again.") _TerminateApp() EndIf EndIf #ce ;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ;---*** Define Variables ***--- ;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< $wHeight = 300 $wWidth = 300 $wTitle = "Template - OnEventMode" ;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ;---*** GUI Creation ***--- ;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ;Main GUI Creation $m_HWnd = GUICreate($wTitle, $wWidth, $wHeight) ;Main Options $m_Options = GUICtrlCreateButton("Options", 5, ($wHeight - 25), 94, 20) ;Main Help $m_Help = GUICtrlCreateButton("Help", 103, ($wHeight - 25), 94, 20) ;Main Exit $m_Exit = GUICtrlCreateButton("Exit", 201, ($wHeight - 25), 94, 20) ;Disable Options and Help until added GUICtrlSetState($m_Options, $GUI_DISABLE) GUICtrlSetState($m_Help, $GUI_DISABLE) ;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ;---*** GUI Set Events ***--- ;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ;GUI Events Handled by _GUIEventHandler() GUICtrlSetOnEvent($m_Options, "_GUIEventHandler") GUICtrlSetOnEvent($m_Exit, "_GUIEventHandler") GUICtrlSetOnEvent($m_Help, "_GUIEventHandler") ;System Events Handled by _SysEventHandler() GUISetOnEvent($GUI_EVENT_CLOSE, "_SysEventHandler", $m_HWnd) GUISetOnEvent($GUI_EVENT_MINIMIZE, "_SysEventHandler", $m_HWnd) GUISetOnEvent($GUI_EVENT_RESTORE, "_SysEventHandler", $m_HWnd) GUISetOnEvent($GUI_EVENT_MAXIMIZE, "_SysEventHandler", $m_HWnd) GUISetOnEvent($GUI_EVENT_PRIMARYDOWN, "_SysEventHandler", $m_HWnd) GUISetOnEvent($GUI_EVENT_PRIMARYUP, "_SysEventHandler", $m_HWnd) GUISetOnEvent($GUI_EVENT_SECONDARYDOWN, "_SysEventHandler", $m_HWnd) GUISetOnEvent($GUI_EVENT_SECONDARYUP, "_SysEventHandler", $m_HWnd) GUISetOnEvent($GUI_EVENT_MOUSEMOVE, "_SysEventHandler", $m_HWnd) GUISetOnEvent($GUI_EVENT_RESIZED, "_SysEventHandler", $m_HWnd) GUISetOnEvent($GUI_EVENT_DROPPED, "_SysEventHandler", $m_HWnd) GUISetState(@SW_SHOW, $m_HWnd) ;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ;---*** Main Program Loop ***--- ;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< While 1 Sleep(100) WEnd ;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ;---*** GUI Event Functions ***--- ;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Func _GUIEventHandler() Switch @GUI_CtrlId Case $m_Exit _TerminateApp() Case $m_Options Case $m_Help EndSwitch EndFunc Func _SysEventHandler() Switch @GUI_CtrlId Case $GUI_EVENT_CLOSE GUIDelete($m_HWnd) _TerminateApp() Case $GUI_EVENT_MINIMIZE Case $GUI_EVENT_RESTORE Case $GUI_EVENT_MAXIMIZE Case $GUI_EVENT_PRIMARYDOWN Case $GUI_EVENT_PRIMARYUP Case $GUI_EVENT_SECONDARYDOWN Case $GUI_EVENT_SECONDARYUP Case $GUI_EVENT_MOUSEMOVE Case $GUI_EVENT_RESIZED Case $GUI_EVENT_DROPPED EndSwitch EndFunc ;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ;---*** Define Functions ***--- ;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Func _ErrorMsg($message) MsgBox(48 + 262144, "Error!", $message) EndFunc Func _TerminateApp() Exit EndFunc I hope that helps a bit. I know you have already written most of the GUI, but this really should only affect past the controls. Thanks for being so open, JS AutoIt Links File-String Hash Plugin Updated! 04-02-2008Â Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more) Link to comment Share on other sites More sharing options...
RagnaroktA Posted August 28, 2006 Author Share Posted August 28, 2006 What will happen while you are in the middle of processing something the GUI will be un-responsive, where as in OnEvent mode the GUI will still get the messages it is supposed to most of the time, unless you are just running 100% CPU in a while loop, which I would recommend editing anyways.Below is a script that I use as my OnEvent template.I hope that helps a bit. I know you have already written most of the GUI, but this really should only affect past the controls.Thanks for being so open,JSJS,The GUI is kinda massive, and since I would have to edit the parent and all child GUIs to use OnEvent, I'm going to go ahead and wait until I get the GUI finalized. I will change it though (might need some help, as I've never done it, and dont want messy code). Thanks for the suggestions, keep em coming! Current Projects:Remote Administration Suite Updated! 12-20-07Remote User State Migration Tool (Plugin) Updated! 12-20-07Batch Print Wizard Updated! 12-20-07Links:AutoIt Beta | AutoIt Wiki Link to comment Share on other sites More sharing options...
JSThePatriot Posted August 28, 2006 Share Posted August 28, 2006 JS,The GUI is kinda massive, and since I would have to edit the parent and all child GUIs to use OnEvent, I'm going to go ahead and wait until I get the GUI finalized. I will change it though (might need some help, as I've never done it, and dont want messy code). Thanks for the suggestions, keep em coming!Not a problem. That is all I can think of right at this moment in time. Let me know if and when I can help.Thanks,JS AutoIt Links File-String Hash Plugin Updated! 04-02-2008Â Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more) Link to comment Share on other sites More sharing options...
RagnaroktA Posted August 28, 2006 Author Share Posted August 28, 2006 Not a problem. That is all I can think of right at this moment in time. Let me know if and when I can help.Thanks,JSJS,Would you be at all willing to convert it to OnEvent for me? I'm not exactly sure what the best way to go about it is... If so, I'll shoot you the code. Current Projects:Remote Administration Suite Updated! 12-20-07Remote User State Migration Tool (Plugin) Updated! 12-20-07Batch Print Wizard Updated! 12-20-07Links:AutoIt Beta | AutoIt Wiki Link to comment Share on other sites More sharing options...
JSThePatriot Posted August 28, 2006 Share Posted August 28, 2006 JS,Would you be at all willing to convert it to OnEvent for me? I'm not exactly sure what the best way to go about it is... If so, I'll shoot you the code.Do you have the GUI completely done? I wouldnt want to hold you up. I could probably have it done by the end of the week.JS AutoIt Links File-String Hash Plugin Updated! 04-02-2008Â Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more) Link to comment Share on other sites More sharing options...
RagnaroktA Posted August 28, 2006 Author Share Posted August 28, 2006 Do you have the GUI completely done? I wouldnt want to hold you up. I could probably have it done by the end of the week.JSI got to thinking about it, it's pretty much finished, and what sense would it make to make even more controls work in GetMessage, when they're going to end up OnEvent. Why not convert it now, and if I add anything else, I'll do it with OnEvent. What do you think? Current Projects:Remote Administration Suite Updated! 12-20-07Remote User State Migration Tool (Plugin) Updated! 12-20-07Batch Print Wizard Updated! 12-20-07Links:AutoIt Beta | AutoIt Wiki Link to comment Share on other sites More sharing options...
JSThePatriot Posted August 28, 2006 Share Posted August 28, 2006 I got to thinking about it, it's pretty much finished, and what sense would it make to make even more controls work in GetMessage, when they're going to end up OnEvent. Why not convert it now, and if I add anything else, I'll do it with OnEvent. What do you think?Sounds good to me. Send it on over. I will get it done ASAP.JS AutoIt Links File-String Hash Plugin Updated! 04-02-2008Â Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more) Link to comment Share on other sites More sharing options...
RagnaroktA Posted August 28, 2006 Author Share Posted August 28, 2006 Sounds good to me. Send it on over. I will get it done ASAP.JSAlrighty JS, it's all yours. Sent you a PM. I can upload the supporting DLL if you want it, it's too big to attach.Development on this project is temporarily halted, JS is converting the script to use OnEvent for me, it will prove useful, and add possibilities. I'll post updates as they come. Thanks! Current Projects:Remote Administration Suite Updated! 12-20-07Remote User State Migration Tool (Plugin) Updated! 12-20-07Batch Print Wizard Updated! 12-20-07Links:AutoIt Beta | AutoIt Wiki Link to comment Share on other sites More sharing options...
arcker Posted August 29, 2006 Share Posted August 29, 2006 (edited) really amazing gui ! i've been working on similar project since one week, but now i'll stop because yours look promised i would just suggest to use another way of query machine (like an ldap request) i wait for the code to see if i can help you good job man mine was destined to have a full description of the remote machine, include networks i could be done by running a "net use >c:\temp\log.log" on the remote machine, using WMI,and read this after another way thing i've included is the credentials for wmi (connect to the remote machine using admin rights for example) tell me if you're interested Edited August 29, 2006 by arcker -- Arck System _ Soon -- Ideas make everything "La critique est facile, l'art est difficile" Projects :[list] [*]Au3Service : Run your exe as service V3 / Updated 29/07/2013Â Get it Here [/list] Link to comment Share on other sites More sharing options...
GaryFrost Posted August 29, 2006 Share Posted August 29, 2006 Do us all a favor on this one, keep the code tight, try to use as little as possible Global variables, make sure all variables are declared. Those are the reasons I didn't work on the other Admin Tool after it was taken over, the code was way too loose. Gary SciTE for AutoItDirections for Submitting Standard UDFs  Don't argue with an idiot; people watching may not be able to tell the difference.  Link to comment Share on other sites More sharing options...
RagnaroktA Posted August 29, 2006 Author Share Posted August 29, 2006 Do us all a favor on this one, keep the code tight, try to use as little as possible Global variables, make sure all variables are declared.Those are the reasons I didn't work on the other Admin Tool after it was taken over, the code was way too loose.GaryConsider it done Gary, I wont be declaring many Globals, just the Application Name and Version. I would love your input when I get a working version. I'm very open to suggestion. It's harder for me to modify someone elses code, than it is to code from the ground up. Current Projects:Remote Administration Suite Updated! 12-20-07Remote User State Migration Tool (Plugin) Updated! 12-20-07Batch Print Wizard Updated! 12-20-07Links:AutoIt Beta | AutoIt Wiki Link to comment Share on other sites More sharing options...
JSThePatriot Posted August 29, 2006 Share Posted August 29, 2006 Do us all a favor on this one, keep the code tight, try to use as little as possible Global variables, make sure all variables are declared.Those are the reasons I didn't work on the other Admin Tool after it was taken over, the code was way too loose.Gary@gafrostI am re-working the GUI into OnEventMode...I will make sure I keep it nice clean and smooth.Consider it done Gary, I wont be declaring many Globals, just the Application Name and Version. I would love your input when I get a working version. I'm very open to suggestion. It's harder for me to modify someone elses code, than it is to code from the ground up.Do you mind if I change some of your indentation habits? They are a little odd to me. I see why you did it, to denote when a tab and such, but I would just as soon use a comment on the start and end of it to denote it as it also already has #regions throughout.Thanks,JS AutoIt Links File-String Hash Plugin Updated! 04-02-2008Â Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more) Link to comment Share on other sites More sharing options...
RagnaroktA Posted August 30, 2006 Author Share Posted August 30, 2006 @gafrostI am re-working the GUI into OnEventMode...I will make sure I keep it nice clean and smooth.Do you mind if I change some of your indentation habits? They are a little odd to me. I see why you did it, to denote when a tab and such, but I would just as soon use a comment on the start and end of it to denote it as it also already has #regions throughout.Thanks,JSHave at it, the tab indentation thing is something I started doing with VBScript, and kinda stuck with me, it makes it easier for me to fly through code, but I'll definately try it with comments and see if I like that more. Current Projects:Remote Administration Suite Updated! 12-20-07Remote User State Migration Tool (Plugin) Updated! 12-20-07Batch Print Wizard Updated! 12-20-07Links:AutoIt Beta | AutoIt Wiki Link to comment Share on other sites More sharing options...
FeReNGi Posted September 1, 2006 Share Posted September 1, 2006 Looks nice (even the suggested toolbar) :-) Keep up the good work ! ServicesPE|LoadVMDK Link to comment Share on other sites More sharing options...
JSThePatriot Posted September 3, 2006 Share Posted September 3, 2006 I would like to test my progress. I have cleaned up all the code down to the functions, and have converted it completely to OnEvent (Other than the Functions), and I need the include files that are necissary to run it. I dont know where to retrieve all of those so please send them to me in a zip or attach them to this thread. Thanks, JS AutoIt Links File-String Hash Plugin Updated! 04-02-2008Â Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more) Link to comment Share on other sites More sharing options...
gspino Posted September 4, 2006 Share Posted September 4, 2006 I have a challange for you. Can you write a script where you enter a domain user name and it will return the machine name/s where that user is currently logged into? I've attempted this several times and gave up when I couldn't handle the frustration any longer. -Glen Link to comment Share on other sites More sharing options...
jvanegmond Posted September 4, 2006 Share Posted September 4, 2006 If you can make this work fast. I will use it, since it's AutoIt, it probably won't work very fast. Good luck trying anyway! I do sincerely hope you will succeed. github.com/jvanegmond Link to comment Share on other sites More sharing options...
RagnaroktA Posted September 5, 2006 Author Share Posted September 5, 2006 JS, You have a PM. Current Projects:Remote Administration Suite Updated! 12-20-07Remote User State Migration Tool (Plugin) Updated! 12-20-07Batch Print Wizard Updated! 12-20-07Links:AutoIt Beta | AutoIt Wiki Link to comment Share on other sites More sharing options...
RagnaroktA Posted September 6, 2006 Author Share Posted September 6, 2006 I have a challange for you. Can you write a script where you enter a domain user name and it will return the machine name/s where that user is currently logged into? I've attempted this several times and gave up when I couldn't handle the frustration any longer.-GlenIt's possible, but extremely complicated. Active Directory doesnt keep that information. You would need to poll the whole domain, put that information in a database, and go off of the database (and that will not keep the most current information). Current Projects:Remote Administration Suite Updated! 12-20-07Remote User State Migration Tool (Plugin) Updated! 12-20-07Batch Print Wizard Updated! 12-20-07Links:AutoIt Beta | AutoIt Wiki Link to comment Share on other sites More sharing options...
gspino Posted September 6, 2006 Share Posted September 6, 2006 It's possible, but extremely complicated. Active Directory doesnt keep that information. You would need to poll the whole domain, put that information in a database, and go off of the database (and that will not keep the most current information).Exactly why I put this one on the back shelf more than once. Too bad, it has great potential. If I remember correctly, Novell had a command line tool that did exactly this way back. If anyone can figure out a better, faster way, I'd love to collaborate on this one. I don't know one network manager who wouldn't plop down $$ for a tool this useful. 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