实现对话框透明显示

 1 view plaincopy

 2 LONG SetWindowLong(   

 3   HWND hWnd,   

 4   int nIndex,   

 5   LONG dwNewLong  

 6 );   

 7 

 8 view plaincopy

 9 BOOL SetLayeredWindowAttributes(          HWND hwnd,  

10     COLORREF crKey,  

11     BYTE bAlpha,  

12     DWORD dwFlags  

13 );  

14 

15 view plaincopy

16 // Set WS_EX_LAYERED on this window   

17 SetWindowLong(GetSafeHwnd(),   

18               GWL_EXSTYLE,   

19               GetWindowLong(GetSafeHwnd(), GWL_EXSTYLE) | WS_EX_LAYERED);  

20   

21 // Make this window 70% alpha  

22 SetLayeredWindowAttributes(GetSafeHwnd(), 0, (255 * 70) / 100, LWA_ALPHA); 

这样就可以实现窗体透明显示了。。

你可能感兴趣的:(对话框)