Click here to Skip to main content
16,005,473 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: how to delete a file permanently from hard disk? Pin
Karismatic12-Sep-07 1:31
Karismatic12-Sep-07 1:31 
AnswerRe: how to delete a file permanently from hard disk? Pin
krmed12-Sep-07 1:52
krmed12-Sep-07 1:52 
AnswerRe: how to delete a file permanently from hard disk? Pin
David Crow12-Sep-07 3:02
David Crow12-Sep-07 3:02 
QuestionWant to check this check box programmatically Pin
Mushtaque Nizamani12-Sep-07 1:01
Mushtaque Nizamani12-Sep-07 1:01 
QuestionRe: Want to check this check box programmatically Pin
David Crow12-Sep-07 3:08
David Crow12-Sep-07 3:08 
AnswerRe: Want to check this check box programmatically Pin
Mushtaque Nizamani12-Sep-07 3:18
Mushtaque Nizamani12-Sep-07 3:18 
GeneralRe: Want to check this check box programmatically Pin
David Crow12-Sep-07 3:34
David Crow12-Sep-07 3:34 
AnswerRe: Want to check this check box programmatically Pin
nbugalia12-Sep-07 3:15
nbugalia12-Sep-07 3:15 
You can use the following code.
This may not be the optimized code, but it works.

//Code for ok button.
//Clicking it will cause the check box checked.
void CTestTreeDlg::OnBnClickedOk()
{ 
  CWnd *pWnd = this->FindWindow (NULL, "OLE/COM Object Viewer");
   CString Title = "&Use Surrogate Process";
   CWnd *pChildWnd = SearchWindows (pWnd, Title);
   if (pChildWnd != NULL)
   {
      ((CButton *)pChildWnd)->SetCheck (1);
   }
}


//Function for searching the proper window.
CWnd* CTestTreeDlg::SearchWindows (CWnd* pWnd, CString Title)
{  
   CWnd *pReturnWindow = NULL;
   while (pWnd != NULL)
   {
      CString WindowText;
      pWnd->GetWindowText (WindowText);
      if (WindowText == Title)
         return pWnd;

      CWnd* pChildWindow = pWnd->GetWindow (GW_CHILD);
      if (pChildWindow != NULL)
      {
         CWnd *pWindow = SearchWindows (pChildWindow, Title);
         if (pWindow != NULL)
         {
            pReturnWindow = pWindow;
         }
      }

      CWnd *pNextWnd = pWnd->GetNextWindow (GW_HWNDNEXT);
      while (pNextWnd == pWnd)
      {
         pNextWnd = pWnd->GetNextWindow (GW_HWNDNEXT);
      }
      pWnd = pNextWnd;
   }
   return pReturnWindow;
}


Hope this is what u want.
Enjoy Smile | :)
QuestionSemi automatic forground video segmentation Pin
ptr_Electron12-Sep-07 0:44
ptr_Electron12-Sep-07 0:44 
Questiondynamic two dimentional array Pin
KASR112-Sep-07 0:16
KASR112-Sep-07 0:16 
AnswerRe: dynamic two dimentional array Pin
pawelzielin12-Sep-07 0:49
pawelzielin12-Sep-07 0:49 
GeneralRe: dynamic two dimentional array Pin
krmed12-Sep-07 1:53
krmed12-Sep-07 1:53 
GeneralRe: dynamic two dimentional array Pin
pawelzielin12-Sep-07 20:37
pawelzielin12-Sep-07 20:37 
AnswerRe: dynamic two dimentional array Pin
Waldermort12-Sep-07 4:09
Waldermort12-Sep-07 4:09 
AnswerRe: dynamic two dimentional array Pin
Mark Salsbery12-Sep-07 6:53
Mark Salsbery12-Sep-07 6:53 
GeneralRe: dynamic two dimentional array Pin
carrivick12-Sep-07 8:37
carrivick12-Sep-07 8:37 
GeneralRe: dynamic two dimentional array Pin
David Crow12-Sep-07 8:41
David Crow12-Sep-07 8:41 
GeneralRe: dynamic two dimentional array Pin
Mark Salsbery12-Sep-07 8:42
Mark Salsbery12-Sep-07 8:42 
QuestionHow to change size of a win32 toolbar after TB_DELETEBUTTON Pin
ioctl5112-Sep-07 0:13
ioctl5112-Sep-07 0:13 
QuestionPrinting Problem Pin
pri_skit11-Sep-07 23:59
pri_skit11-Sep-07 23:59 
AnswerRe: Printing Problem Pin
Nelek12-Sep-07 0:29
protectorNelek12-Sep-07 0:29 
GeneralRe: Printing Problem Pin
pri_skit12-Sep-07 1:31
pri_skit12-Sep-07 1:31 
GeneralRe: Printing Problem Pin
Nelek12-Sep-07 1:42
protectorNelek12-Sep-07 1:42 
AnswerRe: Printing Problem [modified] Pin
bob1697212-Sep-07 1:54
bob1697212-Sep-07 1:54 
Generalproblem in url Pin
yadahav11-Sep-07 23:30
yadahav11-Sep-07 23:30 

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.