📄 unitmain.pas
字号:
unit UnitMain;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls,ActiveX,UnitRPC;
type
TForm1 = class(TForm)
Label1: TLabel;
Label2: TLabel;
Edit1: TEdit;
Edit2: TEdit;
btnGet: TButton;
procedure btnGetClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.btnGetClick(Sender: TObject);
var
UUID:TUUID;
WCLID: array[0..127] of WideChar;
Start:Integer;
Re:Integer;
begin
//UuidCreate Rpcrt4.dll
//The textual representation of a UUID is a string
//consisting of eight hexadecimal digits followed
//by a hyphen, followed by three hyphen-separated
//groups of four hexadecimal digits, followed by a
//hyphen, followed by twelve hexadecimal digits.
//The following example is a valid UUID string:
// look win32sdk.hlp: The uuidgen Utility
// ['{EE21F631-282F-11D5-8D47-5254AB34C3EF}']
re:=UuidCreate(@UUID);
case Re of
RPC_S_OK : begin
StringFromGuid2(TGUID(UUID),WCLID,SizeOf(WCLID) div 2);
Edit1.Text:=WideCharToString(WCLID);
Start:=Length(Edit1.Text)-12;
Edit2.Text:=Copy(Edit1.Text,Start,12);
end;
else
Edit1.Text:='Failed to get UUID';
end;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -