|
There is this article on CP: A Technique to Customize the Title Bar of Windows[^] which lets you draw the title bar of an application. I have to do the same thing but all my applications are written in MFC. So my question how could I use the above mentioned code in MFC? Or is it possible? If not how could I custom draw the title bar in MFC. Or how could I combine the two?
Any sugestions would be greatly apreciated. This is a time sensitive matter.
regards,
Mircea Grelus
Many people spend their life going to sleep when they’re not sleepy and waking up while they still are.
|
|
|
|
|
I forgot to mention. I'm refering to VC6.
Many people spend their life going to sleep when they’re not sleepy and waking up while they still are.
|
|
|
|
|
|
very interesting article. i'll look into it in more detail. in the mean i found another solution for my problem. I just set the border to none in my dialog getting rid of the system tray, and added a background with my system tray and the buttons i needed.
wouldn't like to do this each time , so i'll look into the article as soon as i have the time.
thanks,
Mircea
Many people spend their life going to sleep when they’re not sleepy and waking up while they still are.
|
|
|
|
|
Hi I'm busy writting an Win32 application (not MFC) to display random bitmaps every 15 seconds while playing a Random song the application needs to be able to enumurate like the music folder and play a random song from there and enumurate the bitmap folder and play a random file from there
if someone can help me with the most basic file/folder enumuration i would be greatfull
THX in advance
Dewald
|
|
|
|
|
how can i set and edit control to accept only integer values and letters "abcdef"?
a journey of a thousand miles is started by taking the first step.
|
|
|
|
|
|
You can also use cotrol subclassing.
Just derive a new class , for example CMyEdit ,from CEdit and overload the WM_CHAR message handler for the new class ,like this :
void CMyEdit::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)
{
TCHAR c = (TCHAR) nChar;
if(c=='A'||c=='B'||c=='C'||c=='D'||isdigit(c))
{
CEdit::OnChar(nChar, nRepCnt, nFlags);
}
}
After this , create an Edit box on your dialog and attach a CMyEdit variable to it. Then you will be able to type inside only "0123456789ABCD" letters
"Success is the ability to go from one failure to another with no loss of enthusiasm." - W.Churchill
-- modified at 4:42 Thursday 13th October, 2005
|
|
|
|
|
|
this works but it somehow blocks the backspace key... do you know how to resolve this?
krby_xtrm
a journey of a thousand miles is started by taking the first step.
|
|
|
|
|
In Continuation With Giorgi (Very Nice answer)..
kerby_arion wrote:
do you know how to resolve this?
Modify Giorgi function this way:-
const short g_arrAllowed[]={1,2,3,4,5,6,7,8,9,0,'a','b','c','d','e','A','B','C','D','E',VK_BACK,VK_DELETE};
void CMyEdit::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)
{
for(int i=0;i<sizeof(arrAllowed)/sizeof(short);i++)
{
if(nChar==arrAllowed[i])
{
CEdit::OnChar(nChar, nRepCnt, nFlags);
return;
}
}
}
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
ThatsAlok wrote:
In Continuation With Giorgi (Very Nice answer)..
thanks Alok
"Success is the ability to go from one failure to another with no loss of enthusiasm." - W.Churchill
|
|
|
|
|
i've tried this one it worked:
void CMyEdit::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)<br />
{ <br />
if(nChar=='A'||nChar=='B'||nChar=='C'<br />
||nChar=='D'||isdigit(c)||nChar==VK_BACK)<br />
{ <br />
CEdit::OnChar(nChar, nRepCnt, nFlags); }}
krby_xtrm
A_journey_of_a_thousand_miles_is_started_by_Taking_the_first_step.
|
|
|
|
|
how to set a max char length of combo box or and edit control?
say it would only accepts 10 characters.
a journey of a thousand miles is started by taking the first step.
|
|
|
|
|
u can set these when u declare variables for them thru the class wizard
"Do first things first, and second things not at all."
— Peter Drucker.
|
|
|
|
|
yeah i did that already i typed in "8" but still the control allows more than eight characters...
a journey of a thousand miles is started by taking the first step.
|
|
|
|
|
my bad, my compiler didn't recompile... it works now... ty
a journey of a thousand miles is started by taking the first step.
|
|
|
|
|
see the property dialog within the resource editor...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
CComboBox *c = (CComboBox*) GetDlgItem(IDC_YOUR_COMBOBOX);<br />
c->LimitText(10);
-krby_xtrm-
a journey of a thousand miles is started by taking the first step.
|
|
|
|
|
CComboBox *c = (CComboBox*) GetDlgItem(IDC_YOUR_COMBOBOX);
c->LimitText(10); // or any value you want.
-krby_xtrm-
a journey of a thousand miles is started by taking the first step.
|
|
|
|
|
Hi
I am learning MFC exe application.
I have to convert ini files to xml files through my application. My sample ini file(ABCD.yak) is:
ABCD.yak
[Section1]
Key1=ABCD
Key2=20
Can anybody tell me how to convert it into an xml file using mfc.
Please tell me which functions should I make?
Thanx
|
|
|
|
|
|
I've used VC++7 to write a program that gets some iformation from another program, parse it, do calcualations, and output the result.
It's working well on WinXP and Win2K.
However, I need it to work on WinNT (my friend need it). When he tries to run the program, a message shows up "Initialization of the dynamic link library C:\WINNT40\system\OLEACC.DLL failed. The process is terminating abnormaly".
Has anybody gone through a similar situation, or knows anything about it? Do you think that I should change something in the program, or the problem is because of the dll only?
Thanks
|
|
|
|
|
// the parent class of CBtnEx is COleControl
CBtnEx::CtrlSetBitmap(.............)
{
SetWindowPos(NULL,0,0,20,20,SWP_NOZORDER ); // takes no effect.
}
CMyDialog()
{
m_btnEx.CtrlSetBitmap(.....);//
m_btnEx.SetWindowPos(NULL,0,0,20,20,SWP_NOZORDER ); // it works ,
// the only way is calling outside the class ?
// what should I do ?
}
suo
|
|
|
|
|
i want to Develop an application that contains a menu Info having following menu items
• Id
• Name
o First name
o Last name
• City
• Exit
please help me in this regard
thanks
|
|
|
|