-
Posts
11,682 -
Joined
-
Last visited
-
Days Won
63
mLipok last won the day on January 29
mLipok had the most liked content!
About mLipok

- Birthday 07/19/1978
Profile Information
-
Member Title
Sometimes... even usually I'm nitpicky.
-
Location
Europe, Poland, Upper Silesia, Zabrze
-
Interests
¯\_(ツ)_/¯
mLipok's Achievements
-
donnyh13 reacted to a post in a topic:
Help File/Documentation Issues. (Discussion Only)
-
argumentum reacted to a post in a topic:
Help File/Documentation Issues. (Discussion Only)
-
Nine reacted to a post in a topic:
Help File/Documentation Issues. (Discussion Only)
-
Help File/Documentation Issues. (Discussion Only)
mLipok replied to guinness's topic in AutoIt Technical Discussion
finall version: Example() Func Example() ; Declare a map and assign with various keys value pairs. Local $mMap[] $mMap[1] = "Integer One" ; Integer value as a key. $mMap["2"] = "String Two" ; String value representing an integer as a key. This is a string not an integer. MapAppend($mMap, "Integer Two") ; Append a value using the next available integer, which is 2 in this case. $mMap.test = 'testing' ; Dot notation equivalent to $mMap["test"] = "testing" ; Retrieve the keys contained in the map. A zero-based one-dimensional array is returned. Local $aMapKeys = MapKeys($mMap) For $vKey In $aMapKeys ; Or a For loop can be used as well. ConsoleWrite(@CRLF & _ '> Key: ' & $vKey & @CRLF & _ ; The key. '> Key Type: ' & VarGetType($vKey) & @CRLF & _ ; Display the variable type of the key i.e. integer or string. '> Key Value: "' & $mMap[$vKey] & '"' & @CRLF & _ ; Use the array value of MapKeys() to display the value of the key. '') Next EndFunc ;==>Example -
Help File/Documentation Issues. (Discussion Only)
mLipok replied to guinness's topic in AutoIt Technical Discussion
#include <MsgBoxConstants.au3> Example() Func Example() ; Declare a map and assign with various keys value pairs. Local $mMap[] $mMap[1] = "Integer One" ; Integer value as a key. $mMap["2"] = "String Two" ; String value representing an integer as a key. This is a string not an integer. MapAppend($mMap, "Integer Two") ; Append a value using the next available integer, which is 2 in this case. $mMap.test = 'testing' ; ; Retrieve the keys contained in the map. A zero-based one-dimensional array is returned. Local $aMapKeys = MapKeys($mMap) For $vKey In $aMapKeys ; Or a For loop can be used as well. ConsoleWrite(@CRLF & _ '> Key: ' & $vKey & @CRLF & _ ; The key. '> Key Type: ' & VarGetType($vKey) & @CRLF & _ ; Display the variable type of the key i.e. integer or string. '> Key Value: "' & $mMap[$vKey] & '"' & @CRLF & _ ; Use the array value of MapKeys() to display the value of the key. '') Next EndFunc ;==>Example please suggest comment for: $mMap.test = 'testing' ; -
Help File/Documentation Issues. (Discussion Only)
mLipok replied to guinness's topic in AutoIt Technical Discussion
Original MapKeys() example: #include <MsgBoxConstants.au3> Example() Func Example() ; Declare a map and assign with various keys value pairs. Local $mMap[] $mMap[1] = "Integer One" ; Integer value as a key. $mMap["2"] = "String Two" ; String value representing an integer as a key. This is a string not an integer. MapAppend($mMap, "Integer Two") ; Append a value using the next available integer, which is 2 in this case. ; Retrieve the keys contained in the map. A zero-based one-dimensional array is returned. Local $aMapKeys = MapKeys($mMap) For $vKey In $aMapKeys ; Or a For loop can be used as well. MsgBox($MB_SYSTEMMODAL, "", "Key: " & $vKey & @CRLF & _ ; The key. "Value: " & $mMap[$vKey] & @CRLF & _ ; Use the array value of MapKeys() to display the value of the key. "Variable Type: " & VarGetType($vKey) & @CRLF) ; Display the variable type of the key i.e. integer or string. Next EndFunc ;==>Example proposal: #include <MsgBoxConstants.au3> Example() Func Example() ; Declare a map and assign with various keys value pairs. Local $mMap[] $mMap[1] = "Integer One" ; Integer value as a key. $mMap["2"] = "String Two" ; String value representing an integer as a key. This is a string not an integer. MapAppend($mMap, "Integer Two") ; Append a value using the next available integer, which is 2 in this case. $mMap.test = 'testing' ; ; Retrieve the keys contained in the map. A zero-based one-dimensional array is returned. Local $aMapKeys = MapKeys($mMap) For $vKey In $aMapKeys ; Or a For loop can be used as well. MsgBox($MB_SYSTEMMODAL, "", _ "Key: " & $vKey & @CRLF & _ ; The key. "Key Type: " & VarGetType($vKey) & @CRLF & _ ; Display the variable type of the key i.e. integer or string. "Key Value: " & $mMap[$vKey] & @CRLF & _ ; Use the array value of MapKeys() to display the value of the key. "") Next EndFunc ;==>Example please suggest comments for: $mMap.test = 'testing' ; Any comments are welcome. -
bladem2003 reacted to a post in a topic:
WebView2AutoIt - AutoIt WebView2 Component (COM Interop)
-
https://github.com/ioa747/NetWebView2Lib/issues/91
-
Not knowing how. You can think as this is not supported yet, but this is only a matter of time to get knowing how to do it.
-
mLipok reacted to a post in a topic:
AutoItIPC UDF for Inter Process Communication
-
donnyh13 reacted to a post in a topic:
Help File/Documentation Issues. (Discussion Only)
-
Help File/Documentation Issues. (Discussion Only)
mLipok replied to guinness's topic in AutoIt Technical Discussion
Hello my friends Please take a look here: https://www.autoitscript.com/trac/autoit/ticket/4070 What do you think ? -
donnyh13 reacted to a post in a topic:
Help File/Documentation Issues. (Discussion Only)
-
SOLVE-SMART reacted to a post in a topic:
Help File/Documentation Issues. (Discussion Only)
-
mLipok reacted to a post in a topic:
Low-Polygon Maker v0.60 build 2026-02-13
-
ioa747 reacted to a post in a topic:
Help File/Documentation Issues. (Discussion Only)
-
Help File/Documentation Issues. (Discussion Only)
mLipok replied to guinness's topic in AutoIt Technical Discussion
Today thanks to @ioa747 I hit something new to me. You can create many Event Handlers for the same Object. Did you know that ? Here is modified example: ObjEvent.au3 #include <MsgBoxConstants.au3> Example() Func Example() ; Error monitoring. This will trap all COM errors while alive. ; This particular object is declared as local, meaning after the function returns it will not exist. Local $oErrorHandler = ObjEvent("AutoIt.Error", "_ErrFunc") ; Create Internet Explorer object Local $oIE = ObjCreate("InternetExplorer.Application") ; Check for errors If @error Then Return $oIE.Visible = True ; set visibility ; Custom sink object Local $oIEEvents_1 = ObjEvent($oIE, "_IEEvent_1_", "DWebBrowserEvents2") Local $oIEEvents_2 = ObjEvent($oIE, "_IEEvent_2_", "DWebBrowserEvents2") ; Navigate somewhere $oIE.navigate("http://www.google.com/") ; Check for errors while loading If @error Then $oIE.Quit() Return EndIf ; Wait for page to load While 1 If $oIE.readyState = "complete" Or $oIE.readyState = 4 Then ExitLoop Sleep(10) WEnd ; Deliberately cause error by calling non-existing method $oIE.PlayMeARockAndRollSong() ; Check for errors If @error Then MsgBox($MB_SYSTEMMODAL, "COM Error", "@error is set to COM error number." & @CRLF & "@error = 0x" & Hex(@error)) ; Wait few seconds to see if more events will be fired Sleep(3000) ; Nothing more to do. Close IE and return from the function $oIE.Quit() #forceref $oErrorHandler, $oIEEvents_1, $oIEEvents_2 EndFunc ;==>Example ; BeforeNavigate2 method definition Func _IEEvent_1_BeforeNavigate2($oIEpDisp, $sIEURL, $iIEFlags, $sIETargetFrameName, $sIEPostData, $iIEHeaders, $bIECancel) ConsoleWrite("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!--_IEEvent_1_BeforeNavigate2() fired--!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! " & @CRLF & _ "$oIEpDisp = " & $oIEpDisp() & " - " & ObjName($oIEpDisp) & @CRLF & _ ; e.g. default property and name for the object "$sIEURL = " & $sIEURL & @CRLF & _ "$iIEFlags = " & $iIEFlags & @CRLF & _ "$sIETargetFrameName = " & $sIETargetFrameName & @CRLF & _ "$sIEPostData = " & $sIEPostData & @CRLF & _ "$iIEHeaders = " & $iIEHeaders & @CRLF & _ "$bIECancel = " & $bIECancel & @CRLF & _ "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! " & @CRLF & @CRLF) EndFunc ;==>_IEEvent_BeforeNavigate2 Func _IEEvent_2_BeforeNavigate2($oIEpDisp, $sIEURL, $iIEFlags, $sIETargetFrameName, $sIEPostData, $iIEHeaders, $bIECancel) ConsoleWrite("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!--_IEEvent_2_BeforeNavigate2() fired--!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! " & @CRLF & _ "$oIEpDisp = " & $oIEpDisp() & " - " & ObjName($oIEpDisp) & @CRLF & _ ; e.g. default property and name for the object "$sIEURL = " & $sIEURL & @CRLF & _ "$iIEFlags = " & $iIEFlags & @CRLF & _ "$sIETargetFrameName = " & $sIETargetFrameName & @CRLF & _ "$sIEPostData = " & $sIEPostData & @CRLF & _ "$iIEHeaders = " & $iIEHeaders & @CRLF & _ "$bIECancel = " & $bIECancel & @CRLF & _ "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! " & @CRLF & @CRLF) EndFunc ;==>_IEEvent_BeforeNavigate2 ; 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 -
I just review my code of PDF Viewing. The following code shows in a loop PDF taken from directory #AutoIt3Wrapper_UseX64=y #include <File.au3> #include <GUIConstantsEx.au3> #include <SendMessage.au3> #include <StaticConstants.au3> #include <WinAPIGdi.au3> #include <WinAPIGdiDC.au3> #include <WinAPIHObj.au3> #include <WinAPISysWin.au3> #include <WindowsConstants.au3> #SciTE4AutoIt3_Dynamic_Include_Path=;..\NetWebView2Lib.au3 #SciTE4AutoIt3_Dynamic_Include=y ;dynamic.include=y/n #SciTE4AutoIt3_Dynamic_Include_whiletyping=y ;dynamic.include.whiletyping=y/n #SciTE4AutoIt3_Dynamic_Include_recursive_check=y ;dynamic.include.recursive.check=n/y #SciTE4AutoIt3_Dynamic_Include_use_local_cache=y ;dynamic.include.use.local.cache=n/y #SciTE4AutoIt3_Dynamic_Include_version=prod ;dynamic.include.version=prod/beta #SciTE4AutoIt3_Dynamic_Include_verboselevel=0 ;dynamic.include.verbose.level=0/1/2 ; 0=disabled; 1=Timing per Function; 2=1+Total timing #SciTE4AutoIt3_Dynamic_Include_Always_Update_Local_File=n ;dynamic.include.always.update.local.file=n/y #SciTE4AutoIt3_AutoItTools_debug=n ;debug.autoIttools=n/y #SciTE4AutoIt3_AutoItDynamicIncludes_debug=n ;debug.AutoItDynamicIncludes=n/y #SciTE4AutoIt3_AutoItAutocomplete_debug=n ;debug.autoitautocomplet=n/y #SciTE4AutoIt3_AutoItGotoDefinition_debug=n ;debug.autoitgotodefinition=n/y #SciTE4AutoIt3_AutoItIndentFix_debug=n ;debug.autoitindentfix=n/y #include "..\NetWebView2Lib.au3" Main() Func Main() Local $oMyError = ObjEvent("AutoIt.Error", __NetWebView2_COMErrFunc) #forceref $oMyError ; Create the UI Local $iHeight = 800 Local $hGUI = GUICreate("WebView2 .NET Manager - Demo: " & @ScriptName, 1100, $iHeight, -1, -1, BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPCHILDREN)) Local $idLabelStatus = GUICtrlCreateLabel("Status: Initializing Engine...", 10, $iHeight - 20, 880, 20) #forceref $idLabelStatus GUICtrlSetFont(-1, 9, 400, 0, "Segoe UI") ; Initialize WebView2 Manager and register events Local $oWebV2M = _NetWebView2_CreateManager("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36 Edg/144.0.0.0", "", "--mute-audio") $_g_oWeb = $oWebV2M If @error Then Return SetError(@error, @extended, $oWebV2M) ; Initialize JavaScript Bridge Local $oJSBridge = _NetWebView2_GetBridge($oWebV2M, "_BridgeMyEventsHandler_") If @error Then Return SetError(@error, @extended, $oWebV2M) Local $sProfileDirectory = @TempDir & "\NetWebView2Lib-UserDataFolder" _NetWebView2_Initialize($oWebV2M, $hGUI, $sProfileDirectory, 0, 0, 0, 0, True, True, True, 1.2, "0x2B2B2B") Local $i_ProcessID = @extended #forceref $i_ProcessID GUISetState(@SW_SHOW, $hGUI) ConsoleWrite("! ===" & @ScriptLineNumber & @CRLF) ;~ MsgBox($MB_TOPMOST, "TEST #" & @ScriptLineNumber, 0) Local $s_PDF_FileFullPath Local $s_PDF_Directory = FileSelectFolder('Choose folder with PDF','') Local $a_Files = _FileListToArrayRec($s_PDF_Directory, '*.pdf', $FLTAR_FILES, $FLTAR_RECUR, $FLTAR_NOSORT, $FLTAR_FULLPATH) Local Static $hWebView2_Window = _WinAPI_GetWindow($hGUI, $GW_CHILD) For $IDX_File = 1 To $a_Files[0] $s_PDF_FileFullPath = $a_Files[$IDX_File] _NetWebView2_NavigateToPDF($oWebV2M, $s_PDF_FileFullPath, $hWebView2_Window, '#view=FitH', 1000) ConsoleWrite("! === @SLN=" & @ScriptLineNumber & ' ' & $s_PDF_FileFullPath & @CRLF) Next ; Main Loop While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd GUIDelete($hGUI) _NetWebView2_CleanUp($oWebV2M, $oJSBridge) EndFunc ;==>Main Func _EnumWindow($hWnd) Local $aData = _WinAPI_EnumChildWindows($hWnd) ConsoleWrite("! $aData[1][0] = " & $aData[1][0] & @CRLF) ;~ _ArrayDisplay($aData, '_WinAPI_EnumChildWindows') If Not @error And UBound($aData) Then Return $aData[1][0] Return SetError(1, @extended, False) EndFunc ;==>Example Func __NetWebView2_freezer($hWebView2_Window, $idPic = 0) #Region ; if $idPic is given then it means you already have it and want to delete it - unfreeze - show WebView2 content If $idPic Then _SendMessage($hWebView2_Window, $WM_SETREDRAW, True, 0) ; Enables _WinAPI_RedrawWindow($hWebView2_Window, 0, 0, BitOR($RDW_FRAME, $RDW_INVALIDATE, $RDW_ALLCHILDREN)) ; Repaints GUICtrlDelete($idPic) Return EndIf #EndRegion ; if $idPic is given then it means you already have it and want to delete it - unfreeze - show WebView2 content #Region ; freeze $hWebView2_Window #Region ; add PIC to parent window Local $hMainGUI_Window = _WinAPI_GetWindow($hWebView2_Window, $GW_HWNDPREV) Local $aPos = WinGetPos($hWebView2_Window) Local $hPrev = GUISwitch($hMainGUI_Window) $idPic = GUICtrlCreatePic('', 0, 0, $aPos[2], $aPos[3]) Local $hPic = GUICtrlGetHandle($idPic) GUISwitch($hPrev) #EndRegion ; add PIC to parent window ; Create bitmap Local $hDC = _WinAPI_GetDC($hPic) Local $hDestDC = _WinAPI_CreateCompatibleDC($hDC) Local $hBitmap = _WinAPI_CreateCompatibleBitmap($hDC, $aPos[2], $aPos[3]) Local $hDestSv = _WinAPI_SelectObject($hDestDC, $hBitmap) Local $hSrcDC = _WinAPI_CreateCompatibleDC($hDC) Local $hBmp = _WinAPI_CreateCompatibleBitmap($hDC, $aPos[2], $aPos[3]) Local $hSrcSv = _WinAPI_SelectObject($hSrcDC, $hBmp) _WinAPI_PrintWindow($hWebView2_Window, $hSrcDC, 2) _WinAPI_BitBlt($hDestDC, 0, 0, $aPos[2], $aPos[3], $hSrcDC, 0, 0, $MERGECOPY) _WinAPI_ReleaseDC($hPic, $hDC) _WinAPI_SelectObject($hDestDC, $hDestSv) _WinAPI_SelectObject($hSrcDC, $hSrcSv) _WinAPI_DeleteDC($hDestDC) _WinAPI_DeleteDC($hSrcDC) _WinAPI_DeleteObject($hBmp) ; Set bitmap to control _SendMessage($hPic, $STM_SETIMAGE, 0, $hBitmap) Local $hObj = _SendMessage($hPic, $STM_GETIMAGE) If $hObj <> $hBitmap Then _WinAPI_DeleteObject($hBitmap) EndIf _SendMessage($hWebView2_Window, $WM_SETREDRAW, False, 0) ; Disables ; https://www.autoitscript.com/forum/topic/199172-disable-gui-updating-repainting/ Return $idPic #EndRegion ; freeze $hWebView2_Window EndFunc ;==>__NetWebView2_freezer Func _NetWebView2_NavigateToPDF(ByRef $oWebV2M, $s_URL_or_FileFullPath, $hWebView2_Window = 0, $s_Parameters = '', $iSleep_ms = 1000) Local $idPic If FileExists($s_URL_or_FileFullPath) Then $s_URL_or_FileFullPath = StringReplace($s_URL_or_FileFullPath, ' ', '%20') $s_URL_or_FileFullPath = "file:///" & $s_URL_or_FileFullPath If $iSleep_ms Then $iSleep_ms -= 400 If $iSleep_ms < 600 Then $iSleep_ms = 600 EndIf EndIf If $s_Parameters Then $s_URL_or_FileFullPath &= $s_Parameters #TIP: FitToPage: https://stackoverflow.com/questions/78820187/how-to-change-webview2-fit-to-page-button-on-pdf-toolbar-default-to-fit-to-width#comment138971950_78821231 #TIP: Open desired PAGE: https://stackoverflow.com/questions/68500164/cycle-pdf-pages-in-wpf-webview2#comment135402565_68566860 EndIf If $hWebView2_Window Then $idPic = __NetWebView2_freezer($hWebView2_Window) _NetWebView2_Navigate($oWebV2M, $s_URL_or_FileFullPath) Sleep($iSleep_ms) If $hWebView2_Window Then __NetWebView2_freezer($hWebView2_Window, $idPic) EndIf EndFunc ;==>_NetWebView2_NavigateToPDF There is $iSleep_ms parameter which in case of local file should have shorter time in relation to showing online pdf file. Please check if you see any flickering/gliches with opening PDF Files so fast.
-
Parsix reacted to a post in a topic:
WebView2AutoIt - AutoIt WebView2 Component (COM Interop)
-
Need to have Admin privileges after WinActivate
mLipok replied to Zog's topic in AutoIt General Help and Support
The best one is to run service which will give you an oportunity to run different process on demand. But of course at first you must have Admin Rights to install and run such service. -
Need to have Admin privileges after WinActivate
mLipok replied to Zog's topic in AutoIt General Help and Support
It is an options, but it will be fired at time, and not at demand. -
Need to have Admin privileges after WinActivate
mLipok replied to Zog's topic in AutoIt General Help and Support
This is the normal Windows security behavior, when accessing the GUI using functions like: WinActivate("New Proprietary Program") MouseClick("left,xpos,ypos) Meaning, The controlled program and the controlling/automating program must have the same security level for the controlling/automating program to be able to access the controlled program. In your case Lower the security level/runtime environment of the controlled program. or Raise this level for the control/automation program. In your case as you showed to us, the #RequireAdmin did the trick -
Windows.Data.Pdf Namespace in AutoIt ?
mLipok replied to mLipok's topic in AutoIt General Help and Support
With PDF I was just curious because I came across it while searching for solutions to other problems. With JSON I just wanted confirmation. By asking this directly, it will be easier for everyone to find it in search engines, even for me in the future when I need it. Now I'm focusing on WebView2 Anyway, Thanks for yours answer. mLipok -
Windows.Data.Pdf Namespace in AutoIt ?
mLipok replied to mLipok's topic in AutoIt General Help and Support
oh... Nice Thanks So we can use this also for: https://learn.microsoft.com/en-us/uwp/api/windows.data.json?view=winrt-26100 -
mLipok reacted to a post in a topic:
Windows.Data.Pdf Namespace in AutoIt ?
-
Clean full example is here: https://github.com/ioa747/NetWebView2Lib/pull/41
-
is there a way to use Windows.Data.Pdf in AutoIt ? https://learn.microsoft.com/en-us/uwp/api/windows.data.pdf?view=winrt-26100