Click here to Skip to main content
15,887,386 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionProblem with FileIOCompletionRoutine ??? Pin
HumanOsc13-Sep-05 23:08
HumanOsc13-Sep-05 23:08 
AnswerRe: Problem with FileIOCompletionRoutine ??? Pin
cmk14-Sep-05 12:08
cmk14-Sep-05 12:08 
GeneralRe: Problem with FileIOCompletionRoutine ??? Pin
HumanOsc14-Sep-05 22:14
HumanOsc14-Sep-05 22:14 
QuestionDownload web pages Pin
Daniel Strigl13-Sep-05 22:44
Daniel Strigl13-Sep-05 22:44 
AnswerRe: Download web pages Pin
ThatsAlok13-Sep-05 23:07
ThatsAlok13-Sep-05 23:07 
QuestionPls Help how to read from windows(edit box) Pin
tejaswi-teja13-Sep-05 22:35
tejaswi-teja13-Sep-05 22:35 
AnswerRe: Pls Help how to read from windows(edit box) Pin
toxcct13-Sep-05 22:39
toxcct13-Sep-05 22:39 
GeneralRe: Pls Help how to read from windows(edit box) Pin
tejaswi-teja13-Sep-05 23:43
tejaswi-teja13-Sep-05 23:43 
please validate the code here if sth is wrong. Only the case for edit box controls it is not working , i am tinking if any locking they have done there. have tried many other options also all of them commented in the below code.

the main window therei is 'System Event" from which i anm trying to read the contents of all its sub windows( edit boxes e.t.c)




void WManip(CWnd *WndActiveChild ,CWnd *WndParent)
{
CWnd * WndActiveChildRead;
CEdit *WndEdit;
LPTSTR EditText;
COleDataObject ClipObj;
tagSTGMEDIUM *strVar;
LPCTSTR lpctFormat;


int ControlID,WinCount = 0;
CString rString,temprString,text;


WndActiveChild->SetForegroundWindow();
WndActiveChild->SetFocus();
// WndActiveChild->OpenClipboard();
// if (( (WndActiveChild->GetClipboardOwner()) ->GetWindowText(rString) ) != 0 )
// (WndActiveChild->GetClipboardOwner()) ->GetWindowText(rString);


// if (rString != "")
// AfxMessageBox("some thingn hapend "+rString);


ControlID = WndActiveChild->GetDlgCtrlID();
WndActiveChild->GetWindowText(rString);

AfxMessageBox(rString);

//WndEdit = WndActiveChild ;


// ClipObj.AttachClipboard();
// strVar = new tagSTGMEDIUM;
// ClipObj.GetData(CF_TEXT, strVar,NULL);



// WndActiveChild ->GetLine(0,EditText);
// WndParent ->GetDlgItemText(ControlID,rString);


// temprString.Format("%s%d%s", (LPCTSTR) rString,ControlID, (LPCTSTR)EditText ); //(LPCTSTR) rString,
AfxMessageBox(temprString);

// the following code is just for testing i have put.

if (rString.Compare("&Edit") == 0)
{
WndActiveChild->PostMessage(WM_LBUTTONDOWN,0,0);
Sleep(50);
WndActiveChild->PostMessage(WM_LBUTTONUP,0,0);
// WndParent->CheckDlgButton(i,1);
}

// WndActiveChild->EnableWindow(false);
WinCount ++;

}

void CConfigTool_AutomateDlg::OnOK()
{
int i,WinCount = 0;
CString rString,temprString,text;
CEdit EControl;

CWnd * pActWindow,*pActChildWindow,*pActChild1Window, *pActChild2Window ;
// pActWindow = CWnd::GetActiveWindow();
pActWindow = CWnd::FindWindow(NULL ,"System Event");
pActWindow->SetForegroundWindow();


// pActWindow->ShowWindow(SW_SHOWMAXIMIZED);

pActChildWindow = pActWindow->GetTopWindow();
while (pActChildWindow != NULL)
{

WinCount ++;

pActChild1Window = pActChildWindow->GetTopWindow();
while(pActChild1Window != NULL)
{
WinCount ++;

/* pActChild2Window = pActChildWindow->GetTopWindow();
while(pActChild2Window != NULL)
{
WinCount ++;

WManip(pActChild2Window,pActChild1Window);
pActChild2Window = pActChild2Window->GetNextWindow(GW_HWNDNEXT);

} */

WManip(pActChild1Window,pActChildWindow);
pActChild1Window = pActChild1Window->GetNextWindow(GW_HWNDNEXT);

}

WManip(pActChildWindow,pActWindow);
pActChildWindow = pActChildWindow->GetNextWindow(GW_HWNDNEXT);

}



// temprString.Format("%s%d", "Total number of windows" , i);

// AfxMessageBox(temprString);

if (CanExit())
CDialog::OnOK();
}
GeneralRe: Pls Help how to read from windows(edit box) Pin
toxcct14-Sep-05 0:50
toxcct14-Sep-05 0:50 
JokeRe: Pls Help how to read from windows(edit box) Pin
ThatsAlok14-Sep-05 1:39
ThatsAlok14-Sep-05 1:39 
GeneralRe: Pls Help how to read from windows(edit box) Pin
toxcct14-Sep-05 1:46
toxcct14-Sep-05 1:46 
JokeRe: Pls Help how to read from windows(edit box) Pin
ThatsAlok14-Sep-05 18:05
ThatsAlok14-Sep-05 18:05 
GeneralRe: Pls Help how to read from windows(edit box) Pin
14-Sep-05 0:55
suss14-Sep-05 0:55 
GeneralRe: Pls Help how to read from windows(edit box) Pin
ThatsAlok14-Sep-05 1:39
ThatsAlok14-Sep-05 1:39 
AnswerRe: Pls Help how to read from windows(edit box) Pin
ky_rerun14-Sep-05 16:22
ky_rerun14-Sep-05 16:22 
GeneralRe: Pls Help how to read from windows(edit box) Pin
ThatsAlok14-Sep-05 17:59
ThatsAlok14-Sep-05 17:59 
QuestionVisual Studio function comments Pin
MartinWA13-Sep-05 22:28
MartinWA13-Sep-05 22:28 
AnswerRe: Visual Studio function comments Pin
Anonymous13-Sep-05 23:20
Anonymous13-Sep-05 23:20 
Questionerror LNK2001 Pin
momer13-Sep-05 22:00
momer13-Sep-05 22:00 
QuestionMessageBox, Help needed Pin
pradish13-Sep-05 21:47
pradish13-Sep-05 21:47 
AnswerRe: MessageBox, Help needed Pin
Nishad S13-Sep-05 23:26
Nishad S13-Sep-05 23:26 
AnswerRe: MessageBox, Help needed Pin
Frank K14-Sep-05 0:32
Frank K14-Sep-05 0:32 
AnswerRe: MessageBox, Help needed Pin
ThatsAlok14-Sep-05 1:45
ThatsAlok14-Sep-05 1:45 
Questionrefreshing the dialog window Pin
a_david12313-Sep-05 21:11
a_david12313-Sep-05 21:11 
AnswerRe: refreshing the dialog window Pin
toxcct13-Sep-05 21:16
toxcct13-Sep-05 21:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.