Announcement

Collapse
No announcement yet.

MsgBox vs Messagebox

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Andre Jacobs
    replied
    Thanks Kev,

    I knew it had to be something obvious, sometimes when one is too close to the situation, the obvious is missed.

    Then again if nothing goes wrong, then there is nothing to learn.

    Leave a comment:


  • Kev Peel
    replied
    Invalid parent handle (hDlg) since by then the modal dialog would have been destroyed.

    A quick check with GetLastError would have told you that . MSGBOX does not have a parent thus is not affected.

    Leave a comment:


  • Andre Jacobs
    started a topic MsgBox vs Messagebox

    MsgBox vs Messagebox

    I have stumbled upon a situation that I can not explain/understand.

    Can someone please explain this?

    Code:
    '    Dialog Show Modal hDlg, Call ShowDIALOG8Proc To lRslt
        Dialog Show Modeless hDlg, Call ShowDIALOG8Proc To lRslt
        MessageBox hDlg, "Messagebox - result = " + Str$(lRslt), "RB", %mb_ok
        MsgBox "MsgBox - result = " + Str$(lRslt), %mb_taskmodal, "RB"
    If the code above is executed I get both messages, From MessageBox as well as from MsgBox.

    However if I execute this:
    Code:
        Dialog Show Modal hDlg, Call ShowDIALOG8Proc To lRslt
    '    Dialog Show Modeless hDlg, Call ShowDIALOG8Proc To lRslt
        MessageBox hDlg, "Messagebox - result = " + Str$(lRslt), "RB", %mb_ok
        MsgBox "MsgBox - result = " + Str$(lRslt), %mb_taskmodal, "RB"
    There is only one message, the one from MsgBox,
    The MessageBox one disappeared, went for a "walk", or just refuses to do something

    Anybody have any ideas?

    It is not so important in the context of this example, but I am sure there must be a valid explanation for it.
    Some basic principle that I am unaware of, that will sneak up and bite when least expected.
Working...
X
😀
🥰
🤢
😎
😡
👍
👎