![]() I am not inclined to do this by default due to complexity, and doubts about how it will affect any other version of Windows, including future versions. ![]() If !DllCall("RectVisible", "ptr", hdc, "ptr", rect)ĭllCall("FillRect", "ptr", hdc, "ptr", rect, "ptr", hbrush) Exclude the control from default handling of WM_ERASEBKGND. Static hbrush := DllCall("GetSysColorBrush", "int", 5, "ptr")ĭllCall("FillRect", "ptr", hdc, "ptr", &rect, "ptr", hbrush) Fill control background with COLOR_WINDOW (seems to match the Edit). If !DllCall("RectVisible", "ptr", hdc, "ptr", &rect)Ĭontinue Control is not inside clipping region. Shrink inward by 1 pixel to avoid white dots in corners.ĭllCall("InflateRect", "ptr", &rect, "int", -1, "int", -1) Get control rectangle in client coordinates.ĭllCall("GetWindowRect", "ptr", hctrl, "ptr", &rect)ĭllCall("MapWindowPoints", "ptr", 0, "ptr", hgui, "ptr", &rect, "int", 2) If !DllCall("uxtheme\GetWindowTheme", "ptr", hctrl) GuiControlGet hctrl, Hwnd, ComboBox%A_Index% The following workaround can be used to prevent the black background from showing behind the control, instead painting it some other colour:Ĭode: Select all #Requires AutoHotkey v1.1 On all previous versions of Windows, the ComboBox paints its own background and ignores the window's background. WM_ERASEBKGND is also the means by which the window's background is customized. ![]() The transparency effect is achieved by a WM_ERASEBKGND message being sent to the parent window to erase the region occupied by the control before it repaints its content. I didn't find other occurrences of this exact issue, but I found a couple of other ComboBox rendering issues caused by Windows 11 (also seemingly related to painting - or not painting - the background):ĬomboBox ghost after Windows 11 upgrade - Microsoft Tech CommunityĬomboBoxGadgets do not render correctly on Windows 11 when a window background color is set - PureBasic Forums - English After investigation, I still consider this a Windows 11 bug, or a break in compatibility, which amounts to the same thing.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |