ウィンドウを半透明にするには、SetLayeredWindowAttributes()を使用する。 GetWindowLong()で現在のウィンドウの属性を取得しGetWindowLong()でWS_EX_LAYERED属性を追加してからSetLayeredWindowAttributes()で半透明にする。 以下のサンプルではSetLayeredWindowAttributes()の第2引数に指定した透過率でウィンドウを半透明にしている。 LONG exStyle = GetWindowLong( this->GetSafeHwnd(), GWL_EXSTYLE ); SetWindowLong(this->GetSafeHwnd(), GWL_EXSTYLE, exStyle | WS_EX_LAYERED); this->SetLayeredWindowAttributes(RGB(
![[VC++] ウィンドウの透明・半透明化](https://cdn-ak-scissors.b.st-hatena.com/image/square/126e9c63960837b5815901e11e1f6c1303c17f2b/height=288;version=1;width=512/https%3A%2F%2Fblog.seesaa.jp%2Fimg%2Fogp_logo.png)