|
Nitheesh George wrote: if u r not using MFC
Create a brush using
HBRUSH hBrush = CreateSolidBrush(RGB(255,0,0))
and pass it to AfxRegisterWndClass...
If MFC is not being used, how can he call AfxRegisterWndClass() ?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
RisKhan wrote: background color by using RGB in AfxRegisterWndClass
Takes a brush as third parameter, use CreateSolidBrush( RGB( 255, 0, 0 )) to get a red brush and pass this to the function.
Nibu thomas
Microsoft MVP for VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http:\\nibuthomas.wordpress.com
|
|
|
|
|
nitpick: Don't forget that you are responsible for the brush you create. You will have to call DeleteObject at some appropriate point.
|
|
|
|
|
Member 754960 wrote: Don't forget that you are responsible for the brush you create.
Yes, true.
Nibu thomas
Microsoft MVP for VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http:\\nibuthomas.wordpress.com
|
|
|
|
|
Hi All,
How we can identify Open/Save Dialog using WIndows Hooking.?
|
|
|
|
|
There is a CWebBrowser2 control in the dialog based project, the web browser control displalys a html page, when users click on the links in the htmp pages, a new IE window should be openned. It seems I need to change the property of the CWebBrowser2 control, but I can't find how to do it.
I know if the html code is something like "<a href="some_url" Ontarget="_blank">link</a>" , a new IE will opened, but if there is no Ontarget="_blank" in the html code, the CWebBrowser2 control should still open a new IE window after a clicking.
Thanks for hlep!
|
|
|
|
|
Say I have a header file named as "Complex.h"
On .cpp I want to include it. So I test it on following three ways.
#include "Complex.h"
#include ".\complex.h"
#include "complex.h"
In all ways it works fine. So that means there is no any different between above three line?
When I use IDE to add classes to my applications, the header files are included as the second way.
I appreciate your help all the time...
Eranga
|
|
|
|
|
#include "some_file.h"
Maxwell Chen
|
|
|
|
|
Thanks for the quick replay. Everything is clear now. And I never heard about case insensitive of file name.
I appreciate your help all the time...
Eranga
|
|
|
|
|
Eranga Thennakoon wrote: And I never heard about case insensitive of file name.
If you are programming C/C++ under Linux/UNIX, the case is sensitive.
If you are programming C/C++ under Windows, it is not.
Case of file names is dependent on the file system design of operating systems.
Maxwell Chen
|
|
|
|
|
Maxwell Chen wrote: If you are programming C/C++ under Windows, it is not.
Yes I'm Windows user, so it is nice to see that. But as a practice I always define the header file name as it is on .cpp file.
I appreciate your help all the time...
Eranga
|
|
|
|
|
In addition, you can use this way under Windows (I mean the "/"). It is because C/C++ were started under UNIX platforms originally in 1974 and 1979.
#include "../../inc/sys/test.h"
and
#include "D:/include/test2.h"
Maxwell Chen
|
|
|
|
|
ya, I test it. Better to follows a one way to do this. So it can be easy to work with in future
I appreciate your help all the time...
Eranga
|
|
|
|
|
Eranga Thennakoon wrote: And I never heard about case insensitive of file name
File Names are Case Insensitive since DOS
Bram van Kampen
|
|
|
|
|
Ooh, really...
I thought it is only for DOS and linking files like this.
I appreciate your help all the time...
Eranga
|
|
|
|
|
Eranga Thennakoon wrote: #include "Complex.h"#include ".\complex.h"#include "complex.h"
Line1 + Line3 Identical: File names are Case Insensitive under windows.
Line2: The '.\' means 'Current Directory, i.e. the directory that the OS considers 'current' when the compiler hits the line. It is very doubtfull that this will work consistently across platforms. It will probably work consistently in your current project. As soon as you step outside that, it ma or may not work. Why go through all this in the File, Just set another search path for header files in your options.
Bram van Kampen
|
|
|
|
|
If I include it within <> it only search the include directory, isn't it?
I appreciate your help all the time...
Eranga
|
|
|
|
|
#include "" tells the compiler to search the file in the current project directory first
#include <> means to search the file in the compiler headers directory. commonly, under Windows, it is somewhere in Program Files/.
|
|
|
|
|
#include<...> means to search first tru a list of 'Standard' directories. You can edit or change that list through your Project/Settings options. At the time of writing the standard, the fear was that someone had his own working library and header file like say 'stdio.h', which at that time could have crashed some one's code when they took the standard on board. Hence the '<...>' is for 'standard' files.
NB, from an Old Hand: Use <...> ONLY for standard files , and "..." for ALL your own includes as a matter of form!
It eill save you heartache over time, untill you gain full understanding of how your compiler searches include directories.
Bram van Kampen
|
|
|
|
|
Why d'you say this to ME ?
|
|
|
|
|
|
#include<...> means to search first tru a list of 'Standard' directories. You can edit or change that list through your Project/Settings options. At the time of writing the standard, the fear was that someone had his own working library and header file like say 'stdio.h', which at that time could have crashed some one's code when they took the standard on board. Hence the '<...>' is for 'standard' files.
NB, from an Old Hand: Use <...> ONLY for standard files , and "..." for ALL your own includes as a matter of form!
It eill save you heartache over time, untill you gain full understanding of how your compiler searches include directories.
Bram van Kampen
|
|
|
|
|
|
Does visible style is true ?
|
|
|
|
|