|
Actually you should put cf.cbSize = sizeof(CHARFORMAT2) before GetDefaultCharFormat , but it is even unneded in case of MFC.
May be you should also unset the CFE_AUTOCOLOR :
cf.dwEffects ^= ~CFE_AUTOCOLOR;
I think you do not need to use GetDefaultCharFormat . Maybe this will work for you:
CHARFORMAT2 cf = { 0 };
cf.dwMask = CFM_COLOR;
cf.crTextColor = RGB(0, 0, 255);
m_edtMsg.SetDefaultCharFormat(cf);
Hope it helps.
|
|
|
|
|
excellent ! works like a charm! (i placed ZeroMemory instead of the CHARFORMAT2 cf = { 0 }; )
an other question if i may... i am interested on paiting the scroll bar myself of the rich edit
which message should i catch (when ever the scroll bar is shown ) to call the drawing of the scroll bar?
thanks again for all the help
Yaron
Interface basics click here :
http://www.codeproject.com/com/COMBasics.asp
don't forget to vote
|
|
|
|
|
As I know, the scroll events for rich-edit control are EN_HSCROLL and EN_VSCROLL . In order to allow these notifications, you have to set a mask in dialog’s OnInitDialog :
m_edtMsg.SetEventMask(m_edtMsg.GetEventMask() | ENM_SCROLL);
In addition the scroll bars should be enabled in the Properties panel.
If you want to change the colours of scroll bar, I think you can try the WM_CTLCOLOR or WM_CTLCOLORSCROLLBAR notifications.
If you create your own scroll-bars (for instance, derived from CScrollBar ) and put them near the edit control, then the scroll notifications will be WM_HSCROLL and WM_VSCROLL .
|
|
|
|
|
When I display the properties of a file using Explorer,
there is often a "Summary" tab, containing information
such as Title, Subject ...
How can I read and write those properties with VC++
Thanks for any help.
Peter
|
|
|
|
|
See here.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
This is fine for a doc file, but it does not work for a "normal" text file.
I created a file using Notepad, and used Explorer to change the summary. I want to copy the summary information from one text file to another.
When I used the example given by Microsoft in
http://support.microsoft.com/kb/186898/EN-US,
it worked for a doc file, but complained that the text file was not a compound file.
-- modified at 5:01 Wednesday 21st June, 2006
|
|
|
|
|
petergggg wrote: This is fine for a doc file, but it does not work for a "normal" text file.
Sure it does. Just use StgOpenStorageEx() instead.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
can be change button color if yes plz send me code for his
Please mail me
|
|
|
|
|
I think it is better to derive a class for the button from CButton and override DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct).Here u can draw the button, and can give color u wanted to your button.
yours faithfully
ajeeshcv
|
|
|
|
|
yogendra kaushik wrote: can be change button color
Have a look on CBitmapButton class
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
you can derived CButton and use from WM_DRAWITEM of course you need to set OwnerDrae for button from property window
whitesky
|
|
|
|
|
I like to autosize the owner draw button depending upon the text that it load dynamically based on localization strings. so some strings are large than others. Keeping this I override DrawItem in the inherited class from CButton. (In below i tried unconditionally to increase the size at runtime, once it is achived, i think i can go ahead for resize code)
The sample code is below
void CMyGraphicButton::DrawItem (LPDRAWITEMSTRUCT lpDrawItemStruct)
{
CString cs;
CString cslong;
ASSERT(lpDrawItemStruct->CtlType == ODT_BUTTON);
LPCTSTR lpszText = (LPCTSTR) lpDrawItemStruct->itemData;
if (!lpszText || lpszText == (LPCTSTR)-1)
{
GetWindowText (cs);
}
else
cs = lpszText;
// now i m trying to resize , so let try to increase the size of button unconditioally
// I get
//lpDrawItemStruct>rcItem.left =0
//lpDrawItemStruct>rcItem.right =75
//lpDrawItemStruct>rcItem.top = 0
//lpDrawItemStruct>rcItem.bottom = 25
//As my button is on extreme right side of dialog so i tried to extend/increase the size of
// button of the left side as follows
lpDrawItemStruct>rcItem.left -= 25 ;
// but the above causes the text to be moved on right side insead of resize/increase the
//button size.
Any idea or help is appriciated.
Thanks
Anil
}
[AKS]
|
|
|
|
|
Hi sir/mam,
I set up BREW application and made a project name "helloworld". But when I develop BREW then there are so many applets form. I pass the string in "Helloworld" and it is coming.but the problem is that how can I develope the C++ code under Helloworld. I tried but fail to develop the C++ code. Because the file of C++ code not supported(#include "iostream"). So how Can go for it please help me out for it or tell the other process for authentication for brew. Or is there any other file for supporting BREW. Please Tell me the process.
How can I write a C++ program in BREW.
Thanks.....
Nitin Dalal
nitin
|
|
|
|
|
stop asking the same question every 6 hours...
if no one answer you, it's because either no one knows, or the question is not asked correctly... suss:
TOXCCT >>> GEII power
[VisualCalc 3.0 updated ][Flags Beginner's Guide new! ]
|
|
|
|
|
|
Sit in the brew and write some code?
Steve
|
|
|
|
|
what is it(BREW)
whitesky
|
|
|
|
|
As tox said, if you don't get answers here, it's because noone knows about BREW here.
Maybe you should try the forums at Qualcomm instead? It seems as the obvious place to discuss BREW problems.
Try here[^]
And here[^]
Else, Google is good.
|
|
|
|
|
I sed parameters to SMPPLIbClient program,but server is not cannected in the same time program didn't show any errors plz help me any one
#sankar#
|
|
|
|
|
please tell me how to fit the bitmap to dialog which is high pixels
vasu
|
|
|
|
|
like this
<br />
USES_CONVERSION;<br />
CRect rect;<br />
Image *img ;<br />
ImageAttributes imAttrib; <br />
<br />
Graphics graphics(GetDC()->m_hDC) ;<br />
GetWindowRect(rect);<br />
img = Image::FromFile(A2W("C:\\0.bmp")) ;<br />
graphics.DrawImage(img,Rect(0,0,rect.right,rect.bottom),<br />
0,0,img ->GetWidth(),img ->GetHeight(),<br />
UnitPixel,&imAttrib);<br />
whitesky
|
|
|
|
|
WhiteSky wrote: img = Image::FromFile(A2W("C:\\0.bmp"))
This is overkill. Drop the USES_CONVERSION macro and just use this:
img = Image::FromFile(L"C:\\0.bmp");
Steve
|
|
|
|
|
yes my friend,you right
whitesky
|
|
|
|
|
hi all plz sovle my problem
wheather i click on menu or button on one dialog box to goto next dilog box
i use code
void CAccountp::OnUseraccountChangepassword()
{
// TODO: Add your command handler code here
differ.DoModal();
}
when i click on menu it will display a dialog box
but my problem is that after once it will an error that is debug assertion failed plz tel me wat is the problem and tel me how to solve it
Please mail me
-- modified at 9:40 Tuesday 20th June, 2006
|
|
|
|
|
yogendra kaushik wrote: ...but my problem is that after once it will an error...
What is it? What are you doing that causes this? Is the dialog modeless or modal?
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|