First let us start with the “Windows SDK” (Software Development Kit) which is designed to create Windows applications. It consists of large set of functions, messages, structures, macros and resources. It is a set of tools designed to help C programmers create Windows applications.
Windows SDK consists of the large set of books describing functions, messages, structures, macros and resources. There are also tools including a dialog editor and an image editor, on-line help files and a set of windows libraries and header files.
It has large collection of API (Application Programming Interface) functions written in C. The API is a set of functions that are part of Windows Operating System. Programs can be created by calling the functions present in the API. One doesn’t have to bother about the internal working of the functions – just knowing the function prototype (name, arguments) and return value one can invoke the API functions. A good understanding of the Windows API will help you to become a good Windows programmer . Windows itself uses the API to perform its GUI magic.
Windows APIs are of two types:
API for 16-bit Windows (Win16 API)
API for 32-bit Windows (Win32 API)
Win16 is the API for the first 16-bit versions of Microsoft Windows. These were first called “Windows API”, but were later renamed to Win16 so that they can be differentiated from 32-bit (which is the new version).
Win32 is the 32-bit API for modern versions of Windows. This API consists of functions implemented, as with Win16, in system DLLs. The core DLLs of Win32 are kernel32.dll, user32.dll, and gdi32.dll. Win32 was introduced with Windows NT.
Microsoft Foundation Class (MFC) is a rich class library which consists of set of c++ classes that has different functionality of applications written for Windows Operating System. It wraps portions of API in to C++ classes. MFC consists of multi-layered hierarchy that defines approximately 200 classes. It offers the convenience of reusable code. Because many of the tasks common to all Windows programs are provided by MFC, one need not have to recreate it each time. It also provides implementations for a set of the user-interface components. Mfc programs are highly portable, because the interface provided by the Foundation Class Library is largely independent.
Here is a program that creates a simple window using MFC.
#include
//The CWinApp class is the base class from which you derive a Windows application object.
//An application object provides member functions for initializing your application
//(and each instance of it) and for running the application
class mywin : public CFrameWnd
{
public :
myWin()
{
Create (0,”HELLO – WINDOW”) ;
}
};
class myapp : public CWinApp
{
public:
// Override InitInstance to initialize each new instance of your application running
//under Windows.Typically ,you override InitInstance to construct your main window
//object and set the CWinThread : : m_pMainWnd data member to point to that window.
int InitInstance()
{
mywin *f ;
f = new mywin;
f – >ShowWindow(3);
m_pMainWnd = f;
return 1;
}
};
myapp app;
Here is the same program to create a window in the Windows SDK
# include
HWND hwnd;
MSG msg;
WNDCLASS wnd;
long WINAPI process(HWND,UINT,WPARAM,LPARAM);
int WINAPI WinMain(HINSTANCE h,HINSTANCE p, LPSTR s , int show)
{
wnd.hInstance=h;
wnd.lpfnWndProc=process;
wnd.lpszClassName=”first”;
wnd.hbrBackground=(HBRUSH)GetStockObject(WHITE_BRUSH);
RegisterClass(&wnd) ;
hwnd=CreateWindow(“first”,”SDK-Window”,WS_OVERLAPPEDWINDOW,CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,0,0,h,0);
ShowWindow(hwnd,SW_SHOWNORMAL);
While(GetMessage(&msg,0,0,0))
{
DispatchMessage(&msg) ;
}
return msg.wParam;
}
long WINAPI process(HWND hd,UINT mess,WPARAM more,LPARAM pos)
{
Switch(mess)
{
case WM_CREATE:MessageBox(hd,”CREATING”,”wait!”,0) ;
break;
case WM_ClOSE:MessageBox(hd,”Closing”,”wait”,0);
break;
case WM_DESTROY:MessageBox(hd,”destroying”,”wait”,0);
PostQuitMessage(0);
break;
}
Return DefWindowProc(hd,mess,more,pos);
}
Thus we can see that programming in MFC reduces the code to a considerable extent as compared to Windows SDK; in the windows SDK we have to write each and every function.
If you enjoyed this post, make sure you subscribe to my RSS feed!
Tags: C#, Code, MFC, Programming, Windows SDK

Hi can u suspend him and hack him please thanks!
v
v
http://www.youtube.com/user/deathspammer52
Hello can you hack and suspend this youtube user today please thank you!
v
v
http://www.youtube.com/user/chimchar82
Hi can you suspend this user for me please thanks!
v
http://www.youtube.com/user/Michael10119
Oh yea, what a good bad plan to get fans. And I like it
mmm no… I don’t do that sort of thing. You might want to try contacting YouTube admins? lol?