Subclassing problem???

Hi there, I've got:


    DefWindowProc(hwnd, uMsg, wParam, lParam);

    return TRUE;
  case WM_NCPAINT:
   DefWindowProc(hwnd, uMsg, wParam, lParam);

 DefWindowProc(hwnd, uMsg, wParam, lParam);

void CreateText(HWND hwnd){
 HDC hDC = GetWindowDC(hwnd);

 int x,y;
 RECT rc1,rc2;
 GetWindowRect(hwnd, (LPRECT)&rc2 );

 x = GetSystemMetrics(SM_CXSIZE) + GetSystemMetrics(SM_CXBORDER) +
 y = GetSystemMetrics(SM_CYFRAME);
 rc1.left = x; = y;

 rc1.right = rc2.right - rc2.left - 2*x - GetSystemMetrics(SM_CXFRAME);
 rc1.bottom = GetSystemMetrics(SM_CYSIZE);

 SetBkColor( hDC, GetSysColor(COLOR_ACTIVECAPTION) );
 DrawText(hDC,(LPSTR)"Left Justified Caption",-1,(LPRECT)&rc1,DT_LEFT);

The thing is painting the text but it is not painting the rest of the
window, which really messes up the program...any ideas please? Thanks in


icky (9)
7/27/2003 9:08:45 PM
vc.mfc 33608 articles. 0 followers. Follow

0 Replies

Similar Articles

[PageSpeed] 16


Similar Artilces:

Business Portal 10.0 install problem
I am trying to install Business Portal 10.0. I have upgraded my Share Point Services to 3.0, deleted the old default web site on port 80, and created a new default website on port 80. Whe I try to run the BP install it gets to the point where it asks if you want to install on a new web site or in an already existing website but it will not recognize the new sharepoint 3.0 deafult website I just created. I can go to http:\\servername\sites\business portal and get a sharepoint page, but the install doesn't bring up that site in the combo box. Anyone else seen this problem? On Apr...

Color Pallete Problem
I loaded Excel 2002 on Windows XP a few weeks ago. I did not change the default color pallet. However, all of a sudden the pallet on some workbooks changed and when I open 2 workbooks (1 with the correct default pallet, and 1 that somehow got modified), the 1st workbook takes on the pallet of the 2nd modified workbook. Very annoying to know that I highlited a cell in orange, but because I have a 2nd workbook open, that cell is now some brown color. I have tried reinstalling MS Office. I can't copy the pallet from one workbook to another because the problem is that the default pallet is th...

Font Problem
Why does my font change unexpectedly when the email is sent in Outlook 2002? I also have all recent service packs through SP3. I use HTML. I've tried the Mail Format tab options to change the fonts to always use my fonts and set everything to 10pt arial. It still arbitrarily changes its font size for no reason somtimes. Thanks ...

Problem with image links
Hi! I have some leaflets that I'm making with Publisher 2003. My main computer where my work folder is: C:\Documents and Settings\El Bimbo\My Documents\Leaflets This folder is also shared to network. I made my last leaflet with my notebook via network, so path to my leaflet-folder was: Z:\Leaflets I have almost 500 images in my leaflet and I have linked all the images to my work file - simply because it's much faster to work that way. All the images are same folder as my Publisher work file. Now when I open my work file with main computer from C:\Documents and Settings\El Bi...

Laptop problem
I encountered few times of a problem when I closed the lid but could not get the screen turn on. When I was travelling on a train working with my laptop, I need to close the lid when someone to get off the train. Then I opened the lid but the screen was turn off, the powere was still on. No matter I pressed the space bar, enter key, power button...etc, the screen was still dard. Any idea how do I get the screen back in this situation? Alan T wrote: > I encountered few times of a problem when I closed the lid but > could not get the screen turn on. > > Whe...

Problem using CPropertySheet over CFormView
Hi! I have three views in an MFC SDI application, split using CSplitterWnd. And in one of the views we have some edit controls and gird controls. In the same view, on selection of a menuitem, I create a modeless CPropertySheet with two pages and place it over the edit controls. Now on clicking the property sheet, I am getting the overlapped display of editcontrols in the view. How can I avoid this. Please help. Thanking you in anticipation. Best Regards! Babu PSM Babu wrote: > Hi! > > I have three views in an MFC SDI application, split using > CSplitterWnd. > And in one ...

problem with amortization schedule
I created a spreadsheet showing an amortization schedule and I get the numbers to work for 2 years(24 months) but I'm not sure how to set it up where if I enter in 1 year or 5 years for example. Here is the file: Thanks, Jason TX, Some suggestions; Move the Totals columns to the top of the worksheet (we will work on the formula later) Move the Graph to the top right of the interest column (L1) You really do not need the graph it will only show a straight line downward. Your formulas are basically sound but they need some Absolute ...

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...

Greylisting problem #2
Hi, I read in several newsgroup posts that there's a problem sending mails to SMTP hosts which use some kind of "greylisting" anti spam feature when directly sending from exchange 2003 sp2 (without a smart host). My problem is, that I have a SBS2003 with Exchange 2003 SP2 and must send directly from the exchange server to other SMTP hosts. If the recipient SMTP host sends a SMTP 45x code due to greylisting, my mail disappears from my SMTP queue and the exchange server never tries to resend it. Did MS release a hotfix or a workaround for this bug ? thanks, mario On Th...

Problem saving attachments in Outlook 2003
Hi, I am running Windows Vista 32-bit system and when I try to save an email attachment in Outlook 2003 I get the message: "There are not enough resources to complete the operation. Save your work, close other programs, and then try again". If I only have Outlook running I still get the message (I checked and I still have some free RAM). The attachments are only small in file size. The curoius thing is that if I press "ignore" enough times it allows me to save anyway. Can anyone help? I cannot find any other threads on any internet forums. Many thanks David Walker ...

A record problem
I have a table with the following fields : Username as text Password as text allowA as yes/no allowB as yes/no allowC as yes/no .... allowX as yes/no I want to allow a user to edit a record and I want the procedure to go like this : 1- create a record template 2- copy the selected record into the template 3- edit the template 4- when finished ask to confirm the changes 5- update the table with the values in the template 6- end Finally my question, how do I make in VB the template (if that is the correct word). The rest I can do, but I can't make that &...

Help with Transpose problem
I trade in the stock market & use excel to convert a list of ticker symbols to a csv file to import to a charting program. I start with a vertical list in excel, I copy then paste special & tell it to transpose. It seems if the list is too long I get an error message: "The information cannot be pasted because the copy area and the paste areas are not the same size and shape. Try one of the following: Click a single cell then paste. Select a rectangle that's the same size and shape, and then paste" I assume what is happening is that I don't have enough columns across...

Physical inventory formula problems
I am having a problem with the physical inventory feature. This is the example I pull a Item Value List report with only supplier as the filter. The total on this report is as follows QTY: -5 EXTENDED COST - $10 (these are minus's) Now I go to the physical inventory and select NEW then ONLY ITEMS FROM SELECTED SUPPLIERS and I choose the same supplier I choose on the ITEM VALUE LIST I choose to update maching item and replace existing items. I am importing 10 of the item that had a -5 when I started. Now when I calulate now expected should read what my ITEM VALUE LIST started wi...

Excel Form Problem. Tick-box problem
I am new to Excel so help me out here... I have an ID List that has the following fields (all in one column): 001, 002, 003, 004, 005...etc Somewhere else on the sheet, I would like the ID's to be replicated in the form of tick boxes. So whenever I add another ID to the list, it will automatically add the ID to the series of tick boxes. There will only be a maximum of 10 ID's at the end, so therefore I will end up with 10 tick boxes. Then somehow when I choose a tick box, and submit using some sort of button (remember i am new to excel!), I would like it to send the option(s) to ano...

(ofxhttp400) Fidelity process problem
what are my work-arounds for this error when I try downloading my Fidelity information? Thanks. I have this same issue. Does anyone have an answer to this question? TIA. >-----Original Message----- >what are my work-arounds for this error when I try >downloading my Fidelity information? Thanks. >. > In, sherman wrote: >I have this same issue. Does anyone have an answer to >this question? This is from the OFX spec: :Note: The server must return a code in the 400s for any problem that prevents it from :processing the request file. Processi...

QAT problem
Hi, all I wrote a macro in a module in Excel 2007. Using customize QAT, under more commands, macros, I added a button to the QAT. The button applies only to this workbook. I pressed the button and the macro ran fine. I saved the workbook as .xlsm, closed it and reopened it. The button I added to the AT was not there. I have used macros that apply only to a particular workbook before and the technique worked fine. Any ideas? TIA ...

Problems Balancing Checking Account-Wrong Opening Balance or date range
I have not previously had problems balancing my checking account wis Money 2004. Tonight when I went to do so, it gave a much different opening balance then the closing balance from the previous bank statement, when it balanced o.k. In fact, for some unknown reason, it was a month behind, said it wanted to balance the statement of 10/31/04...which I dutifully did again, after correcting the opening balance. That opening balance did not match any enf of month balances, even though eveyrthing balanced o.k. previously on 10/31/04. (This might be part of where things went wrong). Then when I b...

Show this folder as an e-mail address book problem
I have one user with an Outlook problem. When he starts an email, and clicks on teh "to:" button, he has no contact lists to choose from. When doing a folder view of contacts, in each contact list, the checkbox for "Show this folder as an e-mail address book" is greyed out. Anyone know how I can get it changed so I can change them? Sounds like the user does not have the Outlook Address Book service in = their mail profile. Adding it should resolve the problem.=20 --=20 Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power U...

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...

VB2010 Beta1 ActiveX problem
I have an ActiveX in my test program. When I drag it onto the form and compile, in VB2005 it would place a copy of AxInterop.XXX.dll file and also Interop.XXX.dll. In VB2010 it only places AxInterop.XXX.dll there and when I try and run it, it errors: System.InvalidOperationException was unhandled Message=An error occurred creating the form. See Exception.InnerException for details. The error is: Could not load file or assembly 'Interop.XXX, Version=, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified...

Countif Problem
I am trying to calculate the total time in one cell, if another cell equals a certain test. Example: A B C D 1 :15 1S 2 1:00 2S 3 :45 3I 4 2:00 1S So i have a countif formula that counts cell 1C, but where i am having problems is if 1C equals 1S, then i want it to add cell 1B. And then in that same cell, it would also see cell C4 and add cell B4 to it. I hope this make some sense. Any help would be great! Thanks Rob Instead of counting, you want to sum. =SUMIF(C:C,"1S",B...

2000 to 2002 problem
I recently converted from 2000 to 2002 on a system runing WXP Pro. I convert my reports to RTF format. After conversion, I must manually give on OK to convert the reports to the RTF format. What must I change to allow the conversion to the RTF format to be handled automatically? Thanks in Advance Dave bonjour, j'ai un probl�me plus important avex microsoft france.Je suis retrait� ancien technicien dans les centrales nucleaires et l'anglais ,je le poss�de mal .Aussi je voudrais une fois dans ma vie,dire � un Am�ricain que le jeu et plaisir de l'informatique est tronqu� en FR...

Office 07 Installation problems
First off I bought a new computer with Windows 7. I uninstalled a store bought copy of Office from my old one so that I could put it on my new one. While trying to install, the product key works but once it starts installing, the progress bar freezes. It will go a little and then won't move for hours. Can someone help me please? "Nic-nic" <> wrote in message > First off I bought a new computer with Windows 7. I uninstalled a store > bought copy of Office from my...

Word -- Footnote Problem
There are footnotes in my document that will not print on the page where the footnote number is although there is plenty of room at the bottom of the document and the footnote number is way at the top of the document. Any help would be greately apprecaited. Word has a "known glitch" (which they haven't figured out how to fix for over a decade) with respect to footnotes. The footnote often will not appear on the correct page if the paragraph that contains the footnote is set to single, double or 1.5 spacing. It has to be set to Exactly 12 pt (single) or Exactly ...

Anyone else notice this problem?
Whenever I add a table inside another table or delete the column the grouping creates, it takes away full page breaking functionality. It is annoying and we should have full page break functionality regardless of what is going on in the report. Is anyone else realizing this. Can one of the Microsoft guys put a request in for a fix for this? Whenever we tell it to page break it should do it regardless of groupings or format!! This is happening in 2008. ...