掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
ウィンドウを透過する (ID:32285)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
簡潔にまとめてみました。 type TSetLayeredWindowAttributes = function(hWnd : HWND; crKey : DWORD; bAlpha : Byte; dwFlags : DWORD) : BOOL; stdcall; function SetLayeredWindowAttributes(hWindow: HWND; crKey: DWORD; bAlpha: Byte; dwFlags: DWORD): BOOL; stdcall; external user32 name 'SetLayeredWindowAttributes'; procedure TForm1.Button1Click(Sender: TObject); var SLWA: TSetLayeredWindowAttributes; hUser32: HINST; H: HWnd; ibAlpha: Byte; const WS_EX_LAYERED = $80000; begin ibAlpha := random(256); //透明度 H := FindWindow(nil,'無題 - メモ帳'); if H <> 0 then begin hUser32 := LoadLibrary('user32.dll'); if hUser32 <> 0 then begin SetWindowLong(H, GWL_EXSTYLE, GetWindowLong(H, GWL_EXSTYLE) or WS_EX_LAYERED); try SLWA := GetProcAddress(hUser32, 'SetLayeredWindowAttributes'); if Assigned(@SetLayeredWindowAttributes) then SLWA(H, 0, ibAlpha, 2); finally FreeLibrary(hUser32); end; end; end; end;
←解決時は質問者本人がここをチェックしてください。
戻る
掲示板システム
Copyright 2021 Takeshi Okamoto All Rights Reserved.