|
show yur code where you subclass it.
"No matter where you go, there your are..." - Buckaoo Banzi
-pete
|
|
|
|
|
BOOL CMyStatic::PreCreateWindow(CREATESTRUCT& cs)
{
if (!CStatic::PreCreateWindow(cs)) { return FALSE; }
cs.style |= SS_OWNERDRAW;
return TRUE;
}
void CMyStatic::PreSubclassWindow()
{
CStatic::PreSubclassWindow();
ModifyStyle(0, SS_OWNERDRAW);
}
I did both just to make sure. Winspector Spy shows SS_OWNERDRAW style in the window styles, but no call to DrawItem occurs.
My article on a reference-counted smart pointer that supports polymorphic objects and raw pointers
modified 29-Aug-18 21:01pm.
|
|
|
|
|
what about the code creating the instance of CMyStatic on the toolbar?
"No matter where you go, there your are..." - Buckaoo Banzi
-pete
|
|
|
|
|
|
Good question, i remember there are issues with toolbars and messages not getting routed. i think that the solution is to override PreTranslateMessage and handle them ur self.
Did you watch messages with spy and see if the frame or dialog is receiving the DRAWITEM for that window?
-pete
"No matter where you go, there your are..." - Buckaoo Banzi
-pete
|
|
|
|
|
|
|
Well i don't believe CStatic get input focus. Perhaps you just need a custom window so derive from CWnd. Then do ur OnPaint handler. For focus rect drawing look at CDC::Draw3dRect/DrawEdge/DrawState
Something there should do the trick.
-pete
"No matter where you go, there your are..." - Buckaoo Banzi
-pete
|
|
|
|
|
WM_DRAWITEM is not sent to the owner draw control but to the owner window (the dialog it is on) of the control.
No need to subclass...
Oliver
|
|
|
|
|
I have created a List box using CreateWindow in my app's client area. Is there any way I can make the background of my list box transparent so that it is the same color as the background of my main window?
Thanks in advance,
Paddy.
|
|
|
|
|
Get the handle to the device context of the listbox (HDC) and use the Win32 function SetBkColor to set the color you want.
For more, see function SetBkColor in MSDN.
If you would like to use the same color as in your main window, you first have to get the standard color of your window, which is usually done by a call to GetSysColor.
Hope this helps,
-Dominik
|
|
|
|
|
ummm i don't believe that 'transparent' is the same as setting the background color to the same as the background window. Not to mention how do you know what window and what background color it is, and what about if it has something in it... or am I totaly lost?
"No matter where you go, there your are..." - Buckaoo Banzi
-pete
|
|
|
|
|
I understand what you are saying, they are not the same thing but for this particular case changing the background colour will work fine for me.
Thanks,
Paddy.
|
|
|
|
|
Thanks that exactly what I was looking for. I knew there was some simple way of doing it but I didn't know what to look for!
Paddy.
|
|
|
|
|
Hi,
I have some VC projects in which I can trace into the MFC classes like CDialog::OnInitDialog() and other projects that refuse to trace into the MFC classes. Sometimes not even a newly generated project is able to trace into the MFC classes.
Does anyone has any idea of what are the settings you need to use? I have carfuly compare the settings between the projects that allow me to trace into the MFC classes and the one that don't, but can not find anything different.
Any suggestions are welcome,
Daniel
Daniel
|
|
|
|
|
Do you mean 'step into'??
You would have to be missing the paths to the MFC code folders in your project settings I would think.
"No matter where you go, there your are..." - Buckaoo Banzi
-pete
|
|
|
|
|
Thanks for your answer.
By "Step into" I mean "Trace into", i.e. go into the source code for the MFC class.
The strange thing that I am experiencing is that some porjects will Trace into the MFC classes but other will not.
Your suggestion of checking the MFC folder settings is good and make sence but still doesn't explain why some projects won't work.
The Folder settings apply to the whole IDE independent of the project.
Still looking,
Daniel
|
|
|
|
|
Daniel Kamisnki wrote:
and other projects that refuse to trace into the MFC classes.
Which MFC classes?
Daniel Kamisnki wrote:
Your suggestion of checking the MFC folder settings is good and make sence but still doesn't explain why some projects won't work.
Can you able to trace into same MFC classes in another Project?
Follow live World Cup Cricket scores here[^]
|
|
|
|
|
MFC classes like CDialog!
Yes some project are abel to trace into the MFC classes but others don't. I am really confused too!
It is versy strage.
Daniel
|
|
|
|
|
Hi, Daniel.
i get the same trouble with stepping into MFC source code . it doesn't work in only one of my project. the others projects are okay .
if you solved this problem . please tell me .
thanks in advance.
|
|
|
|
|
Hi, everybody!
I am working on application where I need to provide some VML editing capabilities. I am pretty sure that MSHTML should serve me well here. Also while it provides a pretty easy way of designing HTML it lacks the VML editing capabilities. Right now I am looking into the IHTMLEditDesigner and IHTMLEditHost interfaces and wondering if I am on the right track.
Since I have not worked with MSHTML before I would greatly appreciate if somebody could give me a push in the right direction.
Thank you.
|
|
|
|
|
The best VML editor I am aware of is.... Office XP. When you save content as html, it adds vml along with mso to produce all vector content. From an outside app, Office automation looks shiny...
|
|
|
|
|
.S.Rod. wrote:
From an outside app, Office automation looks shiny...
Thanks for the reply. Unfortunatly automation won't do in this case. There is a big chance that MS Office (or required version of it) will not be installed on the target machine. In addition I need much more advanced control over HOW the user edits the document than the automation can offer.
Thanks again.
|
|
|
|
|
gradiov wrote:
I need much more advanced control over HOW the user edits the document than the automation can offer
I am not sure I understand. VML is a rendering format, which means you simply use Word/Excel/Powerpoint automation and edit your document with the standard object model, and only in the end save all that stuff as html+vml. Of course, doing so you don't directly edit VML tags, but for some apps this is more than enough already.
|
|
|
|
|
The thing here is that this is not just any VML document. The user is going to be creating a site plan (sort of the iteractive map) for the security system. As he creates it, he will be adding some predefined objects to it (such as buildings, hallways, rooms, doors etc.) and will have ability to add some misc graphics to it just to make it look pretty. I know how to write my own little graphics editor for that purpose. Also I figured that since there is thing like IWebBrowser control and MSHTML available, I could use it's editing capabilities and it's rederer (which, by the way, displays VML fine) to do the most of the work.
After looking in MSDN I was under the impression that I could extend the editor's capabilities by providing my own implementations of several interfaces ( IHTMLEditHost, IHTMLEditDesigner and IHTMLElementBehaviour, is there anything else(?)). Since Microsoft was not very clear on the purpose of those interfaces and none of the samples they had fully worked, I was wondering if going this way would get me where I want to be and if it would worth the effort.
Also you keep talking about automating the office application even after I mentioned that there is a good chance that the proper version of the office will not be installed on the client. Am I missing something here and I do not have to ship a copy of the Front Page with every installation?
Thanks for you help.
|
|
|
|