Modify

#4078 closed Feature Request (Fixed)

Upgrading _WinAPI_DwmGetWindowAttribute

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

Description (last modified by mLipok)

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 :

Line 
1Func _WinAPI_DwmGetWindowAttribute($hWnd, $iAttribute)
2 Local $tagStruct
3 Switch $iAttribute
4 Case 33
5 $tagStruct = 'dword'
6 Case 5, 9
7 $tagStruct = $tagRECT
8 Case 1, 14
9 $tagStruct = 'uint'
10 Case Else
11 Return SetError(1, 0, 0)
12 EndSwitch
13
14 Local $tData = DllStructCreate($tagStruct)
15 Local $aCall = DllCall('dwmapi.dll', 'long', 'DwmGetWindowAttribute', 'hwnd', $hWnd, 'dword', $iAttribute, _
16 'struct*', $tData, 'dword', DllStructGetSize($tData))
17 If @error Then Return SetError(@error + 10, @extended, 0)
18 If $aCall[0] Then Return SetError(10, $aCall[0], 0)
19
20 Switch $iAttribute
21 Case 1, 14, 33
22 Return DllStructGetData($tData, 1)
23 Case Else
24 Return $tData
25 EndSwitch
26EndFunc ;==>_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 (4)

comment:1 by mLipok, on Mar 11, 2026 at 9:38:04 PM

Description: modified (diff)

comment:2 by Jpm, on Mar 14, 2026 at 7:37:07 AM

Resolution: Fixed
Status: newclosed

Fixed for next beta

comment:3 by TicketCleanup, on Mar 17, 2026 at 1:47:39 PM

Version: 3.3.18.0

Automatic ticket cleanup.

Modify Ticket

Action
as closed 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.