主题:我写的第一个SDK程序,执行怎么没反映?
#include <windows.h>
#include "resource.h"
LRESULT CALLBACK WndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
int APIENTRY WinMain ( HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow )
{
MSG msg;
static TCHAR szAppName[] = TEXT ("Mine") ;
HWND hWnd;
HACCEL hAccelTable;
WNDCLASS wndclass;
wndclass.style = CS_HREDRAW | CS_VREDRAW ;
wndclass.lpfnWndProc = (WNDPROC) WndProc ;
wndclass.cbClsExtra = 0 ;
wndclass.cbWndExtra = 0 ;
wndclass.hInstance = hInstance ;
wndclass.hIcon = LoadIcon ( NULL, (LPCTSTR)IDI_APP) ;
wndclass.hCursor = LoadCursor ( NULL, IDC_ARROW) ;
wndclass.hbrBackground = (HBRUSH) GetStockObject (WHITE_BRUSH) ;
wndclass.lpszMenuName = MAKEINTRESOURCE ( IDM_MENU) ;
wndclass.lpszClassName = szAppName ;
return RegisterClass( &wndclass) ;
hWnd = CreateWindow ( szAppName,
"扫雷",
WS_OVERLAPPEDWINDOW & ~WS_MAXIMIZEBOX & ~WS_SIZEBOX,
CW_USEDEFAULT,
CW_USEDEFAULT,
400,
400,
NULL,
NULL,
hInstance,
NULL);
ShowWindow (hWnd ,nCmdShow );
UpdateWindow (hWnd) ;
while (GetMessage (&msg, NULL , 0, 0))
{
if (TranslateAccelerator ( hWnd, hAccelTable, &msg))
{
TranslateMessage (&msg) ;
DispatchMessage (&msg) ;
}
}
return msg.wParam;
}
LRESULT CALLBACK WndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
return DefWindowProc(hWnd,message,wParam,lParam);
}
#include "resource.h"
LRESULT CALLBACK WndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
int APIENTRY WinMain ( HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow )
{
MSG msg;
static TCHAR szAppName[] = TEXT ("Mine") ;
HWND hWnd;
HACCEL hAccelTable;
WNDCLASS wndclass;
wndclass.style = CS_HREDRAW | CS_VREDRAW ;
wndclass.lpfnWndProc = (WNDPROC) WndProc ;
wndclass.cbClsExtra = 0 ;
wndclass.cbWndExtra = 0 ;
wndclass.hInstance = hInstance ;
wndclass.hIcon = LoadIcon ( NULL, (LPCTSTR)IDI_APP) ;
wndclass.hCursor = LoadCursor ( NULL, IDC_ARROW) ;
wndclass.hbrBackground = (HBRUSH) GetStockObject (WHITE_BRUSH) ;
wndclass.lpszMenuName = MAKEINTRESOURCE ( IDM_MENU) ;
wndclass.lpszClassName = szAppName ;
return RegisterClass( &wndclass) ;
hWnd = CreateWindow ( szAppName,
"扫雷",
WS_OVERLAPPEDWINDOW & ~WS_MAXIMIZEBOX & ~WS_SIZEBOX,
CW_USEDEFAULT,
CW_USEDEFAULT,
400,
400,
NULL,
NULL,
hInstance,
NULL);
ShowWindow (hWnd ,nCmdShow );
UpdateWindow (hWnd) ;
while (GetMessage (&msg, NULL , 0, 0))
{
if (TranslateAccelerator ( hWnd, hAccelTable, &msg))
{
TranslateMessage (&msg) ;
DispatchMessage (&msg) ;
}
}
return msg.wParam;
}
LRESULT CALLBACK WndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
return DefWindowProc(hWnd,message,wParam,lParam);
}