Announcement

Collapse
No announcement yet.

MSGBOX revisited

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

  • MSGBOX revisited

    Code:
    %MB_TASKMODAL
     Task Modal - All top-level windows belonging to the current application are disabled until the MSGBOX is dismissed. %MB_TASKMODAL is commonly used to display a truly modal MSGBOX
    Not a real big ticket item here, but I'm curious as to just what disabled means to the top-level windows.
    I had assumed, wrongly I found out, that if the MSGBOX was used in a CALLBACK function, that the CALLBACK function would cease all activity until the MSGBOX was dismissed.
    %WM_TIMER keeps on tickin, for one.
    Is it only the Windows Messages for user interaction with the window that are disabled?
    Rod
    In some future era, dark matter and dark energy will only be found in Astronomy's Dark Ages.

  • #2
    As long as your window is "alive", it will receive messages sent from the system, when the window is disabled, some UI handling messages are not sent. I assume MB_TASKMODAL simulates the window being disabled.

    WM_TIMER messages are received always, even with disabled windows, just like WM_PAINT etc.. If your app is busy and don't want to process WM_TIMER, you need to set a flag variable (global or static), or disable the timer itself. You can avoid having to use MB_TASKMODAL and showiing the MSGBOX in the taskbar by using MessageBox() and passing it a parent handle. This will automatically disable the parent.

    There is an inherant problem with MSGBOX in that it doesn't allow a parent window handle to be specified, and so sits outside any created windows (it shows on the taskbar) as a modeless window. I think this is a design that originated with it's VB compatibility - VB always uses the active form for the parent of the MSGBOX. It's the same with INPUTBOX$. PB could not do this as it didn't have a form engine (except DDT which was indroduced in version 6.00).
    kgpsoftware.com | Slam DBMS | PrpT Control | Other Downloads | Contact Me

    Comment


    • #3
      > when the window is disabled, some UI handling messages are not sent.

      It's not that the notification messages are disabled or suppressed, it's that the user actions which generate these messages are prohibited when a window is disabled.

      A disabled window cannot not receive user input... i.e., you can't click on a button or edit the text of an edit control. (Well, I guess you can click on a button, but it doesn't do anything when the control is disabled).
      Michael Mattias
      Tal Systems (retired)
      Port Washington WI USA
      [email protected]
      http://www.talsystems.com

      Comment


      • #4
        It's not that the notification messages are disabled or suppressed, it's that the user actions which generate these messages are prohibited when a window is disabled.
        Semantics. Windows does not send these messages. I never stated they were blocked.

        I will make a correction about MSGBOX though, it is MODAL as it does not return until a choice has been made.
        Last edited by Kev Peel; 22 Nov 2008, 07:59 AM.
        kgpsoftware.com | Slam DBMS | PrpT Control | Other Downloads | Contact Me

        Comment


        • #5
          Is it only the Windows Messages for user interaction with the window that are disabled?
          From the responses, I'm taking the answer to the question as 'Yes'.
          Rod
          In some future era, dark matter and dark energy will only be found in Astronomy's Dark Ages.

          Comment

          Working...
          X