Code:
#include <windows.h>
LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM);
HINSTANCE hInstGlobal;
int APIENTRY WinMain ( HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine, int nCmdShow )
{
hInstGlobal = hInstance;
WNDCLASS wc;
wc.style = 0;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.lpfnWndProc = WndProc;
wc.hInstance = hInstance;
wc.hbrBackground = (HBRUSH) (COLOR_WINDOW+1);
wc.hCursor = LoadCursor (NULL, IDC_ARROW);
wc.hIcon = LoadIcon (NULL, IDI_APPLICATION);
wc.lpszMenuName = 0;
wc.lpszClassName = "Dog Simulator 2";
RegisterClass (&wc);
HWND hWindow;
hWindow = CreateWindow ( "Kazalio Studios", "Dog Simulator 2",
WS_OVERLAPPEDWINDOW,
0, 0, 400, 400, NULL, NULL,
hInstance, NULL );
ShowWindow (hWindow, nCmdShow);
UpdateWindow (hWindow);
MSG Message;
while (GetMessage(&Message, NULL, 0, 0))
{
DispatchMessage(&Message);
}
return (Message.wParam);
}
LRESULT CALLBACK WndProcedure (HWND hWnd, UINT uiMessage, WPARAM wParam,
LPARAM lParam)
{
switch (uiMessage)
{
case WM_CREATE:
HWND hContinue, hExit;
hContinue = CreateWindow ( "Button", "Continue",
WS_CHILD | WS_VISIBLE |
BS_PUSHBUTTON,
10, 340, 140, 20,
hWnd, (HMENU) 1,
hInstGlobal, NULL);
hExit = CreateWindow ( "Button", "Continue",
WS_CHILD | WS_VISIBLE |
BS_PUSHBUTTON,
10, 340, 140, 20,
hWnd, (HMENU) 2,
hInstGlobal, NULL);
return 0;
case WM_COMMAND:
if (HIWORD(wParam) == BN_CLICKED)
{
if (LOWORD(wParam) == 1)
{
HDC hdc;
hdc = GetDC (GetParent((HWND) lParam));
PAINTSTRUCT ps;
HFONT font;
hdc = BeginPaint(hWnd, &ps);
font = CreateFont(80, 0, 0, 0,
FW_BOLD, FALSE, FALSE, FALSE,
ANSI_CHARSET, OUT_DEFAULT_PRECIS,
CLIP_CHARACTER_PRECIS, DEFAULT_QUALITY,
DEFAULT_PITCH | FF_ROMAN,
"XPress SF");
SelectObject(hdc, font);
TextOut(hdc, 70, 20, "Dog Simulator 2", 15);
DeleteObject(font);
}
if (LOWORD(wParam) == 2)
{
SendMessage (GetParent((HWND)lParam),
WM_DESTROY, 0, 0);
}
}
return 0;
case WM_DESTROY:
PostQuitMessage(0);
return 0;
default:
return DefWindowProc (hWnd, uiMessage, wParam, lParam);
}
}
and it comes up with the error[link error] undefined reference to 27WndProcp6hwnd__jjl@16