#include <windows.h>
static TCHAR lpszAppName[] = TEXT( "API Windows" );
LRESULT CALLBACK MainWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch (uMsg)
{
case WM_CREATE:
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
case WM_KEYDOWN:
break;
default:
return (DefWindowProc(hWnd, uMsg, wParam, lParam));
}
return(0L);
}
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
MSG msg;
WNDCLASS wndclass;
HWND hWnd;
wndclass.style = CS_HREDRAW | CS_VREDRAW;
wndclass.lpfnWndProc = MainWndProc;
wndclass.cbClsExtra = 0;
wndclass.cbWndExtra = 0;
wndclass.hInstance = hInstance;
wndclass.hIcon = NULL;
wndclass.hCursor = LoadCursor(NULL, IDC_ARROW);
wndclass.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
wndclass.lpszMenuName = NULL;
wndclass.lpszClassName = lpszAppName;
if(RegisterClass(&wndclass) == 0)
return FALSE;
hWnd = CreateWindow(lpszAppName, lpszAppName,
WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN | WS_CLIPSIBLINGS,
CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, hInstance, NULL);
if(hWnd == NULL)
return FALSE;
ShowWindow(hWnd, SW_SHOW);
UpdateWindow(hWnd);
while(GetMessage(&msg, NULL, 0, 0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return msg.wParam;
}
Przy próbie kompilacji wyskakuje błąd [build error][projekt1.exe]error1
a oto log z kompilacji
Compiler: Default compiler
Building Makefile: "C:\Documents and Settings\adamiak\Moje dokumenty\kurs winapi\Nowy folder (2)\Makefile.win"
Executing make...
make.exe -f "C:\Documents and Settings\adamiak\Moje dokumenty\kurs winapi\Nowy folder (2)\Makefile.win" all
g++.exe main.o -o "Project1.exe" -L"C:/Dev-Cpp/lib" gdi32.a
g++.exe: gdi32.a: No such file or directory
make.exe: *** [Project1.exe] Error 1
Execution terminated
W czym problem?