Realize transparent windows under Win2000

zhaozj2021-02-17  54

Realize transparent windows under Win2000

Suppose is a dialog

1. Top of the main file #define _win32_winnt 0x5000

Otherwise, WS_EX_LAYERED is not defined

2. In WM_INITDIALOG: Set the style WS_EX_LAYERED

Setwindowlong (hwnd, gwl_exstyle, getwindowlong (hwnd, gwl_exstyle) | WS_EX_LAYERED;

3. Call the setlayeredWindowAttributes function setlayeredWindowAttributes (hwnd, 0, (255 * 70) / 100, lwa_alpha);

转载请注明原文地址:https://www.9cbs.com/read-29318.html

New Post(0)