Tuesday, July 26, 2011

Proverbs - Suggestions for success.

1. Marry the right person. This one decision will determine 90% of your happiness or misery.

2. Work at something you enjoy and that’s worthy of your time and talent.

3. Give people more than they expect and do it cheerfully. 18 more Suggestions after the break...


4. Become the most positive and enthusiastic person you know.

5. Be forgiving of yourself and others.

6. Be generous.

7. Have a grateful heart.

8. Persistence, persistence, persistence.

9. Discipline yourself to save money on even the most modest salary.

10. Treat everyone you meet like you want to be treated.

11. Commit yourself to constant improvement.

12. Commit yourself to quality.

13. Understand that happiness is not based on possessions, power or prestige, but on relationships with people you love and respect.

14. Be loyal.

15. Be honest.

16. Be a self-starter.

17. Be decisive even if it means you’ll sometimes be wrong.

18. Stop blaming others. Take responsibility for every area of your life.

19. Be bold and courageous. When you look back on your life, you’ll regret the things you didn’t do more than the ones you did.

20. Take good care of those you love.

21. Don’t do anything that wouldn’t make your Mom proud.

Dialog Getting Closed of Pressing Escape Button MFC

Add this declaration in .h file
BOOL PreTranslateMessage(MSG*);

and this in .cpp file
BOOL ClassName::PreTranslateMessage(MSG* pMsg)
{
     if(pMsg->message==WM_KEYDOWN)
     {
       if(pMsg->wParam==VK_RETURN || pMsg->wParam==VK_ESCAPE)
       {
          pMsg->wParam=NULL ;
       }
      }
     return CDialog::PreTranslateMessage(pMsg);
}

should repeat this in all dialogs..

Wednesday, July 20, 2011

Remove Apply and Help Button in PropertySheets MFC

Add these 3 lines in CPropertysheet constructors:

this->m_psh.dwFlags &= ~PSH_HASHELP;
this->m_psh.dwFlags |= PSH_NOAPPLYNOW;
this->m_psh.dwFlags |= PSH_NOCONTEXTHELP;

the above line will disable Apply button but not Help button.

To remove Help button:
CTabHelper is your Class name:

BOOL CTabHelper::OnInitDialog()
{
    CPropertySheet::OnInitDialog();
    CButton *btnHelp;

    btnHelp = reinterpret_cast<CButton *>(GetDlgItem(IDHELP));
    btnHelp->DestroyWindow();

    return TRUE;
}

Hope this helps you cheers......