jaberwacky Posted April 27, 2011 Share Posted April 27, 2011 (edited) This is the first useful application of my GUIObjects project. A little background on GUIObjects. GUIObjects wraps all (soon will be all) GUI controls and forms into self contained objects. The use of handles and IDs are managed behind the scenes. This won't make your programs any faster however it will make them easier to manage and to create. I don't honestly expect anyone to use this, however, I will be using it in my future projects. I will attempt to answer any questions you may have -- other than "Will this make my script run faster?". I will also not entertain any queries as to the utility of this project. With that said I present the first useful application. On my machine, for future reference, whenever I download an installer EXE I then store that EXE in a separate folder after installation. The same goes for when I uninstall programs. I remove the EXE from the 'installed EXEs' folder to the 'uninstalled EXEs' folder. The purpose of which has served me well from time to time. These folders are located on another partition. Whenever I reinstall Windows then I already have my EXEs within easy reach. Oh sure, I could just slipstream them into Windows and whenever I reinstall they are installed automatically. But won't I have to do that every time I reinstall? And also, I keep track of uninstalled programs in case I ever need to revert to an earlier version. I now have this process automated. Whenever I uninstall a program I just open this script up, select the uninstalled EXE, and then click move. The point is not what the demo does but how it does it.previous: 13 Run "Installer Manager.au3" (BUT DON"T ACTUALLY TRY TO USE IT) Just look at the code really. Tested in Windows 7 Pro x64 and Windows XP Pro x86 on an ancient Dell Inspiron 8100 (FTW!) without obvious problems. Edited November 3, 2013 by jaberwocky6669 Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum? Link to comment Share on other sites More sharing options...
JScript Posted April 27, 2011 Share Posted April 27, 2011 (edited) What are the advantages? My script will run faster? You use functions that call native functions... I do not see benefits Edited April 27, 2011 by jscript http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!) Somewhere Out ThereJames Ingram Download Dropbox - Simplify your life!Your virtual HD wherever you go, anywhere! Link to comment Share on other sites More sharing options...
JScript Posted April 27, 2011 Share Posted April 27, 2011 Why use this: Func Ctrl_SetData( $this , Const $data ) #forceref $this $this.Data = $data GUICtrlSetData( $this.ID , $this.Data ) Return $this EndFunc And not this:GUICtrlSetData( $this.ID , $this.Data ) http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!) Somewhere Out ThereJames Ingram Download Dropbox - Simplify your life!Your virtual HD wherever you go, anywhere! Link to comment Share on other sites More sharing options...
jaberwacky Posted April 27, 2011 Author Share Posted April 27, 2011 I have a possible use for this at the bottom of the OP. Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum? Link to comment Share on other sites More sharing options...
jaberwacky Posted April 27, 2011 Author Share Posted April 27, 2011 Why does everyone worry about speed speed speed! If you want speed then code in assembly!!!!!!!!!!!!!!!!! Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum? Link to comment Share on other sites More sharing options...
trancexx Posted April 27, 2011 Share Posted April 27, 2011 You said ass ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
jaberwacky Posted April 27, 2011 Author Share Posted April 27, 2011 You did too. Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum? Link to comment Share on other sites More sharing options...
JScript Posted April 27, 2011 Share Posted April 27, 2011 kkkkk, From time to time it's good laughs... http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!) Somewhere Out ThereJames Ingram Download Dropbox - Simplify your life!Your virtual HD wherever you go, anywhere! Link to comment Share on other sites More sharing options...
trancexx Posted April 27, 2011 Share Posted April 27, 2011 You did too. So, if I would take your script, change it a bit, compile it to this (follow the link) and wrote another: expandcollapse popup#include <GUIConstantsEx.au3> #include <AutoItObject.au3> Global $oError = ObjEvent("AutoIt.Error", "_ErrFunc") Func _ErrFunc() ConsoleWrite("COM Error, ScriptLine(" & $oError.scriptline & ") : Number 0x" & Hex($oError.number, 8) & " - " & $oError.windescription & @CRLF) EndFunc ;==>_ErrFunc Global Const $gui_width = 800 Global Const $gui_height = 600 _AutoItObject_Startup() Global $hGUI = _AutoItObject_ObjCreateEx(@ScriptDir & "\GUIObj.server", "cbi:GUIObjectsDemo.Application") $hGUI.Create("Button Demon -- Hours of Fun!", $gui_width, $gui_height) $hGUI.SetBkColor(0x1F0000) $hGUI.OnEvent($GUI_EVENT_CLOSE, "_exit") Global $hButton1 = $hGUI.Button $hButton1.Create("Click Me! }:>", $gui_width, $gui_height) Global $hButton2 = $hGUI.Button $hButton2.Create("Click Me! Too }:>", $gui_width, $gui_height) Global $MouseNFO While 1 $MouseNFO = $hGUI.GUIGetCursorInfo() If $oError.number Or Not IsArray($MouseNFO) Then ExitLoop Switch $MouseNFO[4] Case $hButton1.ID $hButton1.SetRandPos() Case $hButton2.ID $hButton2.SetRandPos() EndSwitch Sleep(10) WEnd ...Then place both in the same directory and run latter. Several instances at once maybe even. That would be cool I say. ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
JScript Posted April 27, 2011 Share Posted April 27, 2011 @trancexx: Enough interesting... http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!) Somewhere Out ThereJames Ingram Download Dropbox - Simplify your life!Your virtual HD wherever you go, anywhere! Link to comment Share on other sites More sharing options...
jaberwacky Posted April 28, 2011 Author Share Posted April 28, 2011 I couldn't get it to run. I put GUIObjects.server in a folder. Then I put two copies of your posted script into that same folder. I run the two scripts but here are the error messages: COM Error, ScriptLine(16) : Number 0x000000A9 - Variable must be of type 'Object'. COM Error, ScriptLine(17) : Number 0x000000A9 - Variable must be of type 'Object'. COM Error, ScriptLine(18) : Number 0x000000A9 - Variable must be of type 'Object'. COM Error, ScriptLine(20) : Number 0x000000A9 - Variable must be of type 'Object'. COM Error, ScriptLine(21) : Number 0x000000A9 - Variable must be of type 'Object'. COM Error, ScriptLine(23) : Number 0x000000A9 - Variable must be of type 'Object'. COM Error, ScriptLine(24) : Number 0x000000A9 - Variable must be of type 'Object'. COM Error, ScriptLine(29) : Number 0x000000A9 - Variable must be of type 'Object'. Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum? Link to comment Share on other sites More sharing options...
trancexx Posted April 28, 2011 Share Posted April 28, 2011 I have used #include <AutoItObject.au3> (as you can see). Probably the version of AutoItObject that gets run with you is some older one. ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
jaberwacky Posted April 28, 2011 Author Share Posted April 28, 2011 (edited) 1.2.3.0DOH! Now I have the latest version: 1.2.4!!!!!WELL actually, origo or whatever it's called isn't acting right.Ok, I can only get one window to run at a time. And yes I compiled the two scripts. Whenever I run the first script everything is as expected. However, when I run the second script only one window remains but then I get four buttons on the one window. Edited April 28, 2011 by LaCastiglione Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum? Link to comment Share on other sites More sharing options...
trancexx Posted April 28, 2011 Share Posted April 28, 2011 (edited) 1.2.3.0DOH! Now I have the latest version: 1.2.4!!!!!WELL actually, origo or whatever it's called isn't acting right.Ok, I can only get one window to run at a time. And yes I compiled the two scripts. Whenever I run the first script everything is as expected. However, when I run the second script only one window remains but then I get four buttons on the one window.You don't need to compile anything.Every new instance adds two more buttons to the main GUI, that is the idea and that's what makes it interesting. Edited April 28, 2011 by trancexx ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
jaberwacky Posted April 28, 2011 Author Share Posted April 28, 2011 (edited) You don't need to compile anything.Well, if I don't compile them then I can only run one at a time from SciTE.Every new instance adds two more buttons to the main GUI, that is the idea and that's what makes it interesting.That is quite an interesting twist. I had in mind using two different GUIs running from the same GUIObjects.server. The two GUIs interpret the data in their own unique ways. Edited April 28, 2011 by LaCastiglione Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum? Link to comment Share on other sites More sharing options...
wraithdu Posted April 28, 2011 Share Posted April 28, 2011 right-click the script -> Run No need to do it from Scite every time. Link to comment Share on other sites More sharing options...
jaberwacky Posted April 29, 2011 Author Share Posted April 29, 2011 DOH! Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum? Link to comment Share on other sites More sharing options...
jaberwacky Posted June 8, 2011 Author Share Posted June 8, 2011 Ok, uploaded a fixed version. I forgot to change the #include locations to reflect new folders. Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum? 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