Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/02/2021 in all areas

  1. abberration

    Software Installer

    Software Installer Version: 2.0 It's been been a long year, but I finally got some time to rework this project. I re-wrote everything from scratch because the old version was getting too complicated with so many options and sub-menus. This new version is much easier to use and I have been testing for a few days and it seems very stable. For those who are new to this software, it helps you install software silently/unattended. This new version tries to determine the silent switch automatically. You can also re-organize the order in which the software installs by dragging & dropping them in the listview. It now supports creating profiles and checks for missing software (and automatically unchecks them, so it does not attempt to install non-existent software). One feature I included was because I have seen several people on Youtube talk about disliking bright screens at night. So, now you can choose from a few color theme (half of them are dark). I dabbled a bit more into GDI+ to draw a few things and show my logo with a transparent background (hint: I'm not good at GDI+). Under the Help menu, you will find a User Guide, which goes through most of it's features. I included a new icon if you want to use when you compile the script (in the Assets > Misc folder). If you have questions, comments or suggestions, all are welcome. Hope you enjoy! Here it is in action: Software_Installer_2.0.zip
    1 point
  2. Greetings everyone, I'd like to start my own cURL UDF, with a focus on a nice and simple syntax. There are many other cURL samples in the forum, though I found them too difficult to understand and use. This UDF uses the libcurl library, as opposed to the cURL command-line tool, to provide better integration with AutoIT and better performance. REQUIREMENTS: Windows 32-bit (not tested under Windows 64-bit but may work if a 64-bit version of libcurl below is used) AutoIt3 3.2 or higher libcurl v7.21.7 or higher (libcurl.dll, libeay32.dll & libssl32.dll) - see http://curl.haxx.se or download link below LIST OF FUNCTIONS: EXAMPLES: Note - To make these examples work, you must make sure the three libcurl DLLs (libcurl.dll, libeay32.dll & libssl32.dll) are present in the same folder as the examples. Example #1 - Reading HTML from a webpage. #include <cURL.au3> ; Initialise cURL cURL_initialise() ; Return the HTML from "http://www.autoitscript.com/site" $response = cURL_easy("http://www.autoitscript.com/site/") ; Output the response to the console ConsoleWrite("HTTP Response Code = " & $response[0] & @CRLF) ConsoleWrite("HTTP Response Headers = " & $response[1] & @CRLF) ConsoleWrite("HTTP Response Data = " & $response[2] & @CRLF) ; Clean up cURL cURL_cleanup() Example #2 - Reading a binary file from a website. #include <cURL.au3> ; Initialise cURL cURL_initialise() ; Output the file from "http://web.aanet.com.au/seangriffin/content/computing/development/eBay%20Bargain%20Hunter%20setup.exe" to "tmp.exe" cURL_easy("http://web.aanet.com.au/seangriffin/content/computing/development/eBay%20Bargain%20Hunter%20setup.exe", "", 0, 1, "tmp.exe") ; Clean up cURL cURL_cleanup() Example #3 - Reading HTML from a webpage, and writing the cookie to a file. #include <cURL.au3> ; Initialise cURL cURL_initialise() ; Return the response from "http://www.about.com", and the cookie to the file "cookie.txt" $response = cURL_easy("http://www.about.com", "cookie.txt", 2) ; Output the response to the console ConsoleWrite("HTTP Response Code = " & $response[0] & @CRLF) ConsoleWrite("HTTP Response Headers = " & $response[1] & @CRLF) ConsoleWrite("HTTP Response Data = " & $response[2] & @CRLF) ; Clean up cURL cURL_cleanup() DOWNLOAD: Recent Version of libcurl.dll, libeay32.dll & libssl32.dll (required) http://fossies.org/windows/www/curl-7.24.0-ssl-sspi-zlib-static-bin-w32.zip Latest Version - v0.3 (03/04/16) cURL.au3
    1 point
  3. Nine

    minimize disabled GUI ?

    It is easier to make that loop than trying to simulate a border click to minimize the GUI. Just create a Func and pass the state (@SW_ENABLE/@SW_DISABLE) as a parameter.
    1 point
  4. Nine

    GUI Error

    Not quite. By putting the int() in front of the InputBox, you are loosing the possibility to test @error. And then not able to check if user has cancelled... Use instead StringIsInt().
    1 point
  5. Oh, ya forgot about Win10 hidden tooltips. #include <Constants.au3> #include <WinAPISysWin.au3> #include <Misc.au3> #include <Array.au3> $sURL = "www.google.com" ToolTip($sURL, Default, Default, "Click on me") Local $bClick = _ClickToolTip($sURL, 5) MsgBox ($MB_SYSTEMMODAL,"Is tool tip clicked ?", $bClick) Func _ClickToolTip($sText, $iTimeOut) Local $hWnd = WinGetHandle("[TITLE:" & $sText & ";CLASS:tooltips_class32]") If Not $hWnd Then Return False Local $hTimer = TimerInit() While TimerDiff($hTimer) < $iTimeOut*1000 Local $tRect = _WinAPI_GetWindowRect($hWnd) If _IsPressed("01") Then Local $aPos = MouseGetPos() If $aPos[0] >= $tRect.left And $aPos[0] <= $tRect.right And $aPos[1] >= $tRect.top And $aPos[1] <= $tRect.bottom Then ToolTip("") Return True EndIf EndIf WEnd ToolTip("") Return False EndFunc
    1 point
  6. At some point we've all seen the example for WM_GETMINMAXINFO floating around the forum, in regards to restricting the size of the GUI. I therefore decided to have a look at this and see if it could be rearranged to use structures and code already predefined in AutoIt and the UDFs. Sometimes users like to duplicate variables that may already exist in WindowsConstants.au3 or StructureConstants.au3 and it can cause problems down the line if the variable values change. You never know $GUI_EVENT_CLOSE (-3) might change to -99 one day, so this is why 'magic numbers' are bad to use in examples. So having read about WM_GETMINMAXINFO on MSDN, the structure that was required turned out to be tagMINMAXINFO, which was made up of 5 tagPOINT structures (long X;long Y;) strung together. So I created the following code below and will probably propose that the tagMINMAXINFO structure be added to the AutoIt UDFs. So my questions is: Does the structure look correct? Or should I use a different approach? Any feed back is much appreciated. #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w- 4 -w 5 -w 6 -w 7 #include <GUIConstantsEx.au3> #include <Windowsconstants.au3> ; MINMAXINFO Struct >> http://msdn.microsoft.com/en-us/library/windows/desktop/ms632605(v=vs.85).aspx ; It uses a $tagPOINT structure which is long X; long Y; Global Const $tagMINMAXINFO = "struct; long ReservedX;long ReservedY;long MaxSizeX;long MaxSizeY;long MaxPositionX;long MaxPositionY;" & _ "long MinTrackSizeX;long MinTrackSizeY;long MaxTrackSizeX;long MaxTrackSizeY; endstruct" ; GUI API for setting the minimum an maximum sizes of the GUI. These don't need to be called by the end user, but rather use _GUISetSize(). Global Enum $__iMinSizeX, $__iMinSizeY, $__iMaxSizeX, $__iMaxSizeY, $__iGUISizeMax Global $__vGUISize[$__iGUISizeMax] Example() Func Example() ; Create a resizable GUI. Local $hGUI = GUICreate('', Default, Default, Default, Default, BitOR($GUI_SS_DEFAULT_GUI, $WS_SIZEBOX)) GUISetState(@SW_SHOW, $hGUI) ; Set the minimum and maximum sizes of the GUI. _GUISetSize(150, 150, 500, 500) ; Register the WM_GETMINMAXINFO message. GUIRegisterMsg($WM_GETMINMAXINFO, 'WM_GETMINMAXINFO') While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd GUIDelete($hGUI) EndFunc ;==>Example Func _GUISetSize($iMinWidth, $iMinHeight, $iMaxWidth, $iMaxHeight) $__vGUISize[$__iMinSizeX] = $iMinWidth $__vGUISize[$__iMinSizeY] = $iMinHeight $__vGUISize[$__iMaxSizeX] = $iMaxWidth $__vGUISize[$__iMaxSizeY] = $iMaxHeight EndFunc ;==>_GUISetSize Func WM_GETMINMAXINFO($hWnd, $iMsg, $wParam, $lParam) ; Original idea by Zedna & updated by guinness 21/09/12. #forceref $hWnd, $iMsg, $wParam Local $tMINMAXINFO = DllStructCreate($tagMINMAXINFO, $lParam) DllStructSetData($tMINMAXINFO, 'MinTrackSizeX', $__vGUISize[$__iMinSizeX]) DllStructSetData($tMINMAXINFO, 'MinTrackSizeY', $__vGUISize[$__iMinSizeY]) DllStructSetData($tMINMAXINFO, 'MaxTrackSizeX', $__vGUISize[$__iMaxSizeX]) DllStructSetData($tMINMAXINFO, 'MaxTrackSizeY', $__vGUISize[$__iMaxSizeY]) EndFunc ;==>WM_GETMINMAXINFO
    1 point
×
×
  • Create New...