I posted what appears to be a solution...but on the thread
"MessageBoxIndirect ???". I didn't see your thread...otherwise I would have
placed it there.
Thanks.
Mike
Sergey <k...@NOSPAM.cheerful.com> wrote in message
news:8fdv6s$jh...@bornews.borland.com...
"Michael Cessna" <mce...@saleslogix.com> wrote in message
news:8h51v4$on...@bornews.borland.com...
> Hi,
>
> I posted what appears to be a solution...but on the thread
> "MessageBoxIndirect ???". I didn't see your thread...otherwise I would
have
> placed it there.
Yes! The messages here are lost. My decision I sent here 15.05.2000. But it
here already is not present!
I repeat it again:
--------------------------------
As I have found out, for WindowsNT system it is necessary to use
MessageBoxIndirectW function.
By a call of MessageBoxIndirectA function under WindowsNT the user icon is
_not_ displayed. And the call of MessageBoxIndirectW function under
Windows9x does not give _any_ result!
This knowledge I have issued in MessageBoxUni function. It correctly works
under 95, 98, NT and W2K.
{ --- cut here --- }
function TForm1.MessageBoxUni(sText,sCaption: string; dwStyl: dword; sIcon:
string): integer;
var
mbpA: TMSGBOXPARAMSa;
mbpW: TMSGBOXPARAMSw;
osvi: TOSVERSIONINFO;
begin
osvi.dwOSVersionInfoSize:= sizeof(TOSVERSIONINFO);
GetVersionEx(osvi);
if (osvi.dwPlatformId= VER_PLATFORM_WIN32_NT) then
begin // NT detected
mbpW.hInstance:= hInstance;
with mbpW do
begin
cbSize:= sizeof(mbpW);
hwndOwner:= handle;
lpszText:= PWideChar(WideString(sText));
lpszCaption:= PWideChar(WideString(sCaption));
dwStyle:= (dwStyl or MB_USERICON);
lpszIcon:= PWideChar(WideString(sIcon));
dwContextHelpId:= 0;
lpfnMsgBoxCallback:= nil;
dwLanguageId:= 0;
end;
result:= integer(MessageBoxIndirectW(mbpW));
end
else
begin // other
mbpA.hInstance:= hInstance;
with mbpA do
begin
cbSize:= sizeof(mbpA);
hwndOwner:= handle;
lpszText:= PChar(sText);
lpszCaption:= PChar(sCaption);
dwStyle:= (dwStyl or MB_USERICON);
lpszIcon:= PChar(sIcon);
dwContextHelpId:= 0;
lpfnMsgBoxCallback:= nil;
dwLanguageId:= 0;
end;
result:= integer(MessageBoxIndirectA(mbpA));
end
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
if MessageBoxUni('Do you want to leave the program?',
'MessageBoxIndirect test',
(MB_DEFBUTTON2 or MB_YESNO),
'MAINICON')= IDYES then
close;
end;
{ --- and here --- }
--
~~~~~~~~~~~~~~
Best Regards,
Sergey Kirichenko
homepage: http://members.tripod.com/~rcolonel/
Looks like we came up with essentially the same solution! The only
difference is that I re-exported the MessageBoxIndirect functions so that
the return type was Integer.
Thanks.
Mike
Sergey <k...@NOSPAM.cheerful.com> wrote in message
news:8h56n3$v...@bornews.borland.com...