Results 1 to 3 of 3

Thread: Need help to find a MessageBox() replacemend for *nix

  1. #1

    Need help to find a MessageBox() replacemend for *nix

    You can see how poor the Linux part of this proc below looks.
    No matter how hard I search (it's several years now! :evil, I am unable to find a *simple* solution to replace the WinAPI's MessageBox function.

    The problem is complicated by the fact that my program is written in pure FreePascal, no Lazarus involved.

    [pascal] procedure DisplayDyingYells;
    var
    tit, DyingYell: WideString;
    titA: AnsiString;
    begin
    DyingYell:=ExtractDyingYell();
    AddLog(MI_ERROR_MESSAGE_IS, [DyingYell]);
    {$ifdef win32}
    tit:=MessageContainer[MI_CGE_TITLE] + #0;
    titA:=WideToAnsi(tit);
    MessageBeep($FFFFFFFF);
    if RunningInWindows9x()
    //Windows 9x may not have Unicode support installed,
    // so we convert the text ourselves and call the ANSI function,
    // while assuming that the locale is Russian (cp1251).
    then MessageBoxA(0, PChar(WideToAnsi(DyingYell)), @(titA[1]), MB_ICONERROR + MB_OK)
    else begin
    DyingYell:=DyingYell + #0;
    MessageBoxW(0, @(DyingYell[1]), @(tit[1]), MB_ICONERROR + MB_OK);
    end;
    {$else}
    WriteLn(#10#13#10#13#10#13 + ExtractFileName(ParamStr(0) + ' crashed!'));
    Writeln(#10#13 + WideToAnsi(DyingYell) + #10#13);
    {$endif}
    end;[/pascal]

    As you can see, to see wghat went wrong the Linux user should run my program from a console and see its output.

  2. #2

    Need help to find a MessageBox() replacemend for *nix

    Mabe you could use xmessage
    :think:
    Get your fpc4gba copy now!
    Get your fpc4nds copy now!

  3. #3

    Need help to find a MessageBox() replacemend for *nix

    Thank you! It helps (at least partially: the bugger cannot display Russian text :x)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •