Jump to content

argumentum

MVPs
  • Posts

    6,124
  • Joined

  • Days Won

    216

argumentum last won the day on July 8

argumentum had the most liked content!

7 Followers

About argumentum

Profile Information

  • Member Title
    ✨Universalist ✨
  • Location
    I'm in your browser now =)
  • WWW
    https://www.youtube.com/watch?v=SjwX-zMRxO0&t=5s
  • Interests
    Relax

Recent Profile Visitors

16,243 profile views

argumentum's Achievements

  1. ..marvel at my solution: Func _GUICtrlMenu_EzInsertMenuItem($hMenu, $iIndex, $sText, $iCmdID = 0, $hSubMenu = 0) Local $iIndexNumber = -1 If $iIndex = -2 Then $iIndexNumber = 0 $iIndex = $iIndexNumber EndIf If $iIndex = -1 Then $iIndexNumber += 1 $iIndex = $iIndexNumber EndIf Return _GUICtrlMenu_InsertMenuItem($hMenu, $iIndex, $sText, $iCmdID, $hSubMenu) EndFunc ..but, while coding, forgot to add the "EZ" part to it but worked all the same 🤔 So it happens that: The $iIndex is 0-based. Setting it to 0 puts the item at the very top of the menu, 1 puts it second, and so on. If you want to force it to the end of the menu regardless, you can pass -1. ( is an undocumented thing so, can't get a link to MSDN ) "Microsoft's official MSDN documentation for InsertMenuItemW doesn't explicitly advertise it, the underlying Windows kernel has allowed 0xFFFFFFFF (or -1 cast to a UINT) to act as an "append" command for InsertMenuItem for compatibility reasons." ( AI's answer that again, can't find a good link for )
  2. ..if you can load the fancy combo with each line having the font applied to it, we can use that and make out own GUI. Is an interface to choose a font and that's all that is. Go figure if in 27H2 they fix it 🤷‍♂️ So if this approach don't work out, look for a pleasing familiar ( visually GUI wise ) and go with that. Am sure one of those MVPs will snick it in the standard UDFs somehow 😇
  3. Am not gonna use it but you might #AutoIt3Wrapper_UseX64=y #AutoIt3Wrapper_Au3Check_Parameters=-q -d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 #include <ListViewConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <GuiListView.au3> #include <GUIDarkTheme.au3> ; https://www.autoitscript.com/forum/topic/213613-guidarktheme-udf/ #include <GuiCtrls_HiDpi.au3> ; https://www.autoitscript.com/forum/topic/210613-guictrls_hidpi-udf-in-progress/ _HiDpi_Ctrl_LazyInit() ;~ Global Const $WM_DEVICECHANGE = 0x0219 Global Const $DBT_DEVICEARRIVAL = 0x8000 Global Const $DBT_DEVICEREMOVECOMPLETE = 0x8004 ; A device or piece of media has been removed. ; https://learn.microsoft.com/en-us/windows/win32/devio/wm-devicechange Global Const $DBT_DEVTYP_DEVICEINTERFACE = 0x00000005 Global $g_hGUI, $g_idListView, $g_hDeviceNotify _GUI_Create() _Reg_DetailedDeviceNotifications() _ConsoleListviewWrite("- Ready.") While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit ; will automatically trigger the cleanup function EndSwitch WEnd Func WM_DEVICECHANGE_Handler($hWnd, $iMsg, $wParam, $lParam) _ConsoleListviewWrite('+ Func WM_DEVICECHANGE_Handler(' & $hWnd & ', ' & $iMsg & ', ' & $wParam & ', ' & $lParam & ')' & @CRLF) If $wParam = $DBT_DEVICEARRIVAL Or $wParam = $DBT_DEVICEREMOVECOMPLETE Then Local $tHeader = DllStructCreate("dword Size; dword DeviceType; dword Reserved", $lParam) If DllStructGetData($tHeader, "DeviceType") = $DBT_DEVTYP_DEVICEINTERFACE Then Local $iTotalSize = DllStructGetData($tHeader, "Size") Local $iStringLen = ($iTotalSize - 28) / 2 Local $tInterface = DllStructCreate("dword Size; dword DeviceType; dword Reserved; byte ClassGuid[16]; wchar Name[" & $iStringLen & "]", $lParam) Local $sDevicePath = DllStructGetData($tInterface, "Name") If StringInStr($sDevicePath, "MMDEVAPI") Then ; Extract the endpoint GUID block between the brackets: {d448e9f2-5211-490a-bef1-58b9f9cc4881} ; Match standard 8-4-4-4-12 hex pattern inside curly braces Local $aGuidMatch = StringRegExp($sDevicePath, "(?i)\{([[:xdigit:]]{8}-[[:xdigit:]]{4}-[[:xdigit:]]{4}-[[:xdigit:]]{4}-[[:xdigit:]]{12})\}", 3) If UBound($aGuidMatch) > 0 Then ; The audio endpoint subkey format uses the full curly braces Local $sEndpointGUID = "{" & $aGuidMatch[0] & "}" Local $sRoot = (@AutoItX64) ? "HKLM" : "HKLM64" Local $sParentKey = $sRoot & "\SOFTWARE\Microsoft\Windows\CurrentVersion\MMDevices\Audio\Render\" & $sEndpointGUID Local $sPropsKey = $sParentKey & "\Properties" ; Windows Audio Properties subkey for the endpoint ;~ Local $sFxPropsKey = $sParentKey & "\FxProperties" ; meh _ConsoleListviewWrite(" + $sPropsKey: " & $sPropsKey & @CRLF) ; PKEY_Device_FriendlyName (Native Windows Audio property key) Local $sFriendlyName = RegRead($sPropsKey, "{a45c254e-df1c-4efd-8020-67d146a850e0},2") ; PKEY_Device_EnumeratorName (tells us if it's SWD, USB, BTHENUM, etc.) ; didn't test much Local $sEnumerator = RegRead($sPropsKey, "{a45c254e-df1c-4efd-8020-67d146a850e0},24") _ConsoleListviewWrite(" + $sEnumerator: " & $sEnumerator & @CRLF) _ConsoleListviewWrite(" + $sFriendlyName: " & $sFriendlyName & @CRLF) ; SKIP BLANK ENTRIES ( race condition protection ? ) If $sFriendlyName = "" And $sEnumerator = "" Then Return $GUI_RUNDEFMSG Local $sEvent = ($wParam = $DBT_DEVICEARRIVAL) ? "Connected" : "Disconnected" ; Check if the underlying enumerator or description points to Bluetooth If StringInStr($sEnumerator, "BTH") Or StringInStr($sFriendlyName, "Bluetooth") Then _ConsoleListviewWrite("--> Bluetooth Audio " & $sEvent & ": " & $sFriendlyName & @CRLF) ; ========================================================================= ; YOUR CUSTOM CODE GOES HERE ; e.g., If $sEvent = "Connected" Then _DoSomething() ; I would use AdlibRegister(,1000) for the possible race condition ; ========================================================================= ; Read raw values Local $iRawFormFactor = RegRead($sPropsKey, "{a45c254e-df1c-4efd-8020-67d146a850e0},0") Local $iRawState = RegRead($sParentKey, "DeviceState") ; Translate to human readable becuse we are nice people Local $sFormFactorReadable = _GetAudioFormFactorName($iRawFormFactor) Local $sStateReadable = _GetAudioDeviceStateName($iRawState) _ConsoleListviewWrite(" + Hardware Profile: " & $sFormFactorReadable & @CRLF) _ConsoleListviewWrite(" + Current Status: " & $sStateReadable & @CRLF) EndIf EndIf EndIf EndIf EndIf Return $GUI_RUNDEFMSG EndFunc ;==>WM_DEVICECHANGE_Handler ; ========================================================================= ; Desc: Translates Windows EndpointFormFactor DWORD into readable text ; ========================================================================= Func _GetAudioFormFactorName($iFormFactor) Switch Int($iFormFactor) Case 0 Return "Remote Device" Case 1 Return "Speakers" Case 2 Return "Headphones" Case 3 Return "Earphones" Case 4 Return "Built-in Microphone Array" Case 5 Return "Headset (Microphone + Playback)" Case 6 Return "Handset" Case 7 Return "Digital Audio Interface (SPDIF/HDMI)" Case 8 Return "Line Level In/Out (Aux)" Case 9 Return "SPDIF Interface" Case 10 Return "HDMI Device" Case 11 Return "Unknown Form Factor" Case Else Return "Undefined (" & $iFormFactor & ")" EndSwitch EndFunc ;==>_GetAudioFormFactorName ; ========================================================================= ; Desc: Translates Windows MMDevice DEVICE_STATE_xxx constants ; ========================================================================= Func _GetAudioDeviceStateName($iState) Switch Int($iState) Case 1 ; DEVICE_STATE_ACTIVE Return "Active / Connected" Case 2 ; DEVICE_STATE_DISABLED Return "Disabled by User" Case 4 ; DEVICE_STATE_NOTPRESENT Return "Hardware Unplugged / Missing" Case 8 ; DEVICE_STATE_UNPLUGGED Return "Jack Unplugged" Case 26843546 ; Common combined state for certain disabled virtual profiles Return "Disabled (Unavailable)" Case Else Return "Unknown Status (" & $iState & ")" EndSwitch EndFunc ;==>_GetAudioDeviceStateName Func _ConsoleListviewWrite($sStr) Local $iBgColor, $sTime = @HOUR & ":" & @MIN & ":" & @SEC & "." & @MSEC $sStr &= (StringRight($sStr, 2) = @CRLF ? "" : @CRLF) ConsoleWrite($sStr) FileWriteLine(StringTrimRight(@ScriptFullPath, 4) & "_" & @YEAR & @MON & @MDAY & ".log", $sTime & " | " & $sStr) Switch StringLeft($sStr, 1) Case "+" ; Success -> Green-ish ;~ $iBgColor = 0xD4EDDA $iBgColor = 0x0F3D1A $sStr = StringTrimLeft($sStr, 1) ; Strip the "+" Case "!" ; Error -> Red-ish ;~ $iBgColor = 0xF8D7DA $iBgColor = 0x5C1D24 $sStr = StringTrimLeft($sStr, 1) ; Strip the "!" Case ">", "-" ; Warning/Info -> Yellow/Orange-ish ;~ $iBgColor = 0xFFF3CD $iBgColor = 0x5C4308 $sStr = StringTrimLeft($sStr, 1) ; Strip the symbol Case Else ;~ $iBgColor = 0x212529 $iBgColor = 0x121212 EndSwitch GUICtrlSetBkColor(GUICtrlCreateListViewItem($sTime & "|" & StringStripWS($sStr, 1), $g_idListView), $iBgColor) ; Auto-scroll to the bottom GUICtrlSendMsg($g_idListView, $LVM_ENSUREVISIBLE, GUICtrlSendMsg($g_idListView, $LVM_GETITEMCOUNT, 0, 0) - 1, 0) EndFunc ;==>_ConsoleListviewWrite Func _GUI_Create() Local $iFormW = 600, $iFormH = 400 $g_hGUI = _HiDPI_GUICreate("Bluetooth Monitor", $iFormW, $iFormH, -1, -1, BitOR($GUI_SS_DEFAULT_GUI, $WS_MAXIMIZEBOX, $WS_SIZEBOX, $WS_THICKFRAME, $WS_TABSTOP)) GUIRegisterMsg($WM_DEVICECHANGE, "WM_DEVICECHANGE_Handler") $g_idListView = _HiDPI_GUICtrlCreateListView("Time|Message", 0, 0, $iFormW, $iFormH, -1, BitOR($LVS_EX_FULLROWSELECT, $WS_VSCROLL)) GUICtrlSetResizing(-1, $GUI_DOCKLEFT + $GUI_DOCKRIGHT + $GUI_DOCKTOP + $GUI_DOCKBOTTOM) GUICtrlSendMsg($g_idListView, $LVM_SETCOLUMNWIDTH, 0, _HiDpi_CtrlAdjRatio(80)) GUICtrlSendMsg($g_idListView, $LVM_SETCOLUMNWIDTH, 1, @DesktopWidth) _GUIDarkTheme_ApplyDark($g_hGUI) GUISetState(@SW_SHOW) EndFunc ;==>_GUI_Create Func _Reg_DetailedDeviceNotifications() ; Convert the Bluetooth Device Class GUID into a binary structure. ; GUID for Bluetooth Devices: {0850302A-B344-4FDA-9BE9-90576B8D46F0} Local $sGUID = "{0850302A-B344-4FDA-9BE9-90576B8D46F0}" Local $tGUID = DllStructCreate("byte[16]") DllCall("ole32.dll", "hresult", "CLSIDFromString", "wstr", $sGUID, "struct*", $tGUID) ; Create the DEV_BROADCAST_DEVICEINTERFACE structure for the registration request. ; Note: We only need Name[1] here because we are just sending the header to Windows, not reading from it yet. Local $tDevInterface = DllStructCreate("dword Size; dword DeviceType; dword Reserved; byte ClassGuid[16]; wchar Name[1]") DllStructSetData($tDevInterface, "Size", DllStructGetSize($tDevInterface)) DllStructSetData($tDevInterface, "DeviceType", $DBT_DEVTYP_DEVICEINTERFACE) DllStructSetData($tDevInterface, "ClassGuid", DllStructGetData($tGUID, 1)) Local $aRet = DllCall("user32.dll", "ptr", "RegisterDeviceNotificationW", "hwnd", $g_hGUI, "struct*", $tDevInterface, "dword", 4) ; 0) ; ; 0x00000004 is DEVICE_NOTIFY_ALL_INTERFACE_CLASSES If @error Or Not IsArray($aRet) Or Not $aRet[0] Then MsgBox(16, "Error", "Failed to register for detailed device notifications.") Exit EndIf $g_hDeviceNotify = $aRet[0] OnAutoItExitRegister("_Cleanup_DeviceNotification") EndFunc ;==>_Reg_DetailedDeviceNotifications Func _Cleanup_DeviceNotification() ; Check if the handle exists before attempting to unregister it If IsDeclared("g_hDeviceNotify") And $g_hDeviceNotify Then _ConsoleListviewWrite("--> unregistering device notification hook" & @CRLF) DllCall("user32.dll", "bool", "UnregisterDeviceNotification", "ptr", $g_hDeviceNotify) $g_hDeviceNotify = 0 ; Clear the handle EndIf If IsHWnd($g_hGUI) Then If GUIDelete($g_hGUI) Then $g_hGUI = 0 EndIf EndFunc ;==>_Cleanup_DeviceNotification
  4. use that. Search the forum about AutoIt3Wrapper. Or SciTE comes with a help file too.
  5. #include <MsgBoxConstants> #include <Process.constants> ; --- CONFIGURATION --- Local $sSource = "C:\Path\To\Source" ; Change to actual source Local $sDest = "D:\Path\To\Destination" ; Change to actual destination Local $sLogFile = "C:\Path\To\backup_log.txt" ; Change to actual log path ; Recreating their exact Robocopy flags Local $sRobocopyArgs = StringFormat('"%s" "%s\\Backup_Archivio" /E /Z /XJ /R:3 /W:5 /COPY:DAT /TEE /V /X /LOG:"%s"', $sSource, $sDest, $sLogFile) ; --- EXECUTION --- ; Run Robocopy and wait for it to finish to capture the exact exit code Local $iExitCode = RunWait("robocopy " & $sRobocopyArgs, "", @SW_HIDE) ; --- LOG ANALYSIS --- Local $sLogContent = FileRead($sLogFile) Local $bHasErrorWord = StringInStr($sLogContent, "ERROR") Or StringInStr($sLogContent, "ERRORE") ; --- EVALUATE OUTCOME --- Local $sEsito = "" Local $iIcon = $MB_ICONINFORMATION ; Robocopy exit codes: 0-7 are successful variations. 8+ means issues. Select Case $iExitCode = 0 $sEsito = "OK: Niente da copiare (Nessuna modifica)" Case $iExitCode = 1 $sEsito = "OK: File copiati correttamente" Case $iExitCode = 2 $sEsito = "OK: Ci sono file extra nel backup" Case $iExitCode = 3 $sEsito = "OK: File e cartelle copiate" Case $iExitCode = 4 Or $iExitCode = 5 Or $iExitCode = 6 Or $iExitCode = 7 $sEsito = "OK: Backup completato (Mismatches/Modifiche rilevate)" Case $iExitCode = 8 $sEsito = "ATTENZIONE: Backup parziale, alcuni file sono stati saltati!" $iIcon = $MB_ICONWARNING Case $iExitCode >= 9 $sEsito = "ERRORE GRAVE: Backup fallito!" $iIcon = $MB_ICONERROR EndSelect ; Double-check if Robocopy code was okay but the log still contains error strings If $iExitCode < 8 And $bHasErrorWord Then $sEsito &= @CRLF & "(Nota: Trovate stringhe di ERRORE nel file log)" $iIcon = $MB_ICONWARNING EndIf ; --- UI NOTIFICATION --- ; Play a standard Windows notification sound instead of calling PowerShell SoundPlay(@WindowsDir & "\Media\Windows Background.wav", $SOUND_WAIT) ; Clean up their GIF if this is integrated into their existing GUI ; _GIF_DeleteGIF($hGIF) ; Show the final result MsgBox($iIcon, "FREDDIS backup", $sEsito & @CRLF & "Codice uscita Robocopy: " & $iExitCode & @CRLF & "Controlla il file log: " & $sLogFile) not tested but should help
  6. ..no, just one here and there. Not a heavy user. Ok, point taken
  7. ..why not rustdesk ? I dropped Teamviewer and am happy with Rustdesk. Give it a try 🤔
  8. ... Func _EnumWindowsProc($hWnd, $lParam) Local Static $WS_VISIBLE = 0x10000000, $WS_CHILD = 0x40000000, $iCount = 0, _ $GWL_EXSTYLE = -20, $GWL_STYLE = -16, $WS_EX_TOOLWINDOW = 0x00000080, _ $WS_EX_APPWINDOW = 0x00040000, $iFound = 0, $hTimer = TimerInit() $iCount += 1 Local $aRet = DllCall("user32.dll", "long", "GetWindowLongW", "hwnd", $hWnd, "int", $GWL_STYLE) If Not @error And Not BitAND($aRet[0], $WS_VISIBLE) Or BitAND($aRet[0], $WS_CHILD) Then Return 1 $aRet = DllCall("user32.dll", "long", "GetWindowLongW", "hwnd", $hWnd, "int", $GWL_EXSTYLE) If Not @error And BitAND($aRet[0], $WS_EX_TOOLWINDOW) And Not BitAND($aRet[0], $WS_EX_APPWINDOW) Then Return 1 Local $sTitle = _GetWindowTextW($hWnd) If $sTitle = "" Then Return 1 $iFound += 1 ConsoleWrite("- " & $iFound & " / " & $iCount & @TAB & TimerDiff($hTimer) & @TAB & " [Handle: " & $hWnd & "] [Title: " & $sTitle & "]" & @CRLF) $hTimer = TimerInit() Return 1 ; Return 1 to continue enumeration. EndFunc ;==>_EnumWindowsProc Func _GetWindowTextW($hWnd) Local Static $iStrLen = 512, $tBuffer = DllStructCreate("wchar[" & $iStrLen & "]") Local $aRet = DllCall("user32.dll", "int", "GetWindowTextW", _ "hwnd", $hWnd, "struct*", $tBuffer, "int", $iStrLen) If Not @error And $aRet[0] > 0 Then Return DllStructGetData($tBuffer, 1) Return "" EndFunc ;==>_GetWindowTextW ... - 31 / 416 0.2691 [Handle: 0x000205D8] [Title: *@@ (4186) $e_GT_Connect - Notepad] > +>04:10:56 AutoIt3 ended. rc:0 +>04:10:57 AutoIt3Wrapper Finished. >Exit code: 0 Time: 0.6310 ...this is faster Thanks for the code 👍
  9. ..ok, I will. Using dot notation works fine, unless it doesn't. So I took the one messing up and changed it to use DllStructGetData() `Func _WinAPI_GetWindowRectAsArray($hWnd)` fixed that. I haven't had the clock up problem after that change. If you still have problems, like always, give us a reproducer script, so we can share your pain
  10. ..also, reboot. So that you start with a clean setup ( PC resource wise )
  11. Do test the new version because that may very well be fixed on this new version.
  12. hmm, I knew about WM_DPICHANGED_* but not the history of it: ..so, you back and forth with the AI and is a better search engine than just memorizing MSDN. Is it AI slop ?, ..nope. I code the stuff correcting the AI "mis remembering" and "oops my bad" logic, but the AI is an excellent auto-complete if, you guide it like a 5 year old with excellent** memory and no common sense ** it does not remember where what why ( because of it's training is it's default ) but it gets you closer.
  13. that instead of this "idea" using WM_DPICHANGED, I'd use something like: ... ; Global message constants Global Const $WM_DPICHANGED_BEFOREPARENT = 0x02E2 Global Const $WM_DPICHANGED_AFTERPARENT = 0x02E3 ; inside your control creation function, subclass the control handle: _WinAPI_SetWindowSubclass(GUICtrlGetHandle($idLabel1), "_MyControlSubclassProc", 1) Func _MyControlSubclassProc($hWndChild, $iMsg, $wParam, $lParam, $uIdSubclass, $dwRefData) Switch $iMsg Case $WM_DPICHANGED_BEFOREPARENT ; 🛠️ PRE-SCALE PHASE: ; Perfect place to read your parent's CURRENT workspace metrics, ; cache old scale dimensions, or prepare graphics buffers before layout warp. Return 0 Case $WM_DPICHANGED_AFTERPARENT ; 📐 POST-SCALE PHASE: ; The parent window has already finished resizing! ; You can now safely query the parent's NEW live DPI via _WinAPI_GetDpiForWindow($hParent), ; read your attached baseline properties (SetPropW), and scale yourself instantly. Local $hParent = _WinAPI_GetParent($hWndChild) Local $iDPI = _WinAPI_GetDpiForWindow($hParent) Local $fScale = $iDPI / 96 ; Pull your clean 100% baseline properties Local $iBaseX = DllCall("user32.dll", "int", "GetPropW", "hwnd", $hWndChild, "wstr", "DpiBaseX")[0] ; ... Do the Round($iBaseX * $fScale) and call SetWindowPos here... Return 0 EndSwitch Return _WinAPI_DefSubclassProc($hWndChild, $iMsg, $wParam, $lParam) EndFunc ... ...and I could really use that GUICtrlGetResizing()
  14. ..we could use GUICtrlGetResizing( $idCtrl / $hWnd ). Back in trac #1709 the reason was ... I didn't get it either but also didn't get the why not. In my case: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <WinAPISys.au3> Global $hGUI = GUICreate("Control Monitor", 400, 200) Global $hDynamicCtrl = 0 GUIRegisterMsg($WM_PARENTNOTIFY, "WM_PARENTNOTIFY") GUISetState(@SW_SHOW) Global $hCreateBtn = GUICtrlCreateButton("Create Control", 20, 20, 100, 30) Global $hDeleteBtn = GUICtrlCreateButton("Delete Control", 130, 20, 100, 30) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $hCreateBtn If $hDynamicCtrl = 0 Then $hDynamicCtrl = GUICtrlCreateLabel("I am new !", 20, 80, 200, 20) GUICtrlSetResizing($hDynamicCtrl, $GUI_DOCKLEFT + $GUI_DOCKTOP + $GUI_DOCKHEIGHT) ConsoleWrite('>' & ($GUI_DOCKLEFT + $GUI_DOCKTOP + $GUI_DOCKHEIGHT) & @CRLF) EndIf Case $hDeleteBtn If $hDynamicCtrl <> 0 Then GUICtrlDelete($hDynamicCtrl) $hDynamicCtrl = 0 EndIf EndSwitch WEnd ; #FUNCTION# ==================================================================================================================== ; Name...........: WM_PARENTNOTIFY ; Description....: Handles the WM_PARENTNOTIFY message sent to the parent window when a child window/control is created or destroyed. ; Syntax.........: WM_PARENTNOTIFY($hWnd, $iMsg, $wParam, $lParam) ; Parameters ....: $hWnd - Handle to the window receiving the message (the parent GUI). ; $iMsg - The message identifier (0x0210). ; $wParam - Low-word specifies the event (e.g., WM_CREATE, WM_DESTROY). High-word specifies the child identifier. ; $lParam - Handle to the child window (HWND). ; Remarks .......: By default, a parent window does not receive this message unless the child window lacks the WS_EX_NOPARENTNOTIFY style. ; Link ..........: https://learn.microsoft.com/en-us/windows/win32/winmsg/wm-parentnotify ; =============================================================================================================================== Func WM_PARENTNOTIFY($hWnd, $iMsg, $wParam, $lParam) ; For WM_CREATE & WM_DESTROY: $lParam contains the Handle (HWND) of the child window. Local $iEvent = BitAND($wParam, 0xFFFF) ; Low-word: The event Local $hChildWnd = $lParam ; lParam: Child HWND Switch $iEvent Case 1 ; WM_CREATE ConsoleWrite("--> CONTROL CREATED! Handle: " & $hChildWnd & " | ResizeStyle: " & GUICtrlGetResizing($hChildWnd) & " | Class: " & _WinAPI_GetClassName($hChildWnd) & @CRLF) Case 2 ; WM_DESTROY ConsoleWrite("--> CONTROL DESTROYED! Handle: " & $hChildWnd & " | ResizeStyle: " & GUICtrlGetResizing($hChildWnd) & " | Class: " & _WinAPI_GetClassName($hChildWnd) & @CRLF) EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_PARENTNOTIFY ; requested function Func GUICtrlGetResizing($hWnd) Return 546 ; becuse "$GUI_DOCKLEFT + $GUI_DOCKTOP + $GUI_DOCKHEIGHT" EndFunc I want to make the High DPI UDF magical ( as much as possible ) and I could register the WM_PARENTNOTIFY and resize and re-anchor controls auto-magically catching this message if there is a GUICtrlGetResizing(). AutoIt3 keeps that info internally. Should be easy to give return it. @jpm @Jon Reopen the old trac ?, make a new one ?
×
×
  • Create New...