JohnCMolyneux
Programmer
Hi.
I've got the following code from the internet (seen it in lots of different places - always the same code with same variable names and code formatting etc..)
function MyMessageBox(lpCaption, lpText: PChar): Integer;
var
MBParams : TMsgBoxParams;
begin
with MBParams do begin
cbSize:=SizeOf(MBParams);
hwndOwner:=Application.Handle;
hInstance:=SysInit.HInstance;
lpszText:=lpText;
lpszCaption:=lpCaption;
lpszIcon:=PChar('MAINICON');
dwStyle:=MB_OK or MB_USERICON;
dwContextHelpId:=0;
lpfnMsgBoxCallback:=nil;
dwLanguageId:=LANG_NEUTRAL;
end;
Result:=Integer(MessageBoxIndirect(MBParams));
end;
Basically, if I run MyMessageDlg('Caption','Message dialog text'); I should get a message box with an ok button and the application's icon shown on it. I don't there's no icon.
Can anyone advise me as to where I've gone wrong?
Thanks,
John.
I've got the following code from the internet (seen it in lots of different places - always the same code with same variable names and code formatting etc..)
function MyMessageBox(lpCaption, lpText: PChar): Integer;
var
MBParams : TMsgBoxParams;
begin
with MBParams do begin
cbSize:=SizeOf(MBParams);
hwndOwner:=Application.Handle;
hInstance:=SysInit.HInstance;
lpszText:=lpText;
lpszCaption:=lpCaption;
lpszIcon:=PChar('MAINICON');
dwStyle:=MB_OK or MB_USERICON;
dwContextHelpId:=0;
lpfnMsgBoxCallback:=nil;
dwLanguageId:=LANG_NEUTRAL;
end;
Result:=Integer(MessageBoxIndirect(MBParams));
end;
Basically, if I run MyMessageDlg('Caption','Message dialog text'); I should get a message box with an ok button and the application's icon shown on it. I don't there's no icon.
Can anyone advise me as to where I've gone wrong?
Thanks,
John.