📄 win2k.pas
字号:
unit Win2k;
interface
uses
Windows;
const
WS_EX_LAYERED = $00080000;
LWA_ALPHA = $00000002;
type
FAnimateWindow = function(const hwnd: HWND; const dwTime: DWORD; const dwFlags: DWORD):DWORD; stdcall;
FSetLayeredWindowAttributes = function(hWnd: HWND; crKey: DWORD; bAlpha: Byte; dwFlags: DWORD): BOOL; stdcall;
function AnimateWindow(const hwnd: HWND; const dwTime: DWORD; const dwFlags: DWORD):DWORD;
function SetLayeredWindowAttributes(hwnd: HWND; crKey: DWORD; bAlpha: Byte; dwFlags: DWord): BOOL;
implementation
function AnimateWindow(const hwnd: HWND; const dwTime: DWORD; const dwFlags: DWORD):DWORD;
var
DLLHandle : THandle;
AnimateWindow : FAnimateWindow;
begin
Result := 0;
DLLHandle := LoadLibrary('user32.dll');
if DLLHandle <> 0 then begin
@AnimateWindow := GetProcAddress(DLLHandle,'AnimateWindow');
if @AnimateWindow <> nil then begin
Result := AnimateWindow(hwnd,dwTime,dwFlags);
end;
end;
end;
function SetLayeredWindowAttributes(hwnd: HWND; crKey: DWORD; bAlpha: Byte; dwFlags: DWORD): BOOL;
var
DLLHandle : THandle;
gwlStyle : Longint;
SetLayeredWindowAttributes : FSetLayeredWindowAttributes;
begin
Result := false;
DLLHandle := LoadLibrary('user32.dll');
if DLLHandle <> 0 then begin
@SetLayeredWindowAttributes := GetProcAddress(DLLHandle,'SetLayeredWindowAttributes');
if @SetLayeredWindowAttributes <> nil then begin
gwlStyle := GetWindowLong(hwnd,GWL_EXSTYLE);
gwlStyle := gwlStyle or WS_EX_LAYERED;
SetWindowLong(hwnd,GWL_EXSTYLE,gwlStyle);
Result := SetLayeredWindowAttributes(hWnd,crKey,bAlpha,dwFlags);
end;
end;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -