컨트롤 알파값 적용하기
void SetTransparent(HWND wnd, int percent)
{
SLWA pSetLayeredWindowAttributes = NULL;
HINSTANCE hmodUSER32 = LoadLibrary("USER32.DLL");
pSetLayeredWindowAttributes = (SLWA)GetProcAddress(hmodUSER32,"SetLayeredWindowAttributes");
HWND hwnd = wnd;
SetWindowLong(hwnd,GWL_EXSTYLE,GetWindowLong(hwnd,GWL_EXSTYLE) | WS_EX_LAYERED);
//ModifyStyleEx(0, WS_EX_LAYERED); 앞이랑 같은말
// ModifyStyleEx(0, WS_EX_TRANSPARENT | WS_EX_LAYERED); 창 통과해서 클릭가능
pSetLayeredWindowAttributes(hwnd, 0, (255*percent/100), LWA_ALPHA);
}
핸들이랑 주고싶은 알파값 전달하면 될듯



덧글