CString
-
i want to Broadcast a message to multiple instances of an application ! I have CEdit m_edit1; CButton IDC_SEND //// m_send; //////////////////////////////// CString sText; m_edit1.GetWindowText(sText); i want to diplay the massege from m_edit1 when i press the button m_send to all m_edit1 to instances of aplication. how can i do that? :confused:
Bravoone
-
i want to Broadcast a message to multiple instances of an application ! I have CEdit m_edit1; CButton IDC_SEND //// m_send; //////////////////////////////// CString sText; m_edit1.GetWindowText(sText); i want to diplay the massege from m_edit1 when i press the button m_send to all m_edit1 to instances of aplication. how can i do that? :confused:
Bravoone
If the strings aren't too long, you can turn your string into an "ATOM". GlobalAddAtom stores the string and gives you a handle to it. GlobalGetAtomName does the reverse.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Peter Weyzen Staff Engineer [SoonR Inc.](http://www.soonr.com)
-
If the strings aren't too long, you can turn your string into an "ATOM". GlobalAddAtom stores the string and gives you a handle to it. GlobalGetAtomName does the reverse.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Peter Weyzen Staff Engineer [SoonR Inc.](http://www.soonr.com)
i have CDialog base aplication and i want to display the posibility to transfer data from one dialog to another,but the base dialog is the same , something like broadcast a message to multiple instances of an application : void CTestFindWindowDlg::OnButton() { // Send message in broadcasr mode BOOL a = ::SendNotifyMessage(HWND_BROADCAST,WM_MYMESSAGE ,0,lpString); } void CTestFindWindowDlg::OnTestMyMessage(WPARAM wParam,LPARAM lParam) { int a =(int)lParam; CString strValue; strValue.Format("%d",a); AfxMessageBox("broadcast :"+strValue); } now all i want is to display the text into CEdit m_edit1 lets say... how can i do that ? and the text must be from the m_edit1! :confused:
Bravoone
-
i have CDialog base aplication and i want to display the posibility to transfer data from one dialog to another,but the base dialog is the same , something like broadcast a message to multiple instances of an application : void CTestFindWindowDlg::OnButton() { // Send message in broadcasr mode BOOL a = ::SendNotifyMessage(HWND_BROADCAST,WM_MYMESSAGE ,0,lpString); } void CTestFindWindowDlg::OnTestMyMessage(WPARAM wParam,LPARAM lParam) { int a =(int)lParam; CString strValue; strValue.Format("%d",a); AfxMessageBox("broadcast :"+strValue); } now all i want is to display the text into CEdit m_edit1 lets say... how can i do that ? and the text must be from the m_edit1! :confused:
Bravoone
I’m not sure what exactly you’re really trying to do, but for information on sending messages here is an excellent article http://www.codeproject.com/dialog/messagemgmt.asp[^]
I'd love to help, but unfortunatley I have prior commitments monitoring the length of my grass. :Andrew Bleakley:
-
i want to Broadcast a message to multiple instances of an application ! I have CEdit m_edit1; CButton IDC_SEND //// m_send; //////////////////////////////// CString sText; m_edit1.GetWindowText(sText); i want to diplay the massege from m_edit1 when i press the button m_send to all m_edit1 to instances of aplication. how can i do that? :confused:
Bravoone
Bravoone_2006 wrote:
i want to Broadcast a message to multiple instances of an application !
Use
WM_COPYDATA
.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb