2010-12-28 51 views

答えて

9

SetLayeredWindowsAttributes例:

import win32gui 
import win32con 
import winxpgui 
import win32api 
import subprocess 
import time 

subprocess.Popen("notepad.exe", shell=True) 
time.sleep(1) 
hwnd = win32gui.FindWindow(None, "New file - metapad") ## The caption of my empty notepad (MetaPad) 

win32gui.SetWindowLong (hwnd, win32con.GWL_EXSTYLE, win32gui.GetWindowLong (hwnd, win32con.GWL_EXSTYLE) | win32con.WS_EX_LAYERED) 
winxpgui.SetLayeredWindowAttributes(hwnd, win32api.RGB(0,0,0), 180, win32con.LWA_ALPHA) 
3

あなたは透明ウィンドウを作成するためのSetLayeredWindowAttributesWIN32 API関数を使用することができます。

BOOL WINAPI SetLayeredWindowAttributes(
    __in HWND hwnd, 
    __in COLORREF crKey, 
    __in BYTE bAlpha, 
    __in DWORD dwFlags 
); 

Hereあなたは透明度を設定するためのWin32 API関数をラップするために使用できるコードサンプルです。

関連する問題