|
Dear friends,
I use an edit control as a message box. I want to change the color of writing in edit control (default color is black). Do you know how to do that?
Thank you,
Cheers,
Joy Anne
|
|
|
|
|
|
I want ot color the splitter and i want ot look it as flat.
how can i do it?
|
|
|
|
|
create the subclass for splitter control. After that create the event wm_ctl_color. Here you can assign the color whatever you want.
|
|
|
|
|
Hi all,
In Dialog based application user has to enter the file name to continue the next operation.If he enters any special chararacters like " ?,$,@",or integers, how to validate them.
he should not enter any varibles or any special characters.
Regards,
Harish
|
|
|
|
|
Use the strtok() function
|
|
|
|
|
strtok sucks. It's not thread-safe for a start. It should be avoided.
Steve
|
|
|
|
|
I know it sucks, it's also a nuicance when it comes to UNICODE and MBCS builds, but it's a good starting point for somebody who is learning about string managment.
|
|
|
|
|
reddy harish wrote: user has to enter the file name
How does he enter the characters ? If it is in a edit box, then I would go for overriding the control. You override the OnChar function, and check first if it the character entered is a valid one (if ( (NewChar>'a') && (NewChar<'z') ) , of course you have to check for upper case characters also). If the character is valid, then you can call the OnChar function from the base class. If not, don't call the function and the character will never appear in the edit box. This is nicer than validatating the string after inserting all the data.
-- modified at 2:31 Wednesday 23rd August, 2006
BTW, did asked a question yesterday about file validating also ? Did you look at the answer of Christian Chraus ? About the CFileDialog[^]? It is in general the way to go when you want the user to open a file. And it is much more user friendly than having the user to enter the complete file or path.
|
|
|
|
|
|
Dear Moonen,
thanks for ur reply,
As iam a begginer of MFC i want to know how to override the control
|
|
|
|
|
As far as I can see there are 4 areas an Icon can be displayed: windows explorer, System tray, Taskbar and Title bar. I know it's possible to customize the icons for explorer, the sys-tray and for the title-bar, but is it possible to set an icon for the task-bar? i.e. I want to show a different icon in all four locations. At the whatever icon is show on the title-bar is the same as that of the task bar.
|
|
|
|
|
|
Thanks for the link Rage, but its partly because of this article that I asked the question. I have used his idea and implemented it into a class of mine. Now I don't mind the Titlebar icon to animate, but the Taskbar becomes a little annoying after a while. So I thought it useful to have the option of disabling it.
his article doesn't have my answer. Setting the icon for one, sets the icon for both. I have yet to find a way to adjust one without affecting the other.
|
|
|
|
|
waldermort wrote: Setting the icon for one, sets the icon for both
Now this is something I did not realize. I'll try and have another look at your problem.
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
|
|
|
|
|
I'm thinking maybe I would have to hook a dll/function call somewhere to prevent the taskbar from locating the icon in the default place. I will take a better look at it when I have some time.
|
|
|
|
|
I'm starting to think the taskbar keeps a cache of the icons. I removed/replaced all the icons in my project, yet each time I manage to disable the icon, the first icon is displayed on the taskbar. How is this possible when it is no longer in my exe? I tried changing the apps name, class name etc.. but it's still there.
I have even subclassed the titlebar itself to disable it from there, but no!!! I can remove the icon from both the taskbar and the titlebar, but that damn first icon always re-appears.
Since I have subclassed the title bar, I think the only thing left to try is to do all the repainting myself.
|
|
|
|
|
Whick message is generated when minimize button of a widow is pressed?
KIRAN PINJARLA
|
|
|
|
|
kiran.pinjarla wrote: Whick message is generated when minimize button of a widow is pressed?
You definitely would like to spell it correctly.
have you seen this post below ?
|
|
|
|
|
Scroll down a little, I asked the very same question just a few hours ago.
Still here?
WM_SYSCOMMAND with SC_MINIMIZE in the wParam. You should bitwise AND (&) the wParam with 0xfff0 to get an accurate result.
|
|
|
|
|
kiran.pinjarla wrote: Whick message is generated when minimize button of a widow is pressed?
Sorry guys. I didnt see the same question posted bellow and created another thread.
Thank you.
KIRAN PINJARLA
|
|
|
|
|
<br />
void CAnswer::OnSysCommand(UINT nID, LPARAM lParam)<br />
{<br />
switch(nID)<br />
{<br />
case SC_MINIMIZE:<br />
MessageBox("Min");<br />
break;<br />
case SC_MAXIMIZE:<br />
MessageBox("Max");<br />
break;<br />
}<br />
|
|
|
|
|
From the docs on MSDN:
"In WM_SYSCOMMAND messages, the four low-order bits of the wParam parameter are used internally by the system. To obtain the correct result when testing the value of wParam, an application must combine the value 0xFFF0 with the wParam value by using the bitwise AND operator."
I know simply comparing the values works, but it could lead to a future bug in the application.
|
|
|
|
|
Iam developing a dialog based application in which user has to select a file to continue for next step.There he needs to enter the file with correct extension,so i have to validate the file extensions which he has provided.
he needs to enter different files in different steps.
how can i validate the file extensions he has provided is correct or wrong.
so that he can go for the next operation.
|
|
|
|
|
'need help urgent' is hardly a descriptive subject.
You can use the Substring method of CString to check if the file extension is what you hoped, and you can set a file selection dialog to only allow selection of existing files.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|