Modify ↓
Opened on Mar 11, 2026 at 3:46:46 PM
Closed on Mar 14, 2026 at 7:37:07 AM
Last modified on Mar 17, 2026 at 1:47:39 PM
#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 )
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 | |
|---|---|
| 1 | Func _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 |
| 26 | EndFunc ;==>_WinAPI_DwmGetWindowAttribute |
I attached an exemple
Attachments (1)
Change History (4)
by , on Mar 11, 2026 at 3:47:02 PM
| Attachment: | Nouveau AutoIt v3 Script.au3 added |
|---|
comment:1 by , on Mar 11, 2026 at 9:38:04 PM
| Description: | modified (diff) |
|---|
comment:2 by , on Mar 14, 2026 at 7:37:07 AM
| Resolution: | → Fixed |
|---|---|
| Status: | new → closed |
Note:
See TracTickets
for help on using tickets.

Fixed for next beta