Set Edit Box Text from Different Dialog
-
There are two seperate application dialog. on one dialog there is one text box as well as check box and on other dialog there is one button. now if I press on second dialog's button,then some text should be set on first dialog's text box and checkbox. I am able to set text of checkbox but not able to set text into edit box. I used logic like following CWnd* pWnd = CWnd::FindWindow(NULL,_T("TestDialog")); if (pWnd) { pWnd->ShowWindow(SW_SHOW); pWnd->SetForegroundWindow(); pWnd->SetDlgItemText(1003,"Hello"); pWnd->SetDlgItemText(1001,"Hello111"); } Can anybody tell me how to set text on other application dialog's edit box Thanks, Prakash
sonani prakash
-
There are two seperate application dialog. on one dialog there is one text box as well as check box and on other dialog there is one button. now if I press on second dialog's button,then some text should be set on first dialog's text box and checkbox. I am able to set text of checkbox but not able to set text into edit box. I used logic like following CWnd* pWnd = CWnd::FindWindow(NULL,_T("TestDialog")); if (pWnd) { pWnd->ShowWindow(SW_SHOW); pWnd->SetForegroundWindow(); pWnd->SetDlgItemText(1003,"Hello"); pWnd->SetDlgItemText(1001,"Hello111"); } Can anybody tell me how to set text on other application dialog's edit box Thanks, Prakash
sonani prakash
What happens if you use of
GetDlgCtrlID()
instead 1001
WhiteSky
-
What happens if you use of
GetDlgCtrlID()
instead 1001
WhiteSky
Now I am able to set text using SendMessage(WM_SETTEXT,...) Now I have question about getting ID or handle of the edit box of other application dialog ?
sonani prakash
-
Now I am able to set text using SendMessage(WM_SETTEXT,...) Now I have question about getting ID or handle of the edit box of other application dialog ?
sonani prakash
You can use of this code if we suppose you have two dialogs Main and Local then insert this code on the Local
CMain *m_pMain=(CMain*)GetParent();
m_pMain->function or variables on other dialog
WhiteSky
-
You can use of this code if we suppose you have two dialogs Main and Local then insert this code on the Local
CMain *m_pMain=(CMain*)GetParent();
m_pMain->function or variables on other dialog
WhiteSky
BOTH THE DIALOGS ARE PART OF SEPERATE APPLIATIONS. SO First I can get the handle of dialog windows of other application but problem about it's edit box.
sonani prakash
-
BOTH THE DIALOGS ARE PART OF SEPERATE APPLIATIONS. SO First I can get the handle of dialog windows of other application but problem about it's edit box.
sonani prakash
-
I have used the same and got the solution. Thanks for your help. Prakash.
sonani prakash
-
I have used the same and got the solution. Thanks for your help. Prakash.
sonani prakash
You're welcome ;)
WhiteSky
-
There are two seperate application dialog. on one dialog there is one text box as well as check box and on other dialog there is one button. now if I press on second dialog's button,then some text should be set on first dialog's text box and checkbox. I am able to set text of checkbox but not able to set text into edit box. I used logic like following CWnd* pWnd = CWnd::FindWindow(NULL,_T("TestDialog")); if (pWnd) { pWnd->ShowWindow(SW_SHOW); pWnd->SetForegroundWindow(); pWnd->SetDlgItemText(1003,"Hello"); pWnd->SetDlgItemText(1001,"Hello111"); } Can anybody tell me how to set text on other application dialog's edit box Thanks, Prakash
sonani prakash
better use SetDlgItemText from other window!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta VC Forum Q&A :- I/ IV Support CRY- Child Relief and you