呵呵,教你一次,不过,我也保留版权 ,如果你要学习,请牢牢记住: www.delphibbs.com 。
____________________________________
资源文件 MainRes.rc
MAINAPP DIALOG 0, 0, 222, 127
STYLE DS_ABSALIGN | DS_SETFONT | DS_3DLOOK | WS_MINIMIZEBOX | WS_POPUP |
WS_CAPTION | WS_SYSMENU
FONT 9, "宋体"
BEGIN
LTEXT "教你一招",-1,89,17,42,8
PUSHBUTTON "按钮",10001,27,99,41,19
PUSHBUTTON "按钮",10002,90,99,41,19
PUSHBUTTON "退出",10003,153,99,41,19
END
____________________________________
项目文件 Project1.dpr
program Project1;
uses
Windows,Messages;
{$R MainRes.res}
procedure AppArrange(Wnd:HWnd);
begin
// ......
end;
function CallBackProc(DlgWnd:HWnd; CallMessage:UINT;
DlgWParam: WPARAM; DlgLParam: LPARAM): BOOL; stdcall;
begin
Result:=True;
case CallMessage of
WM_INITDIALOG:AppArrange(DlgWnd);
WM_Close
ostQuitMessage(0);
end;
end;
begin
DialogBoxParam(hInstance, 'MAINFORM', 0, @CallBackProc,0);
end.