Announcement

Collapse
No announcement yet.

Are There No Thread Messages?

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

  • Are There No Thread Messages?

    In one of the PB sample apps, a user-defined message is generated when the thread completes.

    Are there no messages automatically sent to a dialog when a thread is created or when it closes?

    Here's the relevant segments of code from that application.

    Code:
    %CM_THREAD_COMPLETE = %WM_USER + 1
    
        Case %CM_THREAD_COMPLETE
          Thread Close hThread TO hThread
          Control Enable CB.Hndl, %ID_BTN_CALC
    
    Function PrimeThread(BYVAL hDlg AS LONG) AS LONG
      Dialog Post hDlg, %CM_THREAD_COMPLETE, 0, 0
    End Function

  • #2
    Are there no messages automatically sent to a dialog when a thread is created or when it closes
    Um, what if the application has NO dialogs? How about if it has twenty-seven dialogs?

    However when a thread function ends, the thread object is signalled. This means you could automatically detect a thread function's termination by modifying your message loop to use a MsgWaitForMultipleObjects() call... which of course means you'll have to change to a modeless dialog or regular window, since you don't have access to the modal dialog's message loop.

    Ok, so the short answer is: "No."


    MCM
    Michael Mattias
    Tal Systems Inc. (retired)
    Racine WI USA
    [email protected]
    http://www.talsystems.com

    Comment

    Working...
    X