Can I use user-defined messages to communicate between modeless dialog

I'd like to update database table information in several
modeless dialog boxes when one edit box in one modeless
dialog box changed. Do we have an efficient way to do this?

Thanks in advance!

Comments

  • : I'd like to update database table information in several
    : modeless dialog boxes when one edit box in one modeless
    : dialog box changed. Do we have an efficient way to do this?
    :
    : Thanks in advance!
    :
    [blue]If all these modeless boxes are in the same process, just do some interface work - example: let your application know about all these dialogs, so you can communicate anything. When you create a modeless dialog you get back HWND of that dialog. Define your own messages with WM_USER+xxx or WM_APP+xxx and then just send the information across. Better way is to attach the data structures (C++ object pointers) to the HWND using 'SetWindowLong()'. Then you do not need to send any messages. Just call 'GetWindowLong()' to get a pointer back and move the data across dialogs.

    To communicate between processes use WM_COPYDATA.[/blue]
  • : : I'd like to update database table information in several
    : : modeless dialog boxes when one edit box in one modeless
    : : dialog box changed. Do we have an efficient way to do this?
    : :
    : : Thanks in advance!
    : :
    : [blue]If all these modeless boxes are in the same process, just do some interface work - example: let your application know about all these dialogs, so you can communicate anything. When you create a modeless dialog you get back HWND of that dialog. Define your own messages with WM_USER+xxx or WM_APP+xxx and then just send the information across. Better way is to attach the data structures (C++ object pointers) to the HWND using 'SetWindowLong()'. Then you do not need to send any messages. Just call 'GetWindowLong()' to get a pointer back and move the data across dialogs.
    :
    : To communicate between processes use WM_COPYDATA.[/blue]
    :


    Thanks.
    I'd like to update all related control items in other modeless
    dialoges box when one data changed in a modeless dialog box!
    It seems those WM_USER_*** messges can not be catched at all.
    Would you mind tell me the reason?
    Thanks again.


  • : : : I'd like to update database table information in several
    : : : modeless dialog boxes when one edit box in one modeless
    : : : dialog box changed. Do we have an efficient way to do this?
    : : :
    : : : Thanks in advance!
    : : :
    : : [blue]If all these modeless boxes are in the same process, just do some interface work - example: let your application know about all these dialogs, so you can communicate anything. When you create a modeless dialog you get back HWND of that dialog. Define your own messages with WM_USER+xxx or WM_APP+xxx and then just send the information across. Better way is to attach the data structures (C++ object pointers) to the HWND using 'SetWindowLong()'. Then you do not need to send any messages. Just call 'GetWindowLong()' to get a pointer back and move the data across dialogs.
    : :
    : : To communicate between processes use WM_COPYDATA.[/blue]
    : :
    :
    :
    : Thanks.
    : I'd like to update all related control items in other modeless
    : dialoges box when one data changed in a modeless dialog box!
    : It seems those WM_USER_*** messges can not be catched at all.
    : Would you mind tell me the reason?
    : Thanks again.
    :
    :
    :
    [blue]Try using 'RegisterWindowMessage()' -> MSDN. It appears that WM_USER has some restrictions... my bad - did not research MSDN before posting...[/blue]
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion