制作显示自己图标的MessageBox

I

import

Unregistered / Unconfirmed
GUEST, unregistred user!
制作显示自己图标的MessageBox
//这个Tip是我从中国计算机报DelphiTips得到的,很有意思,于是便保存了下来。
function MessageBoxLg(Handle:integer;Text,Caption:String;flag:integer):integer;
var
Msg:TMsgBoxParams;
begin
Msg.cbSize:=Sizeof(Msg);
Msg.hwndOwner:=Handle;
Msg.hInstance:=hinstance;
Msg.lpszText:=PChar(Text);
Msg.lpszCaption:=PChar(Caption);
Msg.dwStyle:=flag+MB_USERICON;
Msg.lpszIcon:='MAINICON';
Msg.dwContextHelpId:=1;
Msg.lpfnMsgBoxCallback:=nil;
Msg.dwLanguageId:=LANG_NEUTRAL;
Result:=integer(MessageBoxIndirect(Msg));
end;
 
顶部