Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/22/2021 in all areas

  1. It has been over a year since the last update of the full SciTE4AutoIt3 installer which mainly had to do with the fact that Neil was moving toward v5 of SciTE and there weren't many functional changes in SciTE v4 other than to support the different setup of the Lexers to be used in V5. This is likely the final version with support for WinXP as the upcoming V5 version of SciTE will likely drop WinXP altogether. 22-3-2021: Updated Tidy.exe, which caused a hardcrash reading the new au3.api definition, in the installed/portable zip and direct download. 23-3-2021: Updated AutoIt3Wrapper.au3, which was running the "#autoIt3Wrapper_run_after" defined programs twice in some occasions. ==> SciTE4AutoIt3 v21.316.1639.2 Change log: -------------------------------------------------------------------------------------------------- 16-03-2021 *** Merged the SciTE v 4.4.6 by Neil Hodgson with our own version of SciTE. (Jos) - Change the workdir to the programdir to avoid locking up the last opened scriptfile directory. - Fixed Bom checking bug resulting to garbage characters in the editor for UTF encoded file other than UTF8 - Dropped support for WinXP (Compiled with vc15, Win sdk 8.1, Toolset v141) - Compiled with vc15 and changed SSE instruction set to ia86 compatible. *** Updated AutoIt3Wrapper v21.316.1639.0 (Jos) - 19.1127.1402.1 added clear errors when Tidy is ran with Ctrl+T. - 19.1127.1402.2 Avoid running Tidy for a second time when script needs to be run with #RequireAdmin in elevated mode. - 19.1127.1402.5 Added work-around to support Unicode characters in filenames for: - au3check - Tidy - au3stripper - 19.1127.1402.6 Added Win10 build to info lines. (tnx argumentum) - 19.1127.1402.7 Fix for support of filenames containing special ascii characters too. - 19.1127.1402.8 Restored some DIrectives still used for versioning and fileversion. - 19.1127.1402.8 Fix for support of filenames containing special ascii characters too. - 19.1127.1402.9 Fix checking for "#AutoIt3Wrapper_Version"check till after the GUI is done. - 19.1127.1402.10 Fixed Versionupdate with /RunAfter option I use for AutoIt3Wrapper updates. - 19.1127.1402.11 Fixed issue with #include statements where the filename is enclosed in single quotes. - 19.1127.1402.13 Updated File prompt. - 19.1127.1402.18 added include filelist and their encoding when /debug is supplied - 19.1127.1402.19 Cosmetic update showing the ">Setting Program ExecutionLevel Manifest information to...." only when the directive is provided - 19.1127.1402.20 Fix for elevated scripts running from mapped drive - 19.1127.1402.21 again Fix for support of filenames containing special ascii characters. - 19.1127.1402.22 Fix invalid FileExist statement on line 550. - 19.1127.1402.26 Added #AutoIt3Wrapper_Res_Fileversion_Use_Template - 19.1127.1402.27 Changed Func ShowStdOutErr to only capture total STDOUT/ERR when required, Avoiding unnecessary memory consumption - 19.1127.1402.28 Fixed regression creating duplicate resource entries. *** Updated Au3Stripper v21.316.1639.0 (Jos) - 19.1127.1402.1 Option /rsln: Added replace for @ScriptLinenumber for #includes to contain source files and original linenumber. - Changed replace for @ScriptLinenumber to only replace none literal string occurrences. - 19.1127.1402.3 Changed replace for @ScriptLinenumber to only replace when not on FUNC line. - 19.1127.1402.5 Added directive "#Au3Stripper_Ignore_Errors_in_Func=", which will suppress any errors triggered within the defined Functions. - 19.1127.1402.7 Fix for Func names in FUNC parameters to avoid stripping the target function. *** Updated SciTEConfig v21.316.1639.0 (Jos) - 19.1127.1402.1 - Fix bug in AbbrevMan.au3 when pipe symbol is used to set cursor position. (Melba23 *** Updated Tidy v21.316.1639.0 (Jos) - v19.1127.1402.2 fixed some issues in the /gendoc option: - func reference lines weren't listed - only show variables starting with $ or @ - v19.1127.1402.5 Default Tabsize to SciTE-TabSize when not provided. - v19.1127.1402.6 Made the backp sequencenumber 2 digits. old filenames will be converted. - v19.1127.1402.10 Reversed the 2 digit sequencenumber as this will fail when there are more than 99 backup versions. *** Updated Abbreviations (mLipok) - Updated au3abbrev.properties and helpfile page. Enjoy, Jos
    5 points
  2. Serious ???? Idiot!
    2 points
  3. Alternative way using Scripting.Dictionary #include <Array.au3> $aDataArr = FileReadToArray(@ScriptDir & "\1.txt") $aDeleteArr = FileReadToArray(@ScriptDir & "\2.txt") $sd1 = ObjCreate("Scripting.Dictionary") $sd2 = ObjCreate("Scripting.Dictionary") For $i In $aDataArr $sd1.Item($i) Next For $i In $aDeleteArr If $sd1.Exists($i) Then $sd1.Remove($i) Next $aDataArrCleared = $sd1.Keys() _ArrayDisplay($aDataArrCleared, "Cleared File :")
    2 points
  4. I 'm sorry that i created this Thread. My Problem was that i didn't realized that AutoIt has seperate German and English Forum. My mistake was i searched in the English Forum but didn'd find anythig about systeminfo.hta! So i made this Thread. Yes i should realize that there a 2 separte Forums but i didn't So for now i will write my code in the German Forum. Maybe anycone can close this Thread!
    2 points
  5. Here's what I used: #include <Constants.au3> http_get_example() Func http_get_example() Local $oHttp = Null, $oComErr = Null ;Register COM Error Handler $oComErr = ObjEvent("AutoIt.Error", com_error_handler) If @error Then Exit MsgBox($MB_ICONERROR + $MB_TOPMOST, "ERROR", "Unable to register COM error handler - @error = " & @error) ;Create HTTP COM object $oHttp = ObjCreate("winhttp.winhttprequest.5.1") If @error Then Exit MsgBox($MB_ICONERROR + $MB_TOPMOST, "ERROR", "Unable to create HTTP COM object - @error = " & @error) With $oHttp ;Open GET request .Open("GET", "https://allegro.pl/kategoria/nasiona-warzywa-99776?bmatch=e2101-d3681-c3682-hou-1-4-0319") If @error Then Exit MsgBox($MB_ICONERROR + $MB_TOPMOST, "ERROR", StringFormat("(0x%X) %s", $oComErr.RetCode, $oComErr.WinDescription)) ;Set request header(s) .SetRequestHeader("User-Agent", "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:86.0) Gecko/20100101 Firefox/86.0") ;Send request .Send() If @error Then Exit MsgBox($MB_ICONERROR + $MB_TOPMOST, "ERROR", StringFormat("(0x%X) %s", $oComErr.RetCode, $oComErr.Description)) ConsoleWrite(StringFormat("HTTP Status: %s %s", .Status, .StatusText) & @CRLF) ;If http status code not 200 If .Status <> 200 Then Exit MsgBox($MB_ICONERROR + $MB_TOPMOST, "ERROR", StringFormat("HTTP Status Code = %s %s", .Status, .StatusText)) ;Display response ConsoleWrite(@CRLF & "HTTP Response:" & @CRLF) ConsoleWrite(.ResponseText & @CRLF) EndWith EndFunc Func com_error_handler($oError) With $oError ConsoleWrite(@CRLF & "COM ERROR DETECTED!" & @CRLF) ConsoleWrite(" Error ScriptLine....... " & .scriptline & @CRLF) ConsoleWrite(" Error Number........... " & "0x" & Hex(.number) & " (" & .number & ")" & @CRLF) ConsoleWrite(" Error WinDescription... " & StringStripWS(.windescription, $STR_STRIPTRAILING) & @CRLF) ConsoleWrite(" Error Description...... " & StringStripWS(.description , $STR_STRIPTRAILING) & @CRLF) ConsoleWrite(" Error RetCode.......... " & "0x" & Hex(Number(.retcode)) & " (" & Number(.retcode) & ")" & @CRLF) EndWith Return ; Return so @error can be trapped by the calling function EndFunc
    1 point
  6. GDI+ can do it faster and with more robustness : #include <GDIPlus.au3> #include <GUIConstants.au3> #include <ScreenCapture.au3> Example() Func Example() _GDIPlus_Startup() Local Const $iW = 300, $iH = 200 ; 3:2 Local Const $iNW = 300, $iNH = 300 ; make it 1:1 Local $hHBmp = _ScreenCapture_Capture("", 0, 0, $iW, $iH) ;create a GDI bitmap by capturing part of the screen (3:2) Local $hBitmap = _GDIPlus_BitmapCreateFromHBITMAP($hHBmp) ;convert GDI bitmap to GDI+ bitmap _WinAPI_DeleteObject($hHBmp) ;release GDI bitmap resource because not needed anymore Local $hBitmap_Scaled = _GDIPlus_ImageResizeEX($hBitmap, $iNW, $iNH, $iW, $iH) ;resize image with white space below and above Local $hGUI = GUICreate("GDI+ test", $iNW, $iNH) ;create a test gui to display the resized image GUISetState(@SW_SHOW) Local $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hGUI) ;create a graphics object from a window handle _GDIPlus_GraphicsDrawImage($hGraphics, $hBitmap_Scaled, 0, 0) ;display scaled image _GDIPlus_ImageSaveToFile($hBitmap_Scaled, "Test.jpg") ; save it While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd ;cleanup resources _GDIPlus_GraphicsDispose($hGraphics) _GDIPlus_BitmapDispose($hBitmap) _GDIPlus_BitmapDispose($hBitmap_Scaled) _GDIPlus_Shutdown() EndFunc ;==>Example Func _GDIPlus_ImageResizeEX($hImage, $iNewWidth, $iNewHeight, $iOldWidth, $iOldHeight) Local $hBitmap = _GDIPlus_BitmapCreateFromScan0($iNewWidth, $iNewHeight) Local $hBmpCtxt = _GDIPlus_ImageGetGraphicsContext($hBitmap) Local $hBrush = _GDIPlus_BrushCreateSolid(0xFFFFFFFF) ; fill image with white _GDIPlus_GraphicsFillRect($hBmpCtxt, 0, 0, $iNewWidth, $iNewHeight, $hBrush) _GDIPlus_GraphicsDrawImageRect($hBmpCtxt, $hImage, 0, Int($iNewHeight - $iOldHeight) / 2, $iOldWidth, $iOldHeight) _GDIPlus_GraphicsDispose($hBmpCtxt) _GDIPlus_BrushDispose($hBrush) Return $hBitmap EndFunc ;==>_GDIPlus_ImageResizeEX
    1 point
  7. @seadoggie01 Thanks! Now I know who to call when we need to chase flavoured cats
    1 point
  8. Meanwhile you can use this : #include <InetConstants.au3> Local $dData = InetRead("https://www.whatismybrowser.com/guides/the-latest-version/chrome", $INET_FORCERELOAD) Local $sText = BinaryToString($dData) Local $sPattern = '(?s)<table class="table table-striped table-hover">.*?Windows[^\d]*([^<]*)' Local $sLatestVersion = StringRegExp($sText, $sPattern, 1)[0] ConsoleWrite ("Latest = " & $sLatestVersion & @CRLF) Local $sCurrentVersion = RegRead("HKEY_CURRENT_USER\Software\Google\Chrome\BLBeacon", "version") ConsoleWrite ("Current = " & $sCurrentVersion & @CRLF)
    1 point
  9. @nooneclose There are a couple of options that may address your need -- _WD_UpdateDriver can be used to download the correct version of the webdriver for the desired browser The next release will contain _WD_GetSession, which for now will return the contents of $_WD_SESSION_DETAILS (captured in _WD_CreateSession). This function will eventually be modified to retrieve live session details once the W3C specs support this feature.
    1 point
  10. Done! Set $iFlags to 8 to ignore such errors: ; #FUNCTION# ==================================================================================================================== ; Name ..........: _OL_ItemFind ; Description ...: Finds items (contacts, appointments ...) returning an array of all specified properties. ; Syntax.........: _OL_ItemFind($oOL, $vFolder[, $iObjectClass = Default[, $sRestrict = ""[, $sSearchName = ""[, $sSearchValue = ""[, $sReturnProperties = ""[, $sSort = ""[, $iFlags = 0[, $sWarningClick = ""]]]]]]]]) ; Parameters ....: $oOL - Outlook object returned by a preceding call to _OL_Open() ; $vFolder - Folder object as returned by _OL_FolderAccess or full name of folder where the search will be started. ; +If you want to search a default folder you have to specify the folder object. ; $iObjectClass - [optional] Class of items to search for. Defined by the Outlook OlObjectClass enumeration (default = Default = $olContact) ; $sRestrict - [optional] Filter text to restrict number of items returned (exact match). For details please see Remarks ; $sSearchName - [optional] Name of the property to search for (without brackets) ; $sSearchValue - [optional] String value of the property to search for (partial match) ; $sReturnProperties - [optional] Comma separated list of properties to return (default = depending on $iObjectClass. Please see Remarks) ; $sSort - [optional] Property to sort the result on plus optional flag to sort descending (default = None). E.g. "[Subject], True" sorts the result descending on the subject ; $iFlags - [optional] Flags to set different processing options. Can be a combination of the following: ; | 1: Subfolders will be included ; | 2: Row 1 contains column headings. Therefore the number of rows/columns in the table has to be calculated using UBound ; | 4: Just return the number of records. You don't get an array, just a single integer denoting the total number of records found ; | 8: Ignore errors when accessing non-existing properties. Return "N/A" (not available) instead. This avoids @error = 4 - Error accessing specified property. ; $sWarningClick - [optional] The entire path (drive, directory, file name and extension) to 'OutlookWarning2.exe' or another exe with the same function (default = None) ; Return values .: Success - One based two-dimensional array with the properties specified by $sReturnProperties ; Failure - Returns "" and sets @error: ; |1 - You have to specifiy $sSearchName AND $sSearchValue or none of them ; |2 - $sWarningClick not found ; |3 - Error accessing the specified folder. See @extended for errorcode returned by _OL_FolderAccess ; |4 - Error accessing specified property. @extended is set to the COM error ; |5 - Error filtering items. @extended is set to the COM error ; |6 - You didn't provide properties to be returned and _OL_ItemFind doesn't provide any default properties for this item type ; |1nmm - Error checking the $sReturnProperties as returned by __OL_CheckProperties. ; + n is either 0 (property does not exist) or 1 (Property has invalid case) ; + mm is the index of the property in error (one based) ; Author ........: water ; Modified ......: ; Remarks .......: Be sure to specify the values in $sReturnProperties and $sSearchName in correct case e.g. "FirstName" is valid, "Firstname" is invalid ;+ ; If you do not specify any properties then the following properties will be returned depending on the objectclass: ; Contact: FirstName, LastName, Email1Address, Email2Address, MobileTelephoneNumber ; DistributionList: Subject, Body, MemberCount ; Note, Mail: Subject, Body, CreationTime, LastModificationTime, Size ; Appointment: EntryID, Start, End, Subject, IsRecurring ;+ ; Pseudo properties: ; You can specify the following pseudo properties which can't be derived directly from the item. ; @ItemObject - Object of the item that matches the search criteria ; @FolderObject - Object of the folder where the item resides. Helpful when you search subfolders. ;+ ; $sRestrict: Filter can be a Jet query or a DASL query with the @SQL= prefix. Jet query language syntax: ; Restrict filter: Filter LogicalOperator Filter ... ; LogicalOperator: And, Or, Not. Use ( and ) to change the processing order ; Filter: "[property] operator 'value'" or '[property] operator "value"' ; Operator: <, >, <=, >=, <>, = ; Example: "[Start]='2011-02-21 08:00' And [End]='2011-02-21 10:00' And [Subject]='Test'" ; See: http://msdn.microsoft.com/en-us/library/cc513841.aspx - "Searching Outlook Data" ; http://msdn.microsoft.com/en-us/library/bb220369(v=office.12).aspx - "Items.Restrict Method" ;+ ; N.B.: Pass time as HH:MM, HH:MM:SS is invalid and returns no result ; Related .......: ; Link ..........: ; Example .......: Yes ; =============================================================================================================================== Func _OL_ItemFind($oOL, $vFolder, $iObjectClass = Default, $sRestrict = "", $sSearchName = "", $sSearchValue = "", $sReturnProperties = "", $sSort = "", $iFlags = 0, $sWarningClick = "") If $sRestrict = Default Then $sRestrict = "" If $sSearchName = Default Then $sSearchName = "" If $sSearchValue = Default Then $sSearchValue = "" If $sReturnProperties = Default Then $sReturnProperties = "" If $sSort = Default Then $sSort = "" If $iFlags = Default Then $iFlags = 0 If $sWarningClick = Default Then $sWarningClick = "" Local $bChecked = False, $oItems, $aTemp, $iCounter = 0, $oItem If $sWarningClick <> "" Then If FileExists($sWarningClick) = 0 Then Return SetError(2, 0, "") Run($sWarningClick) EndIf If $iObjectClass = Default Then $iObjectClass = $olContact ; Set Default ObjectClass ; Set default return properties depending on the class of items If StringStripWS($sReturnProperties, BitOR($STR_STRIPLEADING, $STR_STRIPTRAILING)) = "" Then Switch $iObjectClass Case $olContact $sReturnProperties = "FirstName,LastName,Email1Address,Email2Address,MobileTelephoneNumber" Case $olDistributionList $sReturnProperties = "Subject,Body,MemberCount" Case $olNote, $olMail $sReturnProperties = "Subject,Body,CreationTime,LastModificationTime,Size" Case $olAppointment $sReturnProperties = "EntryID,Start,End,Subject,IsRecurring" ; Same as returned by _OL_AppointmentGet Case Else Return SetError(6, 0, "") EndSwitch EndIf If Not IsObj($vFolder) Then $aTemp = _OL_FolderAccess($oOL, $vFolder) If @error Then Return SetError(3, @error, "") $vFolder = $aTemp[1] EndIf If ($sSearchName <> "" And $sSearchValue = "") Or ($sSearchName = "" And $sSearchValue <> "") Then Return SetError(1, 0, "") Local $aReturnProperties = StringSplit(StringStripWS($sReturnProperties, $STR_STRIPALL), ",") Local $iIndex = $aReturnProperties[0] If $aReturnProperties[0] < 2 Then $iIndex = 2 If StringStripWS($sRestrict, BitOR($STR_STRIPLEADING, $STR_STRIPTRAILING)) = "" Then $oItems = $vFolder.Items If @error Then Return SetError(5, @error, "") Else $oItems = $vFolder.Items.Restrict($sRestrict) If @error Then Return SetError(5, @error, "") EndIf Local $iItems = $oItems.Count Local $aItems[$iItems + 1][$iIndex] = [[0, $aReturnProperties[0]]] If BitAND($iFlags, 4) <> 4 And $sSort <> "" Then $aTemp = StringSplit($sSort, ",") If $aTemp[0] = 1 Then $oItems.Sort($sSort) Else $oItems.Sort($aTemp[1], True) EndIf EndIf For $i = 1 To $iItems $oItem = $oItems.Item($i) If $oItem.Class <> $iObjectClass Then ContinueLoop ; Get all properties of first item and check for existance and correct case If BitAND($iFlags, 4) <> 4 And Not $bChecked Then If Not __OL_CheckProperties($oItem, $aReturnProperties, 1) Then Return SetError(@error, @extended, "") $bChecked = True EndIf If $sSearchName <> "" And StringInStr($oItem.ItemProperties.Item($sSearchName).value, $sSearchValue) = 0 Then ContinueLoop ; Fill array with the specified properties $iCounter += 1 If BitAND($iFlags, 4) <> 4 Then For $iIndex = 1 To $aReturnProperties[0] If StringLeft($aReturnProperties[$iIndex], 1) <> "@" Then $aItems[$iCounter][$iIndex - 1] = $oItem.ItemProperties.Item($aReturnProperties[$iIndex]).value If @error Then If BitAND($iFlags, 8) = 8 Then $aItems[$iCounter][$iIndex - 1] = "N/A" Else Return SetError(4, @error, "") EndIf EndIf Else If $aReturnProperties[$iIndex] = "@ItemObject" Then $aItems[$iCounter][$iIndex - 1] = $oItem If $aReturnProperties[$iIndex] = "@FolderObject" Then $aItems[$iCounter][$iIndex - 1] = $vFolder EndIf If BitAND($iFlags, 2) = 2 And $iCounter = 1 Then If StringLeft($aReturnProperties[$iIndex], 1) <> "@" Then $aItems[0][$iIndex - 1] = $oItem.ItemProperties.Item($aReturnProperties[$iIndex]).Name Else $aItems[0][$iIndex - 1] = $aReturnProperties[$iIndex] EndIf EndIf Next EndIf If BitAND($iFlags, 4) <> 4 And BitAND($iFlags, 2) <> 2 Then $aItems[0][0] = $iCounter Next If BitAND($iFlags, 4) = 4 Then ; Process subfolders If BitAND($iFlags, 1) = 1 Then For $vFolder In $vFolder.Folders $iCounter += _OL_ItemFind($oOL, $vFolder, $iObjectClass, $sRestrict, $sSearchName, $sSearchValue, $sReturnProperties, $sSort, $iFlags, $sWarningClick) Next EndIf Return $iCounter Else ReDim $aItems[$iCounter + 1][$aReturnProperties[0]] ; Process subfolders If BitAND($iFlags, 1) = 1 Then For $vFolder In $vFolder.Folders $aTemp = _OL_ItemFind($oOL, $vFolder, $iObjectClass, $sRestrict, $sSearchName, $sSearchValue, $sReturnProperties, $sSort, $iFlags, $sWarningClick) __OL_ArrayConcatenate($aItems, $aTemp, $iFlags) Next EndIf Return $aItems EndIf EndFunc ;==>_OL_ItemFind
    1 point
  11. Great! _OL_ItemFind checks just the first found item for correct properties (means that the item provides all requested properties). If this check is successfull the script could still crash because an item with the same objectclass could not provide all requested properties. This seems to be the case for the recall request. I could add a new flag to _OL_ItemFind to ignore such errors. "N/A" (not available) could be returned to mark such properties. What do you think?
    1 point
  12. Today thanks to @Danyfirex help, and thanks to this topic, I was able to make better AcrobatReader Viewer. Quick example: #include <AutoItConstants.au3> #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> #include <WindowsConstants.au3> Example() Func Example() ; This particular object is declared as ObjEvent() need to stored the Object, #forceref to avoid Au3Check warning. Local $oErrorHandler = ObjEvent("AutoIt.Error", _ErrFunc) #forceref $oErrorHandler ; Create a simple GUI for our output Local $hGUI = GUICreate("Embedded Web control Test", 640, 580, -1, -1, BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS, $WS_CLIPCHILDREN)) Local $oIE = ObjCreate("Shell.Explorer.2") Local $iID = GUICtrlCreateObj($oIE, 5, 5, 640 - 10, 580 - 10) #forceref $iID GUICtrlSetResizing(-1, $GUI_DOCKAUTO) GUISetState(@SW_SHOW) ;Show GUI Local $s_PDF_FileFullPath = FileOpenDialog("Choose PDF", "C:\Temp", "PDF Files(*.pdf)", 3) Local $oPDF If FileExists($s_PDF_FileFullPath) Then $oIE.navigate($s_PDF_FileFullPath) ;~ ObjName_FlagsValue($oIE) $oPDF = $oIE.document ; https://www.autoitscript.com/forum/topic/177368-how-to-get-reference-to-pdf-object-embeded-in-ie/?do=findComment&comment=1272692 ;~ ObjName_FlagsValue($oPDF) ;~ $oPDF.LoadFile($s_PDF_FileFullPath) $oPDF.GotoFirstPage ;~ $oPDF.SetZoom(200) ;~ $oPDF.SetZoom(20) $oPDF.SetLayoutMode('SinglePage') $oPDF.SetPageMode('none') $oPDF.SetShowToolbar(0) $oPDF.SetShowScrollbars(0) $oPDF.SetView('FitBH') $oPDF.SetViewScroll('FitBH',10) ;~ $oPDF.SetViewRect(100,100,100,100) ;~ $oPDF.SetCurrentHighlight(10,10,50,50) EndIf Local $a_Msg ; Loop until the user exits. While 1 $a_Msg = GUIGetMsg($GUI_EVENT_ARRAY) If $a_Msg[1] = $hGUI Then Switch $a_Msg[0] Case $GUI_EVENT_CLOSE ExitLoop Case $GUI_EVENT_MAXIMIZE, $GUI_EVENT_RESIZED, $GUI_EVENT_RESTORE ; , $GUI_EVENT_PRIMARYDOWN $oPDF.SetLayoutMode('SinglePage') $oPDF.SetPageMode('none') $oPDF.SetShowToolbar(0) $oPDF.SetShowScrollbars(0) $oPDF.SetView('FitBH') $oPDF.SetViewScroll('FitBH',10) ;~ $oPDF.SetViewRect(100,100,100,100) ;~ $oPDF.SetCurrentHighlight(10,10,50,50) EndSwitch EndIf WEnd GUIDelete() EndFunc ;==>Example ; User's COM error function. Will be called if COM error occurs Func _ErrFunc($oError) ; Do anything here. ConsoleWrite(@ScriptName & " (" & $oError.scriptline & ") : ==> COM Error intercepted !" & @CRLF & _ @TAB & "err.number is: " & @TAB & @TAB & "0x" & Hex($oError.number) & @CRLF & _ @TAB & "err.windescription:" & @TAB & $oError.windescription & @CRLF & _ @TAB & "err.description is: " & @TAB & $oError.description & @CRLF & _ @TAB & "err.source is: " & @TAB & @TAB & $oError.source & @CRLF & _ @TAB & "err.helpfile is: " & @TAB & $oError.helpfile & @CRLF & _ @TAB & "err.helpcontext is: " & @TAB & $oError.helpcontext & @CRLF & _ @TAB & "err.lastdllerror is: " & @TAB & $oError.lastdllerror & @CRLF & _ @TAB & "err.scriptline is: " & @TAB & $oError.scriptline & @CRLF & _ @TAB & "err.retcode is: " & @TAB & "0x" & Hex($oError.retcode) & @CRLF & @CRLF) EndFunc ;==>_ErrFunc Func ObjName_FlagsValue(ByRef $oObj) Local $sInfo = '' $sInfo &= '+>' & @TAB & 'ObjName($oObj,1) {The name of the Object} =' & @CRLF & @TAB & ObjName($oObj, $OBJ_NAME) & @CRLF ; HELPFILE REMARKS: Not all Objects support flags 2 to 7. Always test for @error in these cases. $sInfo &= '+>' & @TAB & 'ObjName($oObj,2) {Description string of the Object} =' & @CRLF & @TAB & ObjName($oObj, $OBJ_STRING) If @error Then $sInfo &= '@error = ' & @error $sInfo &= @CRLF & @CRLF $sInfo &= '+>' & @TAB & 'ObjName($oObj,3) {The ProgID of the Object} =' & @CRLF & @TAB & ObjName($oObj, $OBJ_PROGID) If @error Then $sInfo &= '@error = ' & @error $sInfo &= @CRLF & @CRLF $sInfo &= '+>' & @TAB & 'ObjName($oObj,4) {The file that is associated with the object in the Registry} =' & @CRLF & @TAB & ObjName($oObj, $OBJ_FILE) If @error Then $sInfo &= '@error = ' & @error $sInfo &= @CRLF & @CRLF $sInfo &= '+>' & @TAB & 'ObjName($oObj,5) {Module name in which the object runs (WIN XP And above). Marshaller for non-inproc objects.} =' & @CRLF & @TAB & ObjName($oObj, $OBJ_MODULE) If @error Then $sInfo &= '@error = ' & @error $sInfo &= @CRLF & @CRLF $sInfo &= '+>' & @TAB & 'ObjName($oObj,6) {CLSID of the object''s coclass} =' & @CRLF & @TAB & ObjName($oObj, $OBJ_CLSID) If @error Then $sInfo &= '@error = ' & @error $sInfo &= @CRLF & @CRLF $sInfo &= '+>' & @TAB & 'ObjName($oObj,7) {IID of the object''s interface} =' & @CRLF & @TAB & ObjName($oObj, $OBJ_IID) If @error Then $sInfo &= '@error = ' & @error $sInfo &= @CRLF & @CRLF MsgBox($MB_SYSTEMMODAL, "ObjName:", $sInfo) EndFunc ;==>ObjName_FlagsValue
    1 point
  13. The original Author was Yashied and I just modified it a little! Function: Func _GUISetIcon($hWnd, $sFilePath, $iName) If Not IsHWnd($hWnd) Then Local $iLabel = GUICtrlCreateLabel('', -99, -99, 1, 1) $hWnd = _WinAPI_GetParent(GUICtrlGetHandle($iLabel)) If @error Then Return SetError(@error, 0 * GUICtrlDelete($iLabel), 0) EndIf GUICtrlDelete($iLabel) EndIf Local $hIcon = _WinAPI_LoadImage(_WinAPI_GetModuleHandle($sFilePath), $iName, 1, 32, 32, 0) Return _SendMessage($hWnd, $WM_SETICON, 1, $hIcon) EndFunc ;==>_GUISetIconExample use of Function. #include <GUIConstantsEx.au3> #include <WinAPI.au3> #include <WindowsConstants.au3> Example() Func Example() Local $hGUI = GUICreate('_GUISetIcon()') GUISetState(@SW_SHOW, $hGUI) _GUISetIcon(-1, @SystemDir & 'shell32.dll', 25) ; Change Icon! - Uses -1 to get the last GUI Handle. Sleep(2000) _GUISetIcon($hGUI, @SystemDir & 'shell32.dll', 30) ; Change Icon! - Passing the GUI Handle to the Function. Sleep(2000) _GUISetIcon($hGUI, '', '') ; Reset Icon. While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd GUIDelete($hGUI) EndFunc ;==>Example
    1 point
×
×
  • Create New...