GDI object (is a graphical device object) used to write on a
device context for graphical output.
GDI objects are: Pen, Brush, Font,Line, Rectangle etc.
These objects are created using their corresponding win32
function. For eg, CreatePen, CreatePenIndirect are used to
create a pen object.
After these objects are created they would need to be
selected to the device context before processing using
GDI objects are not associated with any device context
during its creation. SelectObject function does that
Once an object is selected into the device context it would
be available until the object is destroyed through
DeleteObject or the program exits.
HWND hWnd, // handle to window
int X, // horizontal position
int Y, // vertical position
int nWidth, // width
int nHeight, // height
BOOL bRepaint // repaint option
This cud be used in the WM_PAINT event section and in
WM_SIZE message is received by the window procedure when a
user resizes a window. In order to limite the size of a
window, you could handle the WM_SIZE message appropriately.
Invalidate() -- To repaint the entire client area
InvalidateRect() -- To repaint a specific portion of the
SendMessage is a blocking call. ie., when a SendMessage()
API is called from an application, the lines written after
this API call cannot be executed until the message is
processed and returned by the window procedure.
Whereas PostMessage() just posts the message into the
windows corresponding message queue and returns immediately
irrespective of the message is processed or not.
WM_QUIT message in the program message queue is posted.
This causes WinMain to drop out of message loop and exit
the runing application.
Pre emption is releasing the process in order to serve
another process to utilize the same resource. Context
switching is the transfer of resource from once process to
reateWindow() physically creates the Window in memory
based on the previousy registered WNDCLASS structure and
returns a vaild HANDLE for that Window
Java just uses object oriented principals but it is not purely object oriented , because int is a primitive data type in Java but not an object similarly all primitive data types a pure object oriented language should not support a non object oriented aspects
A faik CString is a MFC class. You cannot use it in win32
application unless you set your application to use MFC
libraries. To use MFC in win32 application, go to project
settings and in general tab, set it to use MFC libraries in
shared DLL. Then you can include MFC framework files like
1. Create CBitmap from the bitmap.
2. Create a memory DC (CDC)
3. Put the CBitmap into the memory DC (Use
4. Get your dialog DC (CDialog::GetDC)
5. Do BitBlt or StretchBlt on dialog DC with memory DC as
source DC (this will paint the bitmap on your dialog).
6. Release dialog DC (ReleaseDC function)