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

- Currently Viewing Topic: Creating a secure updater program using AutoIt
- Birthday 07/19/1978
Profile Information
-
Member Title
Sometimes... even usually I'm nitpicky.
-
Location
Europe, Poland, Upper Silesia, Zabrze
-
Interests
¯\_(ツ)_/¯
mLipok's Achievements
-
mLipok reacted to a post in a topic:
3D Maze Ball (AutoIt3 + C)
-
Questions about: _GUIScrollBars_* functions
mLipok replied to mLipok's topic in AutoIt GUI Help and Support
QUESTION 2: Why _GUIScrollBars_GetScrollInfo[2].au3 uses: .... GUICtrlSetResizing($h_GUIC, $GUI_DOCKALL) .... GUICtrlSetResizing($h_GUIC2, $GUI_DOCKALL) .... I mean: Why was a window handle used instead of a control element? -
QUESTION 1: What _GUIScrollBars_GetScrollInfo.au3 examples really does? Maybe it is broken or just stopped to work with Win11 EDIT: please note that _GUIScrollBars_GetScrollInfo.au3 is example for _GUIScrollBars_ScrollWindow() My point is that looking on this description I expected there to be an example of scrolling through the window's contents. And bam! It doesn't work as I expected. That's why I'm asking: What _GUIScrollBars_GetScrollInfo.au3 examples really does?
-
Help File/Documentation Issues. (Discussion Only)
mLipok replied to guinness's topic in AutoIt Technical Discussion
Oops not here.. Moved here: -
donnyh13 reacted to a post in a topic:
Au3 LibreOffice API Inspector tools
-
Aha
- 3 replies
-
- libreoffice
- api
-
(and 1 more)
Tagged with:
-
donnyh13 reacted to a post in a topic:
Au3 LibreOffice API Inspector tools
-
I think you can add this stuff to yours GITHUB project.
- 3 replies
-
- libreoffice
- api
-
(and 1 more)
Tagged with:
-
mLipok reacted to a post in a topic:
Au3 LibreOffice API Inspector tools
-
donnyh13 reacted to a post in a topic:
Maximum characters that can bet output in the Debug Window ?
-
try this: #include <GUIConstantsEx.au3> #include <GuiEdit.au3> #include <MsgBoxConstants.au3> Example() Func Example() ; Create GUI GUICreate("Edit Get/Set Limit Text (v" & @AutoItVersion & ")", 400, 300) Local $idEdit = GUICtrlCreateEdit("This is a test" & @CRLF & "Another Line", 2, 2, 394, 268) GUISetState(@SW_SHOW) MsgBox($MB_SYSTEMMODAL, "Information", "Text Limit: " & _GUICtrlEdit_GetLimitText($idEdit)) MsgBox($MB_SYSTEMMODAL, "Information", "Setting Text Limit") _GUICtrlEdit_SetLimitText($idEdit, 1024*1024) MsgBox($MB_SYSTEMMODAL, "Information", "Text Limit: " & _GUICtrlEdit_GetLimitText($idEdit)) ; Loop until the user exits. Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() EndFunc ;==>Example
-
Follow-up question regarding _WinAPI PrintWindow()
mLipok replied to mLipok's topic in AutoIt General Help and Support
Thank you very much. I will have few questions. 1. Is this following part not required when the source and destination size will be the same ? ; Use HALFTONE for better quality when stretching/scaling during capture _WinAPI_SetStretchBltMode($hDC_Capture, $HALFTONE) 2. Why after using: Local Const $hObjectOld = _WinAPI_SelectObject($hMemDC, $hHBmp) there is a need to use it as a kind of revert _WinAPI_SelectObject($hMemDC, $hObjectOld) I understand it's about restoring/freeing/wiping, but reverting seems a bit odd to me. 3. about the cropping feature ; Optionally crop the bitmap to the visible window area, excluding shadow/frame margins If $bCrop Then Local $iLeft, $iTop, $iRight, $iBottom, $pX, $pY #forceref $pX, $pY ; Query the actual visible frame bounds via DWM to get the exact shadow margins Local $tRECT = _WinAPI_DwmGetWindowAttribute($hWnd, $DWMWA_EXTENDED_FRAME_BOUNDS) ; Calculate the margin on each side $iLeft = $tRECT.left - $aWinSize[0] $iTop = $tRECT.top - $aWinSize[1] $iRight = $aWinSize[0] + $aWinSize[2] - $tRECT.right $iBottom = $aWinSize[1] + $aWinSize[3] - $tRECT.bottom Local $hBitmap_Cropped = _GDIPlus_BitmapCloneArea($hBitmap, $iLeft, $iTop, $aWinSize[2] - $iLeft - $iRight, $aWinSize[3] - $iTop - $iBottom) _GDIPlus_BitmapDispose($hBitmap) $hBitmap = $hBitmap_Cropped EndIf If I have a window that contains an embedded IE control, WebView, DebenuViewer, or even simpler _WinAPI_CreateWindowEx(), that is, not the window created using GuiCreate() Then ... was it a case that the cropping is not needed ? I mean when will this be the case when user should to crop entire window ? btw. Question 1 and 3 are quite similar or even the same case. -
Follow-up question regarding _WinAPI PrintWindow()
mLipok replied to mLipok's topic in AutoIt General Help and Support
@UEZ Would you be so kind as to take a look at this code, perhaps improve it or add comments? Perhaps this will allow us to create a better example or improve the HelpFile. Anyway, thanks. -
Help File/Documentation Issues. (Discussion Only)
mLipok replied to guinness's topic in AutoIt Technical Discussion
_WinAPI_BitBlt HelpFile description for $iROP: do all these bold text fragments refer to: $hDestDC ? -
Follow-up question regarding _WinAPI PrintWindow()
mLipok replied to mLipok's topic in AutoIt General Help and Support
btw. Here is modified _WinAPI_PrintWindow.au3 example: #include <GUIConstantsEx.au3> #include <SendMessage.au3> #include <StaticConstants.au3> #include <WinAPIGdi.au3> #include <WinAPIGdiDC.au3> #include <WinAPIHObj.au3> #include <WindowsConstants.au3> _Example() Func _Example() ShellExecute(@SystemDir & '\calc.exe') Local $hWnd = WinWaitActive("[REGEXPCLASS:CalcFrame|ApplicationFrameWindow]", '', 3) If Not $hWnd Then Exit EndIf Sleep(500) ; give it time to draw - let the window draw completely - skip the window animation ; Create GUI Local $aSize = WinGetPos($hWnd) GUICreate('Test ' & StringReplace(@ScriptName, '.au3', '()'), $aSize[2] + 80, $aSize[3] + 80) Local $idPic = GUICtrlCreatePic('', 40, 40, $aSize[2], $aSize[3]) Local $hPicture_Control = GUICtrlGetHandle($idPic) Local $hPicture_DC = _WinAPI_GetDC($hPicture_Control) ; Create destination bitmap Local $hDestination_Bitmap = _WinAPI_CreateCompatibleBitmap($hPicture_DC, $aSize[2], $aSize[3]) Local $hDestination_DC = _WinAPI_CreateCompatibleDC($hPicture_DC) Local $hDestination_Sv = _WinAPI_SelectObject($hDestination_DC, $hDestination_Bitmap) ; Create source bitmap Local $hSource_Bitmap = _WinAPI_CreateCompatibleBitmap($hPicture_DC, $aSize[2], $aSize[3]) Local $hSource_DC = _WinAPI_CreateCompatibleDC($hPicture_DC) Local $hSource_Sv = _WinAPI_SelectObject($hSource_DC, $hSource_Bitmap) Local Const $PW_RENDERFULLCONTENT = 0x2 ; this will go to where it should =) _WinAPI_PrintWindow($hWnd, $hSource_DC, $PW_RENDERFULLCONTENT) _WinAPI_BitBlt($hDestination_DC, 0, 0, $aSize[2], $aSize[3], $hSource_DC, 0, 0, $MERGECOPY) _WinAPI_ReleaseDC($hPicture_Control, $hPicture_DC) #Region ; CleanUp _WinAPI_SelectObject($hDestination_DC, $hDestination_Sv) _WinAPI_DeleteDC($hDestination_DC) _WinAPI_SelectObject($hSource_DC, $hSource_Sv) _WinAPI_DeleteDC($hSource_DC) _WinAPI_DeleteObject($hSource_Bitmap) #EndRegion ; CleanUp ; Set bitmap to control _SendMessage($hPicture_Control, $STM_SETIMAGE, 0, $hDestination_Bitmap) Local $hObj = _SendMessage($hPicture_Control, $STM_GETIMAGE) If $hObj <> $hDestination_Bitmap Then _WinAPI_DeleteObject($hDestination_Bitmap) EndIf GUISetState(@SW_SHOW) Do Until GUIGetMsg() = $GUI_EVENT_CLOSE WinClose($hWnd, "") EndFunc ;==>_Example -
argumentum reacted to a post in a topic:
Follow-up question regarding _WinAPI PrintWindow()
-
Follow-up question regarding _WinAPI PrintWindow()
mLipok replied to mLipok's topic in AutoIt General Help and Support
It's almost like me Maybe the GDI master could answer... let's see if @UEZ knows the answers ? -
Follow-up question regarding _WinAPI PrintWindow()
mLipok replied to mLipok's topic in AutoIt General Help and Support
yeap btw. Why _WinAPI_BitBlt() was used - and in my scenario it is not needed ? -
argumentum reacted to a post in a topic:
WebView2AutoIt - AutoIt WebView2 Component (COM Interop)
-
In relation to: @argumentum and @Nine could you be so nice and check mine modification from: https://github.com/ioa747/NetWebView2Lib/pull/104/changes Func __NetWebView2_freezer($oWebV2M, ByRef $idPic) Local $hWindow_WebView2 = WinGetHandle($oWebV2M.BrowserWindowHandle) #Region ; if $idPic is given then it means you already have it and want to delete it - unfreeze - show WebView2 content If $idPic Then WinSetState($hWindow_WebView2, '', @SW_SHOW) GUICtrlDelete($idPic) $idPic = 0 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 $hWindow_WebView2 #Region ; add PIC to parent window Local $hWindow_Parent = WinGetHandle($oWebV2M.ParentWindowHandle) Local $aPos = WinGetPos($hWindow_WebView2) Local $hPrev = GUISwitch($hWindow_Parent) $idPic = GUICtrlCreatePic('', 0, 0, $aPos[2], $aPos[3]) Local $hPic = GUICtrlGetHandle($idPic) GUISwitch($hPrev) #EndRegion ; add PIC to parent window Local $hPictureDC = _WinAPI_GetDC($hPic) ; Create Dest bitmap Local $hDestination_DC = _WinAPI_CreateCompatibleDC($hPictureDC) ; Creates a memory device context compatible with the specified device Local $hDestination_Bitmap = _WinAPI_CreateCompatibleBitmap($hPictureDC, $aPos[2], $aPos[3]) ; Creates a bitmap compatible with the specified device context Local $hDestination_Sv = _WinAPI_SelectObject($hDestination_DC, $hDestination_Bitmap) ; Selects an object into the specified device context _WinAPI_PrintWindow($hWindow_WebView2, $hDestination_DC, 2) _WinAPI_ReleaseDC($hPic, $hPictureDC) _WinAPI_SelectObject($hDestination_DC, $hDestination_Sv) _WinAPI_DeleteDC($hDestination_DC) ; Set bitmap to control _SendMessage($hPic, $STM_SETIMAGE, 0, $hDestination_Bitmap) _WinAPI_DeleteObject($hDestination_Bitmap) WinSetState($hWindow_WebView2, '', @SW_HIDE) Return $idPic #EndRegion ; freeze $hWindow_WebView2 EndFunc ;==>__NetWebView2_freezer I reduced the code by 11 lines. I wonder why the earlier version uses two bitmaps? Can someone enlighten me? EDIT: Earlier version: #include <GUIConstantsEx.au3> #include <SendMessage.au3> #include <StaticConstants.au3> #include <WinAPIGdi.au3> #include <WinAPIGdiDC.au3> #include <WinAPIHObj.au3> #include <WindowsConstants.au3> _Example() Func _Example() ShellExecute(@SystemDir & '\calc.exe') Local $hWnd = WinWaitActive("[REGEXPCLASS:CalcFrame|ApplicationFrameWindow]", '', 3) If Not $hWnd Then Exit EndIf Sleep(500) ; give it time to draw - let the window draw completely - skip the window animation ; Create GUI Local $aSize = WinGetPos($hWnd) GUICreate('Test ' & StringReplace(@ScriptName, '.au3', '()'), $aSize[2] + 80, $aSize[3] + 80) Local $idPic = GUICtrlCreatePic('', 40, 40, $aSize[2], $aSize[3]) Local $hPic = GUICtrlGetHandle($idPic) ; Create bitmap Local $hDC = _WinAPI_GetDC($hPic) Local $hDestDC = _WinAPI_CreateCompatibleDC($hDC) Local $hBitmap = _WinAPI_CreateCompatibleBitmap($hDC, $aSize[2], $aSize[3]) Local $hDestSv = _WinAPI_SelectObject($hDestDC, $hBitmap) Local $hSrcDC = _WinAPI_CreateCompatibleDC($hDC) Local $hBmp = _WinAPI_CreateCompatibleBitmap($hDC, $aSize[2], $aSize[3]) Local $hSrcSv = _WinAPI_SelectObject($hSrcDC, $hBmp) Local Const $PW_RENDERFULLCONTENT = 0x2 ; this will go to where it should =) _WinAPI_PrintWindow($hWnd, $hSrcDC, $PW_RENDERFULLCONTENT) _WinAPI_BitBlt($hDestDC, 0, 0, $aSize[2], $aSize[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 GUISetState(@SW_SHOW) Do Until GUIGetMsg() = $GUI_EVENT_CLOSE WinClose($hWnd, "") EndFunc ;==>_Example