设置窗口透明
1.设置窗口透明
//Set WS_EX_LAYERED on this window
::SetWindowLong(GetSafeHwnd(),GWL_EXSTYLE,::GetWindowLongPtr(GetSafeHwnd(),GWL_EXSTYLE)|WS_EX_LAYERED);
//Make this window 70% alpha transparent
this->SetLayeredWindowAttributes(0,(255*70)/100,LWA_ALPHA);
2.去除窗口透明
//Remove WS_EX_LAYERED from window style
::SetWindowLong(GetSafeHwnd(),GWL_EXSTYLE,::GetWindowLongPtr(GetSafeHwnd(),GWL_EXSTYLE)&~WS_EX_LAYERED);
//Repaint
this->RedrawWindow();