How Can I Change The window color

Good Day.
I Want to ask you for an easy way to change the window color on C++ ..IN MFC
And Thank You(Donnot give me a Link to MSDN Big Smile)



Answer this question

How Can I Change The window color

  • Georgi Vajarov

    Yes. Thank you ..Your Speech is right i should read more..
    But the problem was in The class and tructures
    You can use this if you want Big Smile 
     eiasnabhan@hotmail.com
    And Thank you ..I will be more specefic in the Future..



  • hageoyaji2008

    What library do you use ATL, MFC, plain Win32

    Here are the links to the MSDN Big Smile
    In the MFC you can use message refelection:
    http://msdn.microsoft.com/library/default.asp url=/library/en-us/vclib/html/_mfcnotes_tn062.asp

    In the case of Win32 API you have to react on WM_CTLCOLOR... messages.
    i.e. http://msdn.microsoft.com/library/default.asp url=/library/en-us/shellcc/platform/commctls/staticcontrols/staticcontrolreference/staticcontrolmessages/wm_ctlcolorstatic.asp frame=true

    If you have a common control like list view, or a tree control you can use custom draw (NM_CUSTOMDRAW)
    http://www.codeguru.com/Cpp/controls/listview/customdrawing/article.php/c4195/



  • Maxim Dyachenko


    Thank You Mr.Martin  ...I see The links but I fall is some problems...
    First When i write (in MFC)the constructor  ,Error appers..


    --------------------Configuration: AL Shamr Test - Win32 Debug--------------------
    Compiling...
    AL Shamr TestDlg.cpp
    F:\Learn Vb\C++\Exa\AL Shamr Test\AL Shamr TestDlg.cpp(327) : error C2653: 'CYellowEdit' : is not a class or namespace name
    F:\Learn Vb\C++\Exa\AL Shamr Test\AL Shamr TestDlg.cpp(329) : error C2065: 'm_clrText' : undeclared identifier
    F:\Learn Vb\C++\Exa\AL Shamr Test\AL Shamr TestDlg.cpp(330) : error C2065: 'm_clrBkgnd' : undeclared identifier
    F:\Learn Vb\C++\Exa\AL Shamr Test\AL Shamr TestDlg.cpp(331) : error C2065: 'm_brBkgnd' : undeclared identifier
    F:\Learn Vb\C++\Exa\AL Shamr Test\AL Shamr TestDlg.cpp(331) : error C2228: left of '.CreateSolidBrush' must have class/struct/union type
    F:\Learn Vb\C++\Exa\AL Shamr Test\AL Shamr TestDlg.cpp(332) : warning C4508: 'CYellowEdit' : function should return a value; 'void' return type assumed
    Error executing cl.exe.

    AL Shamr Test.exe - 5 error(s), 1 warning(s)

    I Know it is a selly quastion ..Can you give me an Example

    Whats why I donn't link from MSDN ^.^ Big Smile



  • Mike-T

    You didn't defined the class.
    You should read more about C++.

    Is the email address in your profile correct I will send you a simple sample with CYellowEdit.

    Did you follow the example step by step

  • How Can I Change The window color