|
Sorry, but it doesn't help me.
On handling this message, i can decide to paint or not paint the background.
This is well doing, and my desired black background is already painting but not at the items background. That is my problem. The areas, where no item is 'overpainting' are black.
Any idea?
--------------------------------------------------
"Pseudocode is code to demonstrate a concept, not designed to be run.
Like certain Microsoft software. "
|
|
|
|
|
Use identical color with LVM_SETBKCOLOR and LVM_SETTEXTBKCOLOR (or CListCtrl::SetBkColor/SetTextBkColor if you're using MFC):
CListCtrl &lst = ...;
lst.SetBkColor(RGB(255, 0, 0));
lst.SetTextBkColor(RGB(255, 0, 0));
This should make all background red.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Attention please~~~
Hi~
I'm a University student preparing a graduation thesis, in Korea.
But in the process, there raised an obstacle, so I'm in stuck with a problem.
So now I sincerely call for your help...
As the question contains some images and source file, I make out html document file.
The address is http://my.netian.com/~sibuzigi/forsite.htm
I hope your quick and adequate answer.
p/s Please~~~ Somebody help me~~~!^^;;;;;;
|
|
|
|
|
the site is korean,, how do you expect an answer buddy?
Ehsan Behboudi
|
|
|
|
|
By reading Hangul. But that doesn't help when you get a page not found error.
|
|
|
|
|
Oh! I'm sorry! T.T......
I unloaded wrong URL by mistake.
So I correct now.
The address is http://my.netian.com/~sibuzigi/forsite.htm
please! help me!
|
|
|
|
|
The Windows GDI Platform SDK documentation for LOGFONT in MSDN states that the following can be used to set the font size in points when using the MM_TEXT mapping mode:
lfHeight = -MulDiv (PointSize, GetDeviceCaps (hDC, LOGPIXELSY), 72);
I've used this code to try to set the font height but it is unchanged at about 10/12 points height. Any ideas? My code is as follows:
BOOL CMyDialog::OnInitDialog () {
CDialog::OnInitDialog ();
GetFont ()->GetLogFont (&m_lf);
CDC* pDC = GetDC ();
m_lf.lfWeight = FW_BOLD;
m_lf.lfHeight = -MulDiv (8, GetDeviceCaps (pDC->hDC, LOGPIXELSY), 72);
CFont font;
font.CreateFontIndirect (&m_lf);
CWnd* pWnd = GetWindow (GW_CHILD);
while (pWnd != NULL) {
pWnd->SetFont (&font);
pWnd = pWnd->GetWindow (GW_HWNDNEXT);
}
return TRUE;
}
Derek.
|
|
|
|
|
You should make a modified font a class member, not a local variable. CWnd::SetFont (which wraps WM_SETFONT) doesn't create a font copy.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
I take it you mean the CFont, rather than the LOGFONT which is already a member (m_lf).
I'll try that, thanks.
|
|
|
|
|
If you just want to be able to set the font point size, use CreatePointFont(), it requires a handle to the device context....
CWindowDC dc(this);
CFont font;
font.CreatePointFont(120, "Times New Roman", &dc); //Creates 12 point Times New Roman Font
//The first value passed to the function should be 10x the point size you want.
|
|
|
|
|
How can I retrive and/or set NUM LOCK key state ???
Celebrate Mr. Cesilko!
|
|
|
|
|
GetKeyState or GetKeyboardState. The former gets the state of an individual key while the later gets the state for all.
|
|
|
|
|
I need to be able to use the ON_COMMAND_UPDATE_UI macro in a dialog. I was helpfully pointed to the WM_KICKIDLE private message and I have investigated how this works and what I need to do.
I have a class which inherits from CDialog to implement some common functionality across the dialogs I'll be using in my app. It includes changing the font for controls (a separate issue!) and enabling the handling described above.
Unfortunately it's not happening I have ON_MESSAGE(WM_KICKIDLE, OnKickIdle) in the message map and a LRESULT CMyDialog::OnKickIdle(WPARAM wp, LPARAM lp) function and there is an afx_msg LRESULT OnKickIdle(WPARAM wp, LPARAM lp); defined in the header file.
Using Spy++ I can see that the WM_KICKIDLE message is being posted for a standard CDialog-derived class that doens't include the handling, but it isn't being posted for my classes that derive from CMyDialog
Any thoughts?
|
|
|
|
|
I believe you need to call the following function in KickIdle
UpdateDialogControls(this, FALSE);
Christian
#include "std_disclaimer.h"
The careful application of terror is also a form of communication.
Eagles may soar, but weasels don't get sucked into jet engines.
|
|
|
|
|
I thought I'd found the problem having read an article at Earthweb. It seems that the process falls apart for modeless dialogs.
Apparently you are supposed to handle WM_KICKIDLE in the parent and manually post it to any child dialogs.
Unfortunately I've tried this and using Spy++ I can see that the dialogs are receiving the posted messages, but my code isn't handling them. My OnKickIdle function never gets called
|
|
|
|
|
WM_KICKIDLE shouldn't be used any more from memory. Instead use WM_IDLEUPDATECMDUI and call UpdateDialogControls() from your message handler.
I do this in ED4W and it all works very well.
Neville Franks, Author of ED for Windows
www.getsoft.com
|
|
|
|
|
Thanks. I'll try that instead
|
|
|
|
|
I've made the change to WM_IDLE_UPDATECMDUI but it's still not working. The dialgo is receiving the messages (as seen in Spy++), but the message handler isn't being called.
|
|
|
|
|
You may need to add a message handler to your CMainFrame class as well. I can't check my code right now I'm afraid, but I will and let you know.
In the mean time go to MSDN and do a search on WM_IDLEUPDATECMDUI
I can assure you it works.
Neville Franks, Author of ED for Windows. Version 4.01 just released, with a C++ Class View that actually works.
www.getsoft.com
|
|
|
|
|
My application is entirely dialog-based.
|
|
|
|
|
Maybe MFC sample DLGCBR32 will help? It demonstrates the dialog-based app with a toolbar. It uses WM_IDLEUPDATECMDUI and ON_UPDATE_COMMAND_UI handlers.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Help! This is sort of related your problem of a window receiving a message but not processing it. The message maps I created for the class inherited from CView don't work.
The COpenGLView class I describe below is the toplevel window when the application is run. I know that the window receives the message I send it from another application because I monitor the messages sent to that window using Spy++. But it doesn't seem to be processing that message I send it, even though it receives the message...
help... i'm at wits' end. thanks.
<br />
<br />
#define UM_MYMESSAGE WM_USER + 1<br />
...<br />
class COpenGLView : public CView<br />
{<br />
... <br />
DECLARE_DYNCREATE(COpenGLView) <br />
DECLARE_MESSAGE_MAP()<br />
... <br />
void OnMyMessage (WPARAM wParam, LPARAM lParam );<br />
...<br />
}<br />
<br />
#include "OpenGLView.h"<br />
<br />
BEGIN_MESSAGE_MAP(COpenGLView, CView) <br />
ON_MESSAGE( UM_MYMESSAGE, OnMyMessage )<br />
END_MESSAGE_MAP()<br />
<br />
...<br />
<br />
void COpenGLView::OnMyMessage (WPARAM wParam, LPARAM lParam )<br />
{ <br />
::MessageBox( NULL, _T("Hi"), _T("Hi"), MB_OK);<br />
}<br />
<br />
<br />
#define UM_MYMESSAGE WM_USER + 1<br />
...<br />
<br />
void CMyDialog::OnButtonFoo() <br />
{ <br />
HWND hwnd_lh = ::FindWindow( NULL, _T("OpenGL") );
::SendMessage( hwnd_lh, UM_MYMESSAGE, (WPARAM) NULL, (LPARAM) NULL );<br />
}<br />
|
|
|
|
|
I can't see how COpenGLView can be your top level window. This is a view within your MainFrame. It would seem to me that your other app is sending to the MainFrame window not the View.
Neville Franks, Author of ED for Windows
www.getsoft.com
|
|
|
|
|
ooops, you're completely right. i should have my wrists slapped for not taking the time out to really understand the document/view architecture. i am now rerouting the message to COpenGLView, which is a child of the the mainframe window. thanks.
|
|
|
|
|
Thanks for everyone's help with this one. Finally it works
The end result was to handle WM_KICKIDLE , as my parent dialog wasn't receiving any WM_IDLEUPDATECMDUI messages. I then had to use SendMessage to pass the message on to all of the child dialogs because PostMessage didn't work.
|
|
|
|