SDK PROGRAMMING
The SDK programming is a developing Win 32 based programs using the Win 32 API that directly interact with the hardware. Therefore the execution of the SDK programs is fast. A sample SDK program for presenting a window is shown below. The MSG is a structure. UpdateWindow, CreateWindow, ShowWindow, are some examples of SDK functions.
The HWND is a handle to the window. The formed window's address is stored in hWnd. The initial parameter "button" is the class name. The succeeding parameter "hello" is the window name. The BS_PUSHBUTTON is the style. BS stands for the button style. And the next 4 parameters specify the size of the window. The 8th parameter specifies that the created window has no parent. The next parameter specifies that there is no menu. The ShowWindow displays the window.
#include
int WINAPI Winmain(HANDLE hInstance, HANDLE hprevInstance, LPSTR
lpszCmdLine, int nCmdshow)
{
HWND hWnd;
MSG msg;
hWnd=CreateWindow("button","hello",BS_PUSHBUTTON,10,110,100,100,
NULL,NULL,hInstance,NULL);
ShowWindow(hWnd, nCmdshow);
UpdateWindow(hWnd);
while (GetMessage(&msg, hWnd, 0, 0))
{
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
return(0);
}