Posts Tagged ‘MFC’

  • How to get open Windows in MFC
    Hi, i have very little experience in MFC and VC++. I was developing a small project, during development i need to view the list of all opened windows in my explorer. i read somewhere and like to post the solution of this only for you It is very simple. here is the example by which you can display titles of each window opened. try this and enjoy. In your OnInitDialog()...
    by saim at November 5th, 2009 at 12:11 am
  • How to set border of CDialog
    I am new in MFC. I put some time to draw a border around a Dialog in MFC application. Here is the solution that i found. It is very simple for any level of programmer. Follow just three simple steps. Step1: Add OnCtlColor() method in your Message map like:- BEGIN_MESSAGE_MAP(CDATToSWFDlg, CTrayDialog) ON_WM_CTLCOLOR() END_MESSAGE_MAP() Step2: Add this method...
    by saim at November 3rd, 2009 at 08:11 am
  • Changing the background color of a dialog
    If you want to change the background color of your dialog box, it is a very simple. In your CTestDlg header file, declare a member variable from CBrush: class CTestDlg : public CDialog{…protected: CBrush m_brush;…}; Then, add this line in the OnInitDialog function: BOOL CTestDlg::OnInitDialog(){ … m_brush.CreateSolidBrush(RGB(255, 255, 255)); // color...
    by saim at November 1st, 2009 at 09:11 am
  • Changing the background color of a dialog
    I have found this proper way to set the color of CDialog in MFC application. Write this Function in your class. HBRUSH CCaptureOPtionsDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) { if( nCtlColor == 6 ) // for Slider control { pDC->SetBkMode(TRANSPARENT);// Set the Background Mode to TRANSPARENT } else if( nCtlColor == CTLCOLOR_DLG ) //...
    by saim at November 1st, 2009 at 08:11 am