Jan 16, 2021, 12:46 AM

News:

MyKidsDiary.in :: Capture your kids magical moment and create your Online Private Diary for your kids


The Paint Structure

Started by sukishan, Jul 13, 2009, 12:10 AM

previous topic - next topic
Go Down

sukishan


The Paint Structure(PAINTSTRUCT)

The PAINTSTRUCT structure contains information for an application. This information can be used to paint the client area of a window owned by that application.

typedef struct tagPAINTSTRUCT { // ps

HDC hdc;

BOOL fErase;

RECT rcPaint;

BOOL fRestore;

BOOL fIncUpdate;

BYTE rgbReserved[32];

} PAINTSTRUCT;


hdc Handle to the display DC to be used for painting.
fErase Specifies whether the background must be erased. This value is nonzero if the application should erase the background. The application is responsible for erasing the background if a window class is created without a background brush. For more information, see the description of the hbrBackground member of the WNDCLASS structure.
rcPaint Specifies a RECT structure that specifies the upper left and lower right corners of the rectangle in which the painting is requested.
fRestore Reserved; used internally by the system.
fIncUpdate Reserved used internally by the system.
rgbReserved Reserved used internally by the system.
Windows erases the background using the brush specified in the hbrBackground field of the WNDCLASS structure that is used when registering the window class during WinMain initialization. Many windows programs specify a white brush for the windows background. This is indicated in the program with the statement like this:

wndclass.hbrBackground = (HBRUSH) GetStockObject (WHITE_BRUSH) ;

The second method to get a handle to DC of the client area of the windows js by calling GetDC to obtain the handle and ReleaseDC to release the handle. This can be done with the statement like this:

hdc = GetDC (hwnd) ;

[ GDI functions]

ReleaseDC (hwnd,hdc);

The functions GetDC and ReleaseDC should be called in pairs like BeginPaint and EndPaint. GetDC is used while processing message and ReleaseDC is used to exit the window procedure. Do not call GetDC in one message and ReleaseDC in another message. A function similar to GetDC is GetWindowDC. While GetDC returns a device context handle for writing on the client area of the window, GetWindowDC returns a device context handle for writing on the entire window.To use the function GetWindowDC your program has to process WM_NCPAINT (non client paint) message.

A good beginning makes a good ending

Go Up
 

Quick Reply

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Note: this post will not display until it's been approved by a moderator.
Name:
Email:
Verification:
Please leave this box empty:

Type the letters shown in the picture
Listen to the letters / Request another image

Type the letters shown in the picture:

shortcuts: alt+s submit/post or alt+p preview
IT Acumens Web Designing Chennai | GinGly :: Build your Personal Website | CineBuzz :: Cinema News | My Kids Diary :: Kids Memories Writing :: Book Website @ 349 Rs monthly
Copyright 2005 - 2020 :: IT Acumens :: All Rights Reserved. :: Sitemap
ITAcumens Discussion Forum with 2 lakhs post running for 15 years - Powered by IT Acumens Dedicated Server