procedure TForm1.Button1Click(Sender: TObject);
var
shellapp: variant;
begin
ShellAboutW(0,’Timer v1.03’,’kedy版权所有’,1);
end;
其他步骤我不详述。运行后点击button就会弹出标准的WINDOWS关于对话框。对话框标题为"关于Timer v 1.03"。大家可 以看到,在程序中我使用了ShellAboutW这个函数。在MSDN2003中这个函数 是这样描述的:
ShellAbout Function
Displays a ShellAbout dialog box.
Syntax
int ShellAbout( HWND hWnd,
LPCTSTR szApp,
LPCTSTR szOtherStuff,
HICON hIcon
);
Parameters
hWnd
[in] Window handle to a parent window. This parameter can be NULL.
szApp
[in] Pointer to a null-terminated string containing text that will be displayed in the
title bar of the ShellAbout dialog box and on the first line of the dialog box after the
text "Microsoft". If the text contains a separator (#) dividing it into two parts, the
function displays the first part in the title bar and the second part on the first line
after the text "Microsoft".
szOtherStuff
[in] Pointer to a null-terminated string containing text that will be displayed in the
dialog box after the version and copyright information.
hIcon
[in] Icon that the function displays in the dialog box. If this parameter is NULL, the
function displays the Microsoft® Windows® or Microsoft Windows NT® icon.
什么意思我想不用我来翻译了吧,这些东西自己去看最好。
二、调用关机对话框
我们只要把begin部分代码改为
begin
shellapp := CreateOleObject(’Shell.Application’);
shellapp.ShutDownWindows;
end;