Yes it is.
for example:
--------
#include<windows.h>
int main()
{
MessageBox(0,"","",0);
return 0;
}
--------
or an other example
--------
#include<windows.h>
#include<iostream>
using namespace std;
LRESULT CALLBACK WndProc(HWND,UINT,WPARAM,LPARAM);
int main()
{
WNDCLASS* wndclass=new WNDCLASS;
MSG* msg=new MSG;
HWND hWnd;
char* name="name";
wndclass->cbClsExtra=0;
wndclass->cbWndExtra=0;
wndclass->hbrBackground=(HBRUSH)1;
wndclass->hCursor=LoadCursor(NULL,IDC_ARROW);
wndclass->hIcon=LoadIcon(NULL,IDI_APPLICATION);
wndclass->hInstance=GetModuleHandle(0);
wndclass->lpfnWndProc=WndProc;
wndclass->lpszClassName=name;
wndclass->lpszMenuName=0;
wndclass->style=CS_HREDRAW|CS_VREDRAW;
RegisterClass(wndclass);
hWnd=CreateWindow(name,name,WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,0,0,GetModuleHandle(0),0);
ShowWindow(hWnd,SW_SHOW);
UpdateWindow(hWnd);
while(GetMessage(msg,0,0,0))
{
TranslateMessage(msg);
DispatchMessage(msg);
}
return 0;
}
LRESULT CALLBACK WndProc(HWND hWnd,UINT message,WPARAM wParam,LPARAM lParam)
{
cout<<"message:"<<hex<<message<<endl;
switch(message)
{
case WM_DESTROY:
PostQuitMessage(0);
return 0;
}
return DefWindowProc(hWnd,message,wParam,lParam);
}
-------
Look at the second parameter of GetMessage. Is your hWnd.