How to subclass an MFC window?

Is there any easy way of overriding the responses to some messages to a 
CWnd-derived object buried deep within MFC?

One reason for the question is:

In the old days CMainFrame was derived from CMDIFrameWnd and this had a 
member

HWND m_hWndMDIClient;

To draw the background of this window I used to do a

SubclassWindow( )

on it, and with my own CWnd-derived object, respond to WM_ERASEBKGND 
messages.

Nowadays CMainFrame is derived from CMDIFrameWndEx and this has a member

CMDIClientAreaWnd m_wndClientArea;

and (I think) because a CWnd object already exists for the MDI client area, 
then SubclassWindow() doesn't work on it.

A second reason is that CMFCToolBar etc come with a customisation property 
sheet, and I am considering what I might do to override one of its property 
pages.

[I used to think that I knew MFC quite well - but all these new classes have 
thrown me somewhat!]

Dave
-- 
David Webber
Mozart Music Software
http://www.mozart.co.uk
For discussion and support see
http://www.mozart.co.uk/mozartists/mailinglist.htm



 

0
David
6/25/2010 3:14:02 PM
vc.mfc 33608 articles. 0 followers. Follow

9 Replies
4861 Views

Similar Articles

[PageSpeed] 53

>Nowadays CMainFrame is derived from CMDIFrameWndEx and this has a member
>
>CMDIClientAreaWnd m_wndClientArea;
>
>and (I think) because a CWnd object already exists for the MDI client area, 
>then SubclassWindow() doesn't work on it.

I wonder if you can handle the message some other way - perhaps in the
application's PreTranslateMessage handler?

Dave
0
David
6/25/2010 3:54:23 PM

"David Lowndes" <DavidL@example.invalid> wrote in message 
news:44k926hsb0voea68aeerl1r2vdq21i9btc@4ax.com...

>>Nowadays CMainFrame is derived from CMDIFrameWndEx and this has a member
>>
>>CMDIClientAreaWnd m_wndClientArea;
>>
>>and (I think) because a CWnd object already exists for the MDI client 
>>area,
>>then SubclassWindow() doesn't work on it.
>
> I wonder if you can handle the message some other way - perhaps in the
> application's PreTranslateMessage handler?

Sounds like a plausible idea for one message for that particular window - 
thanks.

But it sounds pretty horrible for a whole property page and all its 
controls.    BUT.....

Please forgive me if I think aloud here, as something might be dawning on me 
in real time as I type.

The App Wizard has given me:

void CMainFrame::OnViewCustomize()
{
  CMFCToolBarsCustomizeDialog* pDlgCust
        = new CMFCToolBarsCustomizeDialog(this, TRUE);
  pDlgCust->EnableUserDefinedToolbars();
  pDlgCust->Create();
}

so I can derive a class from CMFCToolBarsCustomizeDialog, and use that 
instead.

This is a property sheet with a number of property pages, including

  CMFCToolBarsKeyboardPropertyPage*  m_pKeyboardPage;

which allows the user to set a new keyboard shortcut.   No whilst I can't 
easily get at the property *page*,  the property *sheet* (which I *can* 
subclass) has lots of virtual members, including

    virtual BOOL OnAssignKey( ACCEL *pAccel ) { return TRUE; }

It *looks* like this gets called with the newly selected accelerator, and I 
can do what I want with it and return FALSE to tell MFC to ignore it!

This is looking very promising!!!!!!!!

Background:
Shortcut keys like ^ > + - are very useful mnemonics for music applications. 
Equally Ctrl+> etc are very useful shortcuts.
But I want it to appear as Ctrl+> on the menu, and not Ctrl+Shift+.
And I want to define these shortcuts for all national keyboards (even if > 
isn't Shift+.)
Accelerators are not up to the job, so I rolled my own method, built into 
WM_KEYDOWN and WM_CHAR processing.  Maybe I *will* be able to integrate it 
with the new customisable toolbars!!!!
A nice thought on which to end the week (especially as I'm out all weekend 
playing on bandstands.)

Dave
-- 
David Webber
Mozart Music Software
http://www.mozart.co.uk
For discussion and support see
http://www.mozart.co.uk/mozartists/mailinglist.htm

 

0
David
6/25/2010 5:30:15 PM
This is remarkably ugly, but something like this should work...

First, have a window subclass that you want.  I'll call it CMySubclass

void CMyApp::RedrawClientArea()
   {
    CMySublcass w;
    w.Attach(m_wndClientArea.Detach());
    w->Invalidate();
    w->UpdateWindow();
    m_wndClientArea.Attach(w.Detach());
   }

Overall, this is pretty gross.  Also, I have not figured out quite where you would need to
call this, but I'd suspect this is one of the interesting uses of PreTranslateMessage,
looking for a WM_PAINT directed to the client area (in that case, the Invalidate() would
not be required)
				joe

On Fri, 25 Jun 2010 16:14:02 +0100, "David Webber" <dave@musical-dot-demon-dot-co.uk>
wrote:

>Is there any easy way of overriding the responses to some messages to a 
>CWnd-derived object buried deep within MFC?
>
>One reason for the question is:
>
>In the old days CMainFrame was derived from CMDIFrameWnd and this had a 
>member
>
>HWND m_hWndMDIClient;
>
>To draw the background of this window I used to do a
>
>SubclassWindow( )
>
>on it, and with my own CWnd-derived object, respond to WM_ERASEBKGND 
>messages.
>
>Nowadays CMainFrame is derived from CMDIFrameWndEx and this has a member
>
>CMDIClientAreaWnd m_wndClientArea;
>
>and (I think) because a CWnd object already exists for the MDI client area, 
>then SubclassWindow() doesn't work on it.
>
>A second reason is that CMFCToolBar etc come with a customisation property 
>sheet, and I am considering what I might do to override one of its property 
>pages.
>
>[I used to think that I knew MFC quite well - but all these new classes have 
>thrown me somewhat!]
>
>Dave
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
Joseph
6/26/2010 9:53:55 PM
"Joseph M. Newcomery" <newcomer@flounder.com> wrote in message 
news:j2qc26pnsge8f50k0c8jatcst7ae6n93ii@4ax.com...

> This is remarkably ugly, but something like this should work...
>
> First, have a window subclass that you want.  I'll call it CMySubclass
>
> void CMyApp::RedrawClientArea()
>   {
>    CMySublcass w;
>    w.Attach(m_wndClientArea.Detach());
>    w->Invalidate();
>    w->UpdateWindow();
>    m_wndClientArea.Attach(w.Detach());
>   }
>
> Overall, this is pretty gross.  Also, I have not figured out quite where 
> you would need to
> call this, but I'd suspect this is one of the interesting uses of 
> PreTranslateMessage,
> looking for a WM_PAINT directed to the client area (in that case, the 
> Invalidate() would
> not be required)

I vaguely wondered about something like that.  When it says that 
SubclassWindow only works for an HWND with no CWnd attached, the immediate 
question is why?   The next question is - well if we remove the attached 
CWnd, what then?

If we take your suggestion one step further:  suppose I derive CMySubclass 
from the CWnd-derived class which was attached in the first place.  Then I 
could detach the original and attach mine, and leave it attached, with no 
apparent penalties.   But if it is as easy as that, why doesn't 
SublassWindow just do it?   I guess the originally attached class may itself 
have some data necessary to the correct functioning of the window?

I feel I am walking on eggshells here.

Dave
-- 
David Webber
Mozart Music Software
http://www.mozart.co.uk
For discussion and support see
http://www.mozart.co.uk/mozartists/mailinglist.htm 

0
David
6/26/2010 10:39:23 PM
See below...
On Sat, 26 Jun 2010 23:39:23 +0100, "David Webber" <dave@musical-dot-demon-dot-co.uk>
wrote:

>
>"Joseph M. Newcomery" <newcomer@flounder.com> wrote in message 
>news:j2qc26pnsge8f50k0c8jatcst7ae6n93ii@4ax.com...
>
>> This is remarkably ugly, but something like this should work...
>>
>> First, have a window subclass that you want.  I'll call it CMySubclass
>>
>> void CMyApp::RedrawClientArea()
>>   {
>>    CMySublcass w;
>>    w.Attach(m_wndClientArea.Detach());
>>    w->Invalidate();
>>    w->UpdateWindow();
>>    m_wndClientArea.Attach(w.Detach());
>>   }
>>
>> Overall, this is pretty gross.  Also, I have not figured out quite where 
>> you would need to
>> call this, but I'd suspect this is one of the interesting uses of 
>> PreTranslateMessage,
>> looking for a WM_PAINT directed to the client area (in that case, the 
>> Invalidate() would
>> not be required)
>
>I vaguely wondered about something like that.  When it says that 
>SubclassWindow only works for an HWND with no CWnd attached, the immediate 
>question is why?   The next question is - well if we remove the attached 
>CWnd, what then?
****
When an HWND is placed in a CWnd-derived class (as the m_hWnd), an entryis made in the
handle map for that thread.  If, in the future, someone delivers an HWND (say, a message
is received), the way the methods are found is to use the handle map to obtain the CWnd*
pointer; in the case of message dispatching, from the CWnd* reference, the message map is
found.  Note that in general if the lookup fails, a *temporary* CWnd* reference is
generated, which is deleted in the CWinApp::OnIdle handler.  This is why there all all the
warnings about the CWnd* reference being temporary, and that it must not be stored.

So you cannot have an HWND mapped to two different CWnd-derived objects.  Hence the ugly
detach/attach code I gave;  the Attach code creates a new mapping of an newly-unattached
HWND.

Note that when an Attach (or SubclassWindow, which ultimately does an Attach) occurs, the
handle is looked up in the handle map.  It had better return an error coden (handle not
found), otherwise, there is an ASSSERT failure that there is an attempt to create a handle
map entry for an HWND which is already mapped.
*****
>
>If we take your suggestion one step further:  suppose I derive CMySubclass 
>from the CWnd-derived class which was attached in the first place.  Then I 
>could detach the original and attach mine, and leave it attached, with no 
>apparent penalties.   But if it is as easy as that, why doesn't 
>SublassWindow just do it?   I guess the originally attached class may itself 
>have some data necessary to the correct functioning of the window?
****
Actually, there are penalties; messages directed to that window will not be handled by the
class of the m_wndClientArea.  Presumably, this will not be healthy for your app.

And, as I indicated, SubclassWindow *cannot* work correctly if the HWND is already mapped!
It is considered erroneous to let SubclassWIndow map an HWND to some other CWnd* when it
is already mapped to a CWnd*.  So the code I showed (remember, I said it was gross and
ugly) creates a *temporary* remapping only in the cases where you need it.  Otherwise, the
mapping is left at the correct class for the new framework, so it continues to work
correctly.

				joe
****
>
>I feel I am walking on eggshells here.
>
>Dave
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
Joseph
6/27/2010 12:31:32 AM
A friend who wrote an analogously ugly piece of code used "ASCII Art" to draw a
skull-and-crossbones in the function header comments, and quoted the Unix kernel's
context-swap code: "You are not meant to understand this"
					joe
On Sat, 26 Jun 2010 23:39:23 +0100, "David Webber" <dave@musical-dot-demon-dot-co.uk>
wrote:

>
>"Joseph M. Newcomery" <newcomer@flounder.com> wrote in message 
>news:j2qc26pnsge8f50k0c8jatcst7ae6n93ii@4ax.com...
>
>> This is remarkably ugly, but something like this should work...
>>
>> First, have a window subclass that you want.  I'll call it CMySubclass
>>
>> void CMyApp::RedrawClientArea()
>>   {
>>    CMySublcass w;
>>    w.Attach(m_wndClientArea.Detach());
>>    w->Invalidate();
>>    w->UpdateWindow();
>>    m_wndClientArea.Attach(w.Detach());
>>   }
>>
>> Overall, this is pretty gross.  Also, I have not figured out quite where 
>> you would need to
>> call this, but I'd suspect this is one of the interesting uses of 
>> PreTranslateMessage,
>> looking for a WM_PAINT directed to the client area (in that case, the 
>> Invalidate() would
>> not be required)
>
>I vaguely wondered about something like that.  When it says that 
>SubclassWindow only works for an HWND with no CWnd attached, the immediate 
>question is why?   The next question is - well if we remove the attached 
>CWnd, what then?
>
>If we take your suggestion one step further:  suppose I derive CMySubclass 
>from the CWnd-derived class which was attached in the first place.  Then I 
>could detach the original and attach mine, and leave it attached, with no 
>apparent penalties.   But if it is as easy as that, why doesn't 
>SublassWindow just do it?   I guess the originally attached class may itself 
>have some data necessary to the correct functioning of the window?
>
>I feel I am walking on eggshells here.
>
>Dave
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
Joseph
6/27/2010 12:33:40 AM
"Joseph M. Newcomer" <newcomer@flounder.com> wrote in message 
news:dc6d26psjoevppsmkueotlvhiq7o78h3i5@4ax.com...

>>I vaguely wondered about something like that.  When it says that
>>SubclassWindow only works for an HWND with no CWnd attached, the immediate
>>question is why?   The next question is - well if we remove the attached
>>CWnd, what then?
> ****
>
> [Can't attach an HWND to two CWnds]....

Yes I can see this - replacing the CWnd would be the only option.

> Actually, there are penalties; messages directed to that window will not 
> be handled by the
> class of the m_wndClientArea.  Presumably, this will not be healthy for 
> your app.

But if I derived my window class from CMDIClientAreaWnd then presumably the 
only danger would be that any data members it had would be different from 
the original  CMDIClientAreaWnd m_wndClientArea.

Still maybe that's danger enough.

> And, as I indicated, SubclassWindow *cannot* work correctly if the HWND is 
> already mapped!
> It is considered erroneous to let SubclassWIndow map an HWND to some other 
> CWnd* when it
> is already mapped to a CWnd*.  So the code I showed (remember, I said it 
> was gross and
> ugly) creates a *temporary* remapping only in the cases where you need it. 
> Otherwise, the
> mapping is left at the correct class for the new framework, so it 
> continues to work
> correctly.

Yes I realise that.  I think your 'gross and ugly' is my 'walking on 
eggshells'.  :-)

Dave
-- 
David Webber
Mozart Music Software
http://www.mozart.co.uk
For discussion and support see
http://www.mozart.co.uk/mozartists/mailinglist.htm
 

0
David
6/27/2010 9:31:59 AM
On Jun 25, 5:14=A0pm, "David Webber" <d...@musical-dot-demon-dot-co.uk>
wrote:
> Is there any easy way of overriding the responses to some messages to a
> CWnd-derived object buried deep within MFC?
>
> One reason for the question is:
>
> In the old days CMainFrame was derived from CMDIFrameWnd and this had a
> member
>
> HWND m_hWndMDIClient;
>
> To draw the background of this window I used to do a
>
> SubclassWindow( )
>
> on it, and with my own CWnd-derived object, respond to WM_ERASEBKGND
> messages.

How about just putting a window of your own into m_wndClientArea and
doing your drawing in that, then?

Goran.
0
Goran
7/1/2010 11:25:12 AM

"Goran" <goran.pusic@gmail.com> wrote in message 
news:a18e04e3-fa94-40a3-a651-ba96b83817b6@k39g2000yqb.googlegroups.com...
> On Jun 25, 5:14 pm, "David Webber" <d...@musical-dot-demon-dot-co.uk>
> wrote:

>> Is there any easy way of overriding the responses to some messages to a
>> CWnd-derived object buried deep within MFC?
>>
>...
>
> How about just putting a window of your own into m_wndClientArea and
> doing your drawing in that, then?

Unfortunately the m_wndClientArea being difficult to get at, I suspect it 
would be diificult to give it children.    Surely getting at its 
WM_ERASEBKGD should be easier?   But thanks for the idea - a bit of lateral 
thought is always welcome :-)

Dave

-- 
David Webber
Mozart Music Software
http://www.mozart.co.uk
For discussion and support see
http://www.mozart.co.uk/mozartists/mailinglist.htm 

0
David
7/1/2010 5:55:23 PM
Reply:

Similar Artilces:

Open a hard disk repertory with a MFC
Hello , I want to know how i do to open a hard disk repertory with a simple button in a MFC application (exe) because i want to chose a file in my hard drive. Moreover, can i take the size of the file ? Thank you Are you asking to open a file? CFileDialog is what you want. For directory picking, use SHBrowseForFolder. --- Ajay Is something like this what you are looking for? http://www.codeguru.com/cpp/controls/combobox/article.php/c1815/ Tom <john.ambou@free.fr> wrote in message news:1144936998.318257.115040@u72g2000cwu.googlegroups.com... > Hello , > > I want to kno...

Window Service
Hi all, I have created a NT service ( in vc++ 6.0) which can run my prog. as service. My problem is that my prog. should run when a user logs in and take user-id for its working and stop as soon as the user log off. Can anybody help me in solving this problem. Any APIs ? Thanks Suriya Hi, If you just want to run your program only when your user logsin in and want to stop working when it logs off, why do you want to make a service ?? it should just be put in start up or in registry with run folder.. No need to develop a service.. ============== Regards, Jigar Mehta "Suriya" &l...

Changing display name in Windows Mail
Currently my email in Windows Mail displays just my wife's name when a person receives an email from us. Would like to change that to both of our names?? Please help? Thank you In Windows Live Mail go to Tools, Accounts, select that account, click = Properties. On the General tab, make changes to the Name field as desired. Click OK. --=20 Gary VanderMolen, Microsoft MVP (Mail) Microsoft MVP program: http://mvp.support.microsoft.com "pickle" <pickle@discussions.microsoft.com> wrote in message = news:F4162B8D-0520-47DE-8F3A-13172B38D7A8@microsoft.com.....

MFC Sockets Query?
Hi experts This is my first experience with Sockets Programming. I am purely using MFC on both sides -- Server(Dialog based application with 3 buttons <Start server, Send data & shutdown server>). The client application is an Windows explorer type MFC SDI application. After the connection is established & when the <Send data> button is clicked on the server side, names of all the folders in C:\ is send one by one to the client for display in the tree view. Now i have 2 questions to ask: Q1--> How can i make sure that the Port No. that i will provide in the Create() wi...

Subclassing
Hello, Im very new to c++ programming so pardon me if this is a dumb question and my bad english. I made a subclass from CListBox. I want to handle all the list controls derived from this class on one function, for example, void CListBox_SC::OnRButtonUp(UINT nFlags, CPoint point) { ..... } on this function I want to manage the OnRButtonUp event, and with a switch or if statement, select the code to execute. The following does work: SetCurSel(ItemFromPoint(point, ifp)); but the following comparison is never true, (IDC_LST_TIPO is a resource for one of the ListBoxes) UINT currLst = It...

Publisher 2000, Windows XP Home, file locked across network
I found this question posted already, and tried to add to it as I'm having the same problem. My post hasn't shown up after a few hours, so I'm tying a new thread. Had a Windows95 peer to peer network set up. Running Publisher 2000 and other apps. Was sharing all data files on one station. All was well. Swapped out the workstations with new Windows XP Home workstations. Copied all the files over, reinstalled the applications. All of the old files can be opened across the network without issue. (including Publisher 2000) However, when a NEW publisher document is created, I...

"locate link browser" window in Windows 7 and Outlook 2003
Every time I click on a link in an email in Outlook, a "locate link browser" window appears. There's a lot of help on the web to fix it for Win XP, but those steps don't appear to work for Windows 7. I tried pointing it to iexplorer.exe and the window isn't coming up anymore, but it just launches IE and my home page... not the link that was in the email. Can anyone help? KSieg wrote: > Every time I click on a link in an email in Outlook, a "locate link browser" > window appears. There's a lot of help on the web to fix it for Win...

Custom Drawing CEdit : Subclassing
Hello experts, My objective is simple, but I'm not entirely sure what needs tweaking. I am using MSVC 6, and I would like to subclass the CEdit box so that it appears as the color-picker editbox of a PropertyGrid. There is a color box followed by three values. Like this: [###] 255; 192; 192 Where ### is just a color box representation of the value. So thus far, I've made a masked CEdit box, where I can edit the numbers (or click a button that visually sets the numbers from a different window), and I'm happy with that - but what I would like to do next is to subclass the dra...

Windows File Protection and Registering a Non-System File
Hi All, I apologize if this is a bit off topic. The group generally has high acivity with authors who can discuss higher level protocols... I'd like to register some files with Windows File Protection. I know if one authors a driver, Microsoft will sign it and it will enjoy protection (some hand waving here). The reason I'd like to do it is to stop malicious tampering (binary patching from the Reverse Engineers). Is this possible? I don't see how to auto enroll if not signed by Microsoft. Reference http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/s...

Windows Server 2008 64bit with HQ Client
Anybody running RMS 2.0 HQ Client on a Windows Server 2008 64bit operating system succesfully? we are trying to get our server running, but we are getting an error that we are missing a file. 'c:\windows\system32\Richtx32.ocx' If you are running this same atmosphere, could I please get a copy of this file that our system is apparently missing? I do have Microsoft involved, but they are being sssssssllllllloooooooooooowwwwwww at getting this resolved. please contact me directly if you do have hq client running on Win2008 64bit. andym@directpos.com 208-376-8121 x244 -...

Contacts Window
I can no longer access new contact information from the Contacts window in my e-mail. I cannot make new groups either. I have to add new contacts by clicking on file, then new contact. Can anyone help me? Missing buttons from the Windows Contacts toolbar http://www.vista4beginners.com/Missing-buttons-from-Windows-Contacts-toolbar Vista - "New Contact" and "New Contact Group" Button Missing http://www.vistax64.com/tutorials/186477-new-contact-new-contact-group-button-missing.html -- Bruce Hagen MS-MVP [Mail] Imperial Beach, CA ...

[MFC + DAO] Data selection
Hi, I've connection to database ( .mdb file) In one of tabels i've some fields: e.g like those: idTab - Autonumering idWho - Number idOK - Number idBad - Number And what i want to do is: const char pszIDTabFind[] = "idTab = %s "; CString strId - ID taken from another table CString str; str.Format( pszIDTabFind, strID ); RS.FindFirst ( str ); And what i get? An exception:/ !! Sth like : "Operation for this object is not supported" Why i can't find any data? What's more if i search for strings everything goes ok. Could You please tell me how should i...

Outlook2003 Windows installer problem
I am running Windows XP Home Edition and have just installed Office 2003. On accessing Outlook for my email, I get a grey Windows Installer box which then trys to install itself. It trys to access the hard disk seven times and then closes down. Pressing the Cancel button on the box does not stop it. Has anyone any suggestions, I have unistalled Office and then re-installed it again in an attempt to rectify the problem. Heres hoping someone can help? Thanks. -- Elligems ...

MFC vs. Forms
I am building a DirectX app and chose MFC basically because there was plenty of sample code for integrating DirectX renders into an MFC app. I had heard that Forms were the new thing and MFC was old. Is this true? I had no sample Forms code for doing a DirectX/Windows app so I am hoping MFC is not being replaced. Can anyone educate me on the differences and what people are using the most? Forms are a way of writing apps. MFC is a way of writing apps. No particular reason to call one "modern" and one "old". For example, a dialog-based app in MFC is essentially impossibl...

Windows mail
When I go to my Windows Mail account I have to sign on each time. I receive a message as follows: Account: 'mail.comcast.net', Server: 'mail.comcast.net', Protocol: POP3, Port: 110, Secure(SSL): No, Error Number: 0x800CCC17 I can sign in and receive and send messages; however, when I exit my Windows Mail and return, I have to sign in all over again. Any help will be appreciated. -- HiTider A likely reason for the username/password failing is account corruption. One thing you should try as a possible quick fix is to delete that = corrupted=20 mail accou...

tables for a window
There used to be a way (not Modifier) where I can have Great Plains show the tables linked to the current Great Plains window. I have forgotten it. can you please let me know. I believe you're looking for the Window Descriptions. If that's the case, go to Tools>> Resource Descriptions>> Windows. Leeland "Jack Tundra" wrote: > There used to be a way (not Modifier) where I can have Great Plains show the > tables linked to the current Great Plains window. I have forgotten it. can > you please let me know. > > > No, this is somethin...

keystroke in MFC(Dialog app)
hi I am trying to capture the keyboard input user press in my application i have declared the message WM_KEYUP and WM_KEYDOWN and their correspoding function also get declared void CTeestDlg::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags) { MessageBox("Key Presses"); CDialog::OnKeyDown(nChar, nRepCnt, nFlags); } now when user press any key in my dialog application message box should be displayed but nothing happend no message box displayed I also used the break point in side this function but no break point is called .... please let me know how to solve this problem T...

Help with subclassing a RichEditCtrl
Hi folks, I could use some help. As a side project I am trying to write a DLL that will extend the functionality of an existing application that I do not have source code for, i.e., some autocompletion functionality, word lookup, etc. In the actual DLL, I am going to have to inject it into the existing app and then use FindWindow or something like that to subclass the existing RichEditCtrl. I need to be able to process the WM_CHAR and WM_KEYDOWN messages only. I started out by creating my own sample project using a RichEditCtrl in my project to code my object. I've now moved everythin...

ActiveX event in MFC (VC++ 2003 Pro)
I'm using Visual Studio 2003. I cannot figure out how to add a custom event to an ActiveX control that I create using MFC. I follow these steps: 1. Create new project of type "MFC ActiveX Control" 2. Accept all project defaults 3. Open the class view 4. Expand "ActiveXProjLib" 5. Right-click "_DActiveXProjLibEvents" There's no Add->Add Event menu item. Just options to add methods and properties. So, I figured that just adding a "method" to the event interface might get the job done. Nope. I'm clearly missing something funda...

SIZE Window, Tile, Worksheet, Workbook, Whatever it's called.
Is it the tile, the window whatever you call it when you call it it's proper name it is my project. The part inside the main excel window is smaller than the main excel window and I can't maximize it. I can max and min the main window but not the tile. I thought it was a tile so I will, until corrected, call it the tile. The help menu says to either double click the title bar OR left click the box at the top right of the title bar. If I could make either of those happen I would not be writeing this. If I close the said project and open another excel file, new or completed, ...

Exploring MFC Source code
Hi, I am just want to get a little acquaint on the MFC source code. There isn't any project files for .NET 2002. Just a makefile. So how to see it from head to tail? Thanks Jack Hello Jacky, > Hi, > I am just want to get a little acquaint on the MFC source code. There > isn't > any project files for .NET 2002. Just a makefile. So how to see it > from head > to tail? Thanks Its all installed on your machine. You can look at the installation directory, but the best way to understand most aspects of MFC would be to build a simple SDI app (in debug configuration...

Windows won't shut down
WindowsXP Pro Sp3 IE8 The blue screen with the message "Windows is shutting down" hangs and will not close. - Ray _________________________________________________ Check task manager to see what is running just before you shut down. "Ray" <rbarone@nwi.net> wrote in message news:%23Vb7JYP1KHA.776@TK2MSFTNGP04.phx.gbl... > WindowsXP Pro Sp3 IE8 > > The blue screen with the message "Windows is shutting down" hangs and will > not close. > > - > Ray > _________________________________________________ > ...

Enjoy the Blu-ray on Your Windows Movie Maker
Enjoy the Blu-ray on Your Windows Movie Maker &nbsp; [b]Windows Movie Maker[/b] is video creating/editing software, included in Microsoft Windows. It contains features such as effects, transitions, titles/credits, audio track, timeline narration, and Auto Movie. New effects and transitions can be made and existing ones can be modified using XML code. Windows Movie Maker is also a basic audio track-editing program. It can apply basic effects to audio tracks such as fade in or fade out. The audio tracks can then be exported in the form of a sound file instead of a video file. As w...

Mixing ATL/MFC in VS2005
Does anyone know of some sample code created using VS2005 that implements an out-of-proc COM server mixing MFC and ATL. I tried creating one from scratch but the wizard no longer allows MFC support in an ATL .EXE. Thanks, Drew On Mon, 11 Jun 2007 16:38:45 -0500, "Drew" <dam@dam.dam> wrote: >Does anyone know of some sample code created using VS2005 >that implements an out-of-proc COM server mixing MFC and ATL. >I tried creating one from scratch but the wizard no longer allows >MFC support in an ATL .EXE. > >Thanks, >Drew > Here's a freeware pr...

can i use office 2000 on windows XP and what is the pricing of 20.
Hi Sherree. (1) Yes (2) Check Ebay, perhaps. --- Regards, Norman "Sherree" <Sherree@discussions.microsoft.com> wrote in message news:3AC7EC94-F748-4014-BED0-D87DA24DDF74@microsoft.com... > thanks, youve been very helpful "Norman Jones" wrote: > Hi Sherree. > > (1) Yes > > (2) Check Ebay, perhaps. > > --- > Regards, > Norman > > > > "Sherree" <Sherree@discussions.microsoft.com> wrote in message > news:3AC7EC94-F748-4014-BED0-D87DA24DDF74@microsoft.com... > > > > > ...