DEV C++ 開啟 >檔案>開新檔案>專案>Windows Application(windows視窗專案)
往下找 找到
LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message) /* handle the messages */
{
case WM_DESTROY:
PostQuitMessage (0); /* send a WM_QUIT to the message queue */
break;
default: /* for messages that we don't deal with */
return DefWindowProc (hwnd, message, wParam, lParam);
}
return 0;
}
然後 加入
case WM_CREATE:
CreateWindow(TEXT("button"), TEXT("Hello"),
WS_VISIBLE | WS_CHILD,
10,10,80,25,
hwnd,(HMENU) 1,NULL,NULL
);
break;
注意! 一個大寫小寫錯誤都不能編譯!
文章標籤
全站熱搜
留言列表