📄 my_api_for_systemini.pas
字号:
// Author:Youzhen
// Date: 2000/08/09
// Version: 1.0
//
// This Is A Dll File For Config ScreenSave
//
// Don't Use TString In Dll File !
// Use shortstring Instead of TString !
//
// Topic Function:
// GetProvideProfileString
// WriteProvideProfileString
// GetMem
// StrPCopy
// FreeMem
//
//************************************************//
unit My_API_for_Systemini;
interface
uses
Windows, SysUtils;
procedure My_GetPrivateProfileString(
My_lpAppName,
My_lpKeyName,
My_lpDefault:shortstring;
var My_lpReturnedString:shortstring;
My_nSize:dword;
My_lpFileName:shortstring);
procedure My_WritePrivateProfileString(
My_lpAppName,
My_lpKeyName,
My_String,
My_lpFileName:shortstring);
implementation
procedure My_GetPrivateProfileString(
My_lpAppName,
My_lpKeyName,
My_lpDefault:shortstring;
var My_lpReturnedString:shortstring;
My_nSize:dword;
My_lpFileName:shortstring);
var lpAppName, // points to section name
lpKeyName, // points to key name
lpDefault, // points to default string
lpReturnedString:pchar; // points to destination buffer
nSize:dword; // size of destination buffer
lpFileName:pchar;
begin
GetMem(lpAppName,100);
GetMem(lpKeyName,100);
GetMem(lpDefault,100);
GetMem(lpReturnedString,100);
GetMem(lpFileName,100);
StrPCopy(lpAppName,My_lpAppName);
StrPCopy(lpKeyName,My_lpKeyName);
StrPCopy(lpDefault,My_lpDefault);
StrPCopy(lpFileName,My_lpFileName);
nSize:=My_nSize;
//%%%即先为返回字符串指定足够的空间%%%
GetPrivateProfileString(
lpAppName,lpKeyName,lpDefault,lpReturnedString,
nSize,lpFileName);
My_lpReturnedString:=StrPas(lpReturnedString);
FreeMem(lpAppName,100);
FreeMem(lpKeyName,100);
FreeMem(lpDefault,100);
FreeMem(lpReturnedString,100);
FreeMem(lpFileName,100);
end;
procedure My_WritePrivateProfileString(
My_lpAppName,
My_lpKeyName,
My_String,
My_lpFileName:shortstring);
var lpAppName, // pointer to section name
lpKeyName, // pointer to key name
lpString, // pointer to string to add
lpFileName:PChar; // pointer to initialization filename
begin
GetMem(lpAppName,100);
GetMem(lpKeyName,100);
GetMem(lpString,100);
GetMem(lpFileName,100);
StrPCopy(lpAppName,My_lpAppName);
StrPCopy(lpKeyName,My_lpKeyName);
StrPCopy(lpString,My_String);
StrPCopy(lpFileName,My_lpFileName);
WritePrivateProfileString(
lpAppName,lpKeyName,lpString,lpFileName);
FreeMem(lpAppName,100);
FreeMem(lpKeyName,100);
FreeMem(lpString,100);
FreeMem(lpFileName,100);
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -