WinAPI Помогите пожалуйста..
:т:
#include
LPCSTR WndClassName = "FirstWindow";
HWND hwnd = NULL;
const int Width = 800;
const int Height = 600;
bool InitializeWindow(HINSTANCE hInstance,int ShowWnd,int width,int height,bool windowed);
int messageloop();
LRESULT CALLBACK WndProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam);
int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine,int nShowCmd)
{
if(!InitializeWindow(hInstance,nShowCmd,Width,Height,true))
{
MessageBoxA(NULL,"Failed","Error",MB_OK);
return 0;
}
messageloop();
return 0;
}
bool InitializeWindow(HINSTANCE hInstance,int ShowWnd,int width,int height,bool windowed)
{
WNDCLASSEX wc;
wc.cbClsExtra = NULL;
wc.cbSize = sizeof(WNDCLASSEX);
wc.cbWndExtra = NULL;
wc.style = CS_HREDRAW | CS_VREDRAW;
wc.lpfnWndProc = WndProc;
wc.hInstance = hInstance;
wc.hIcon = LoadIcon(NULL,IDI_APPLICATION);
wc.hCursor = LoadCursor(NULL,IDC_ARROW);
wc.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
wc.hIconSm = LoadIcon(NULL,IDI_APPLICATION);
wc.lpszMenuName = NULL;
wc.lpfnWndProc = WndClassName;
....
Забыл добавить... использую СodeBlocks