WM_SendMessage VS WMBroadcastMessage

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • WM_SendMessage VS WMBroadcastMessage

    I have a task for file download, which need to update a progress bar.
    so the download task send a message of the current progress bar value by a call to this function:


    void dl_setProgBar(int prc)
    {
    dlMsg.MsgId = dlProgBarEvent;
    dlMsg.Data.v = prc;
    // WM_SendMessage(dl_hWin,&dlMsg); // does not work
    WM_BroadcastMessage(&dlMsg); // working

    }

    When I send the message to the window that contains the progbar, it does not generate the notification, but if I broadcast it - it works.
    The call back for this window looks like:


    static void _cbDialog(WM_MESSAGE * pMsg) {
    WM_HWIN hItem;
    int NCode;
    int Id;
    // USER START (Optionally insert additional variables)
    // USER END

    switch (pMsg->MsgId) {
    case dlProgBarEvent:

    hItem = WM_GetDialogItem(pMsg->hWin, ID_PROGBAR_0);
    PROGBAR_SetValue(hItem,pMsg->Data.v);
    break;
    case WM_INIT_DIALOG:
    //
    .
    .
    .

    What am I missing? Why I can't send the message to that window only?
    Thanks
    Johanan