Modify

#4078 new Feature Request

Upgrading _WinAPI_DwmGetWindowAttribute

Reported by: TommyDDR Owned by:
Milestone: Component: Standard UDFs
Version: 3.3.18.0 Severity: None
Keywords: Cc:

Description

I recently needed to retrieve window border and color but values are not admitted in _WinAPI_DwmGetWindowAttribute, even if msdn say "Use with DwmSetWindowAttribute" for DWMWA_WINDOW_CORNER_PREFERENCE, it also can be readed with get so i added it.
(i tried with DWMWA_BORDER_COLOR without success)
I saw _WinAPI_DwmSetWindowAttribute was updated in 3.3.18.0, so i put this feature request

There is the new function :

Func _WinAPI_DwmGetWindowAttribute($hWnd, $iAttribute)
	Local $tagStruct
	Switch $iAttribute
		Case 33
			$tagStruct = 'dword'
		Case 5, 9
			$tagStruct = $tagRECT
		Case 1, 14
			$tagStruct = 'uint'
		Case Else
			Return SetError(1, 0, 0)
	EndSwitch

	Local $tData = DllStructCreate($tagStruct)
	Local $aCall = DllCall('dwmapi.dll', 'long', 'DwmGetWindowAttribute', 'hwnd', $hWnd, 'dword', $iAttribute, _
			'struct*', $tData, 'dword', DllStructGetSize($tData))
	If @error Then Return SetError(@error + 10, @extended, 0)
	If $aCall[0] Then Return SetError(10, $aCall[0], 0)

	Switch $iAttribute
		Case 1, 14, 33
			Return DllStructGetData($tData, 1)
		Case Else
			Return $tData
	EndSwitch
EndFunc   ;==>_WinAPI_DwmGetWindowAttribute

I attached an exemple

Attachments (1)

Nouveau AutoIt v3 Script.au3 (2.0 KB ) - added by TommyDDR on Mar 11, 2026 at 3:47:02 PM.

Download all attachments as: .zip

Change History (1)

Modify Ticket

Action
as new The ticket will remain with no owner.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.