Home > Software engineering >  Windows programming where to copy the wrong!
Windows programming where to copy the wrong!

Time:09-27


#include
#include
LRESULT a CALLBACK MyWndProc (
HWND HWND,//handle to the window
UINT uMsg,//the message identifier
WPARAM WPARAM,//the first message parameter
LPARAM LPARAM//second message parameter
);

__in_opt int WINAPI WinMain (__in HINSTANCE HINSTANCE, HINSTANCE hPrevInstance, __in LPSTR lpCmdLine, __in int nShowCmd)
{
WNDCLASS WND;
The HWND HWND;
MSG MSG.
WND. Style=CS_VREDRAW | CS_HREDRAW;
WND. LpfnWndProc=MyWndProc;
WND. CbClsExtra=0;
WND. CbWndExtra=0;
WND. HIcon=LoadIcon (NULL, IDI_APPLICATION);
WND. HCursor=LoadCursor (NULL, IDC_ARROW);
WND. HbrBackground=(HBRUSH) GetStockObject (WHITE_BRUSH);
WND. LpszMenuName=NULL;
WND. LpszClassName=TEXT (" the first window ");
WND. HInstance=hInstance;
if(! RegisterClass (& amp; WND))
{
MessageBox (NULL, TEXT (" 1111 "), TEXT (" 222 "), 0).
return 0;
}
First window HWND=CreateWindow (TEXT (" "),
The window of the TEXT (" I "),
WS_OVERLAPPEDWINDOW,
0,0,400,300, NULL, NULL, hInstance, NULL
);

ShowWindow (HWND, nShowCmd);
While (GetMessage (& amp; MSG, NULL, 0, 0))
{
TranslateMessage (& amp; MSG);
DispatchMessage (& amp; MSG);
}
Return MSG. LParam;
}


LRESULT a CALLBACK WindowProc (
HWND HWND,//handle to the window
UINT uMsg,//the message identifier
WPARAM WPARAM,//the first message parameter
LPARAM LPARAM//second message parameter
)
{
Return DefWindowProc (HWND, uMsg wParam, lParam);
}
Compiled clew cannot resolve the external symbol ", should add the header file? According to the teaching material copied ah, I know a great god gives directions thank you.

CodePudding user response:

Details of which could not link?

CodePudding user response:

Use the Chinese comma? Try to English

CodePudding user response:

MyWndProc where the callback function implementation?
  • Related