|
YaronNir wrote: so the question is on which function override should i place the font changing?
I have a small idea...But someone can sure suggest a better one...
Override WindowProc .
Now create a function called Init();
LRESULT CMyBtn::WindowProc(UINT uMessage, WPARAM wParam, LPARAM lParam)
{
static BOOL blFlag = TRUE;
if(blFlag == TRUE)
{
Init();
blFlag = FALSE;
}
return CButton::WindowProc(uMessage, wParam, lParam);
}
Nibu thomas
Software Developer
Faqs by Michael dunn
|
|
|
|
|
this sure can work, but it is too complex, i don't want to implement WindowProc....
thanks anyway
any other suggestions?
Yaron
Interface basics click here :
http://www.codeproject.com/com/COMBasics.asp
don't forget to vote
|
|
|
|
|
|
So apparently i shoudl override OnDraw and use the font settings there?
thanks
Yaron
Interface basics click here :
http://www.codeproject.com/com/COMBasics.asp
don't forget to vote
|
|
|
|
|
I'm not sure but yes, I think it is one solution
|
|
|
|
|
Did you try PreCreateWindow?
- NS -
|
|
|
|
|
can't do that, because it is called before the window is being attached....
so basically no valid hWnd...
Yaron
Interface basics click here :
http://www.codeproject.com/com/COMBasics.asp
don't forget to vote
|
|
|
|
|
Then what about PreSubclassWindow?
- NS -
|
|
|
|
|
with that it worked fine for me
thanks
Yaron
Interface basics click here :
http://www.codeproject.com/com/COMBasics.asp
don't forget to vote
|
|
|
|
|
YaronNir wrote: this sure can work, but it is too complex, i don't want to implement WindowProc....
I don't think it's too complex. BTW I use it frequently for initlialization purposes. This acts as a common entry point. Yeah it look dirty.
Nibu thomas
Software Developer
Faqs by Michael dunn
|
|
|
|
|
YaronNir wrote: so the question is on which function override should i place the font changing?
Do it in your class' constructor. Then in the class' OnChildNotify() method, look for the WM_CTLCOLORBTN message.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"We will be known forever by the tracks we leave." - Native American Proverb
|
|
|
|
|
not sure i understand what to do with WM_CTLCOLORBTN ??? how is is related to the font changing?
i want all my buttons to be in font tahoma size 11.
can u show my snippet of what you mean?
thanks
Yaron
Interface basics click here :
http://www.codeproject.com/com/COMBasics.asp
don't forget to vote
|
|
|
|
|
YaronNir wrote: can u show my snippet of what you mean?
See the Extras section of this article.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"We will be known forever by the tracks we leave." - Native American Proverb
|
|
|
|
|
Excellent! thanks a lot
maybe you can help me with one more thing not related to this thread?
how do i get the "My documents" folder using shell api, every api i use with CSIDL_MYDOCUMENTS returns INVALID_ARG....maybe a code snippet could help?
thanks again
Yaron
Interface basics click here :
http://www.codeproject.com/com/COMBasics.asp
don't forget to vote
|
|
|
|
|
YaronNir wrote: how do i get the "My documents" folder using shell api, every api i use with CSIDL_MYDOCUMENTS returns INVALID_ARG....maybe a code snippet could help?
The docs plainly state that you cannot use SHGetSpecialFolderPath() or SHGetFolderPath() to get virtual paths.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"We will be known forever by the tracks we leave." - Native American Proverb
|
|
|
|
|
yes he can use CSIDL_PERSONAL instead CSIDL_MYDOCUMENTS
|
|
|
|
|
I'm well aware of that approach. The question was about CSIDL_MYDOCUMENTS , however.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"We will be known forever by the tracks we leave." - Native American Proverb
|
|
|
|
|
yes i've managed to do it
Yaron
Interface basics click here :
http://www.codeproject.com/com/COMBasics.asp
don't forget to vote
|
|
|
|
|
DavidCrow wrote: See the Extras section of this article.
each MyButton i create using Create is working fine with the code you've reffered me to.
but i've i have buttons in the resource editor and i use the DDX to subclass them, then although i'm breaking at the OnNotifyChild method with a breakpoint, the font of the text is not changed??
any ideas?
Yaron
Interface basics click here :
http://www.codeproject.com/com/COMBasics.asp
don't forget to vote
|
|
|
|
|
combining the 2 methods you've suggested solved 100% my problem
thanks very much for all the help
Yaron
Interface basics click here :
http://www.codeproject.com/com/COMBasics.asp
don't forget to vote
|
|
|
|
|
Hi,
I have an application that runs using DirectX full screen exclusive mode. Can I launch another program ( which is not using DirectX, say Notepad or Windows Calculator ) into my application's fullscreen mode?
Thank you.
- NS -
|
|
|
|
|
I want to change My Menu Font,But I can Not It.
Please,guide me
|
|
|
|
|
Try using CMenu and CFont classes
Cheers
"Peace of mind through Technology"
|
|
|
|
|
|
Plz See the following Example first.
Class A
{
Void Func(){AfxMessageBox("Function Class A");}
}
int Main()
{
A *pClassA;
pClassA=NULL;
pClassA->Func();
}
The output is a MessageBox displayed:
AfxMessageBox("Function Class A");
Why this output is displayed because pointer has no memory plz explain this behaviour in the context of VC++ 6.0/MFC.Is this compliler Bug or My VC++6.0 is corrupt or any other.....?
Yours Sincerely
Ajmal Siddiqi
ajmalsiddiqui
-- modified at 6:45 Monday 8th May, 2006
|
|
|
|