[Bug 50495] New: the WS_EX_LAYERED set SetWindowLong GWL_EXSTYLE , Window show white rather than transparency.
https://bugs.winehq.org/show_bug.cgi?id=50495 Bug ID: 50495 Summary: the WS_EX_LAYERED set SetWindowLong GWL_EXSTYLE , Window show white rather than transparency. Product: WineHQ Bugzilla Version: unspecified Hardware: x86 OS: Linux Status: UNCONFIRMED Severity: major Priority: P2 Component: bugzilla-unknown Assignee: wine-bugs(a)winehq.org Reporter: 490165508(a)qq.com CC: austinenglish(a)gmail.com Distribution: --- Created attachment 69150 --> https://bugs.winehq.org/attachment.cgi?id=69150 This program will create a transparent full screen window. When I use the following code to create a transparent full screen window. ``` HWND hWnd; hWnd = CreateWindowEx(WS_EX_APPWINDOW, "WindowClass", "Demo", WS_VISIBLE| WS_MAXIMIZE, CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, hInstance, NULL); SetWindowLong(hWnd, GWL_STYLE, GetWindowLong(hWnd, GWL_STYLE) & (~WS_DLGFRAME)); RECT rect; GetWindowRect(hWnd, &rect); SetWindowPos(hWnd, HWND_TOPMOST, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, SWP_DRAWFRAME); LONG ret = GetWindowLong(hWnd, GWL_EXSTYLE); ret = ret | WS_EX_LAYERED; SetWindowLong(hWnd, GWL_EXSTYLE, ret); ShowWindow(hWnd, SW_SHOWMAXIMIZED); UpdateWindow(hWnd); ``` In Windows this program display window is a full screen transparent window,But running this little program with Wine on Linux displays a full-screen white window. This problem occurred. I tried to modify the SetWindowLong API function implementation, but it didn't change much. I hope the bosses can help me. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=50495 Gijs Vermeulen <gijsvrm(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Component|bugzilla-unknown |-unknown CC|austinenglish(a)gmail.com | Severity|major |normal Product|WineHQ Bugzilla |Wine -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=50495 --- Comment #1 from Bruni <earns.61(a)gmail.com> --- Hello, Try replace the line
SetWindowLong(hWnd, GWL_STYLE, GetWindowLong(hWnd, GWL_STYLE) & (~WS_DLGFRAME)); with the following two lines:
SetWindowLongPtr(hWnd, GWL_EXSTYLE, GetWindowLongPtr(hWnd, GWL_EXSTYLE) | WS_EX_LAYERED | WS_EX_TRANSPARENT); SetLayeredWindowAttributes(hWnd, 0, (byte)(255 * 0.7), LWA_ALPHA); --------------- and say what happens. Thanks. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=50495 --- Comment #2 from Bruni <earns.61(a)gmail.com> --- ... You have to comment out the lines --------------- RECT rect; GetWindowRect(hWnd, &rect); SetWindowPos(hWnd, HWND_TOPMOST, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, SWP_DRAWFRAME); LONG ret = GetWindowLong(hWnd, GWL_EXSTYLE); ret = ret | WS_EX_LAYERED; SetWindowLong(hWnd, GWL_EXSTYLE, ret); ShowWindow(hWnd, SW_SHOWMAXIMIZED); UpdateWindow(hWnd); ------------- as well. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
participants (1)
-
WineHQ Bugzilla