|
Create a brush and override WmCtlColor()..i think that's the one.
|
|
|
|
|
Oliver123 wrote: ...I want a red background with normal black letters.
Black letters on a red background are not very contrasting and thus may be hard to read.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
|
I look for any function that can get me date that OS Windows was installed on the PC. From command line I get this information by running systeminfo, but I need this from Visual C++.
Please help.
Thanks,
Nina
|
|
|
|
|
Can you shell execute this command within your code?
Best,
Jun
|
|
|
|
|
|
I think WMI will be your thing.
Take a look at 'Win32_OperatingSystem', there's an InstallDate property.
Don't think you are, know you are...
custom hardware & software - olloc.be
|
|
|
|
|
Good answer I thought about WMI, but did know Win32_OperatingSystem has a InstallDate property.
Best,
Jun
|
|
|
|
|
How to get Tree item selection change event in CTreeView derived class.
Thank you
KIRAN PINJARLA
|
|
|
|
|
check out TVN_SELCHANGED
Kuphryn
|
|
|
|
|
<br />
void CAnswerView::OnTvnSelchanged(NMHDR *pNMHDR, LRESULT *pResult)<br />
{<br />
LPNMTREEVIEW pNMTreeView = reinterpret_cast<LPNMTREEVIEW>(pNMHDR);<br />
CTreeCtrl& ctlTree = (CTreeCtrl&) GetTreeCtrl();<br />
HTREEITEM m_ItemSel = ctlTree.GetSelectedItem();<br />
CString str=ctlTree.GetItemText(m_ItemSel );<br />
<br />
*pResult = 0;<br />
}<br />
|
|
|
|
|
I have an Edit control in my dialog box that takes a 10 digit number, now my requirement is after entering the number in the control, i will hit the return (enter) button in the keyboard for some validation to take place.
remember only with the pressing of the enter key in my keyboard, the validation should take place, i have tried handling the ON_EN_KILLFOCUS and ON_EN_CHANGE notification messages but in vain!!!
i have also tried enabling the Want Return style of the edit button but still i am not able to achieve the task, pls help??
thanx in advance
kumar_windows
|
|
|
|
|
You can try to put button near the edit control and make it a DEFAULT button. Then, after you insert the number and press Enter, the default button will be pressed. So you can validate the input.
Nina
|
|
|
|
|
Use PreTranslateMessage with VK_RETURN
|
|
|
|
|
If you are simply wanting to validate the contents of the edit control when it loses focus, just handle the EN_KILLFOCUS notification. Messing around with the Enter key and/or the EN_CHANGE notification is not necessary. Now if you want the OK button disabled until a valid number is entered in the edit control, that is a different problem requiring a different answer.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I have noticed that the on-kill-focus is not called for cases where the focus really doesn't leave the control, for example clicking on an icon or perhaps when you press the enter key? What I have done is to force a focus change. The first statement you should have within your method called by the enter click is to set focus somewhere. See if this then calls you on-kill-focus method for the edit box.
If only I had more time!
|
|
|
|
|
We are in the process of taking over a project from HQ team. One part is a configuration tool which is built using MFC. I don't have any experience with MFC (lots with C++) apart from a bit i did at college.
Now I have to pick up this tool. The tool is used to configure a CORBA based server. How should I prepare for this? I don't have much time. Basically I'll get about a week before I must start implementing fresh requirements and fix defects in the tool.
|
|
|
|
|
To get in quick:
1. Do not worry, this is all very easy.
2. Step-debug the application to see how the events are handled, and what triggers what.
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
|
|
|
|
|
I would work through some articles on this site to get an idea how MFC hangs together, and remember that you can always ask here if you get stuck on something.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I suggest two books and a website:
Book 1 - Teach yourself Visual C++ .NET in 21 days - this will give you a good grasp of implementing some basic features in MFC
Book 2 - Visual C++ .NET Bible - a great, but thorough reference to MFC, it is a behemoth, but nonetheless it has tons of good information. You can skip around to what you need to know
Website - www.functionX.com - this website is awesome for learning MFC. You can do the tutorials on different aspects of MFC and even download an e-book. This tool is indispensible
Oh, one more thing, the MSDN examples. When you click on a help topic, they often have sample MFC projects that show you how to implement specific functions. This should carry you a long way towards becoming well-versed in MFC.
Hope this helps,
BP
|
|
|
|
|
.net is not being used in our company. VS 7.1 is being used. And we put of managed extensions etc. so that code can compile using ACE on solaris and linux also. Will these books still be helpful? Can you suggest some other ones?
Thanks for the refrences. I will use them for my own learning.
|
|
|
|
|
The references are useful if you want to understand how MFC works. Essentially, they will show you what MFC was doing, then you can find similar methods in your libraries that will do the same thing.
I would be happy to suggest other resources, however, I'm not sure about what you're trying to learn.
|
|
|
|
|
Hi,
I have a child class(CChildWnd) that derives from CWnd. This class creates a generic child window dynamically in the CDialog::OnInitDialog(). I'm trying to change the color of the control by capturing the OnCtlColor event from the CChildWnd class. However it never enters. If I add the OnCtrlColor to the CDialog class, then this version works, why doesn't the the Child's class version not work?
Thanks
Anthony
|
|
|
|
|
I believe that this answers your question. From MSDN:
"OnCtlColor - Called if CWnd is the parent of a control when the control is about to be drawn."
|
|
|
|
|
You can alos use WM_ERASEBKGND or
WM_PAINT<code> <br />
<br />
<div class="ForumSig"><font size="2" color="#99ff66"><hr></font><div style="padding: 2px; text-align: left; color: rgba(255, 255, 255, 1); width: 80px"><font size="2" color="#99ff66">WhiteSky<br />
</font></div><hr></div>
|
|
|
|