In MFC By Using Communication Between Dialog Boxes,How Can We Send Message Of one Dialog Box To Another Dialog.?
Answers were Sorted based on User's Feedback
Answer / alim
You can use Findwindow api to get the handle of other application and then use that handle n send message.
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / ali
You can also use Inter Process Communication between two dialog boxes. Read about OnCopyData method.
The SendMessage for WM_COPYDATA, they Handle to sender is an HWND
SendMessage((HWND) hWnd, // handle to destination window
WM_COPYDATA, // message to send
(WPARAM) wParam, // handle to window (HWND)
(LPARAM) lParam // data (PCOPYDATASTRUCT)
);
I hope this ll help you.
| Is This Answer Correct ? | 1 Yes | 1 No |
Answer / shiva
using application class we can store the data then we can retrieve that data example
if you're application like
in MyTabapplication.h
bool courses[3];
then dailog class
tab1.cpp
we can pass the data
void CTabOne::OnBnClickedCheck1()
{
// TODO: Add your control notification handler code here
UpdateData(TRUE);
CMyTabExampleApp* myApp = (CMyTabExampleApp*)AfxGetApp();
myApp->courses[0] = m_CHK_EXE.GetCheck();
}
tab2.cpp
in you're 2 dailog box
CMyTabExampleApp* myApp = (CMyTabExampleApp*)AfxGetApp();
if(myApp->courses[0])
{
m_CHK_EXE.EnableWindow(TRUE);
//m_CHK_EXE.SetCheck(FALSE);
}
| Is This Answer Correct ? | 0 Yes | 0 No |
1)How to change a text of a button as Dynamically?
Whats is DDX & DDV in MFC?
What is Thread ?(VC++)What is the difference between Cmutex and Csemaphone?
what is the use of Mutex and critical section
what do you mean by psychic window?
If i derive a new class from CObject what are the basic features my derived wil get ?
What is the difference between the ASSERT and VERIFY macros?
What is thread & process?
What is userdefine Messages in MFC?
Which CPrintInfo member variable must be set for multiple page printouts?
Explain about MDI and CMultiDocTemplate ?
How to find the mouse entering an image?..while entering need to display next image...