📄 winapis.pas
字号:
unit WinAPIs;
interface
uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;
type
// left unchanged ==> public declare function getdevicecaps lib 'gdi32' _;//----------------------------------------------------------
(byval hdc as long, byval nindex as long) as long
// left unchanged ==> public declare function getwindowsdirectory lib 'kernel32' _;
alias 'getwindowsdirectorya' (byval lpbuffer as string, _
byval nsize as long) as long
// left unchanged ==> public declare function winexec lib 'kernel32' _;
(byval lpcmdline as string, byval ncmdshow as long) as long
// left unchanged ==> public const reg_sz as long = 1;//----------------------------------------------------------
// left unchanged ==> public const reg_binary as long = 3;
// left unchanged ==> public const reg_dword as long = 4;
function getwindowsdir(withslash : boolean):string;
begin
lngresult : longint;
lpbuffer$:variant;
strgetwin : string;
lpbuffer := space$(2048);//----------------------------------------------------------
lngresult := getwindowsdirectory(lpbuffer, len(lpbuffer));//----------------------------------------------------------
strgetwin := lcase$(left$(lpbuffer, lngresult));
if right$(strgetwin, 1) <> '\' and withslash then
begin
getwindowsdir := strgetwin + '\';//----------------------------------------------------------
elseif right$(strgetwin, 1) = '\' and not withslash then
getwindowsdir := left$(strgetwin, len(strgetwin) - 1);
else
getwindowsdir := strgetwin;
end; //Main if block
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -