Click here to Skip to main content
16,014,306 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
General"stdafx.h" Pin
WREY1-Jun-02 16:55
WREY1-Jun-02 16:55 
GeneralRe: "stdafx.h" Pin
Nish Nishant1-Jun-02 18:05
sitebuilderNish Nishant1-Jun-02 18:05 
GeneralRe: "stdafx.h" Pin
WREY1-Jun-02 20:39
WREY1-Jun-02 20:39 
GeneralRe: "stdafx.h" Pin
Joel Holdsworth1-Jun-02 21:04
Joel Holdsworth1-Jun-02 21:04 
GeneralRe: "stdafx.h" Pin
WREY1-Jun-02 21:43
WREY1-Jun-02 21:43 
GeneralRe: "stdafx.h" Pin
Brian Delahunty2-Jun-02 4:59
Brian Delahunty2-Jun-02 4:59 
GeneralAnimateWindow(), problem Pin
MaTrIX2k21-Jun-02 11:16
MaTrIX2k21-Jun-02 11:16 
GeneralRe: AnimateWindow(), problem Pin
Paul M Watt1-Jun-02 18:09
mentorPaul M Watt1-Jun-02 18:09 
If you look at the remarks in the documentation for AnimateWindow, it looks like it is calling WM_PRINT instead. WM_PRINT is basically like a WM_PAINT except that it gives a DC that should be drawn to.

So, if you are using the plain windows API, you could do something like this in your windowproc:

...
case WM_PRINT:
case WM_PAINT:
{
    HDC hdc;
    PAINTSTRUCT ps;
    //Test if the wPAram already contains the HDC
    if (NULL != wParam)
    {
    // This is the DC that you should use to paint with.
        hdc = (HDC)wParam;
    }
    else
    {
    // OTherwise call begin paint like normal.
       hdc = ::BeginPaint(hWnd, &ps);
    }

    // Your paint code goes here.

    if (NULL == wParam)
    {
    // If you called beginpaint, hten you will need to call endpaint.
        ::EndPaint(hWnd, &ps);
    }
}
break;
...


If you are using MFC, you will simply need to call OnDraw from your OnPrint handler and be sure to pass in the DC that you received from the OnPrint handler.

Good Luck


Build a man a fire, and he will be warm for a day
Light a man on fire, and he will be warm for the rest of his life!

GeneralRe: AnimateWindow(), problem Pin
MaTrIX2k21-Jun-02 18:49
MaTrIX2k21-Jun-02 18:49 
GeneralDetecting connections... Pin
einst9921-Jun-02 10:30
einst9921-Jun-02 10:30 
GeneralRe: Detecting connections... Pin
Rama Krishna Vavilala1-Jun-02 12:19
Rama Krishna Vavilala1-Jun-02 12:19 
QuestionWhere can I get masm? Pin
1-Jun-02 10:29
suss1-Jun-02 10:29 
AnswerRe: Where can I get masm? Pin
Tim Smith1-Jun-02 10:38
Tim Smith1-Jun-02 10:38 
GeneralRe: Where can I get masm? Pin
1-Jun-02 10:53
suss1-Jun-02 10:53 
AnswerRe: Where can I get masm? Pin
Nish Nishant1-Jun-02 18:14
sitebuilderNish Nishant1-Jun-02 18:14 
AnswerRe: Where can I get masm? Pin
David_LoveCpp17-Mar-10 22:32
David_LoveCpp17-Mar-10 22:32 
Questionwhich way is better? Pin
pnpfriend1-Jun-02 9:24
pnpfriend1-Jun-02 9:24 
AnswerRe: which way is better? Pin
Brian Delahunty1-Jun-02 10:24
Brian Delahunty1-Jun-02 10:24 
GeneralCView border Pin
Joel Holdsworth1-Jun-02 9:27
Joel Holdsworth1-Jun-02 9:27 
GeneralRe: CView border Pin
Neville Franks1-Jun-02 11:37
Neville Franks1-Jun-02 11:37 
GeneralRe: CView border Pin
Paul M Watt1-Jun-02 18:16
mentorPaul M Watt1-Jun-02 18:16 
GeneralAfxGetMain window oddness Pin
Joel Holdsworth1-Jun-02 9:17
Joel Holdsworth1-Jun-02 9:17 
GeneralRe: AfxGetMain window oddness Pin
Neville Franks1-Jun-02 11:44
Neville Franks1-Jun-02 11:44 
GeneralRe: AfxGetMain window oddness Pin
Nish Nishant1-Jun-02 16:20
sitebuilderNish Nishant1-Jun-02 16:20 
GeneralFlame me to a crisp, but... Pin
Domenic Denicola1-Jun-02 8:40
Domenic Denicola1-Jun-02 8:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.