⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 winmine.cpp

📁 实现了windows Xp 中自带的扫雷的基本全部功能
💻 CPP
字号:
/*//////////////////////文件说明//////////////////////////
//														//
//文件名: WinMine.cpp				           			//
//功  能: WinMain主函数的定义							//
//作  者:												//
//														//
////////////////////////////////////////////////////////*/

#include "WinProc.h"

/*###########################################################
功能:主窗口函数,程序入口
参数:
返回值:
###########################################################*/

int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow)
{
	HWND			hWnd;
	HACCEL			hAccel;
	MSG				msg ;
	WNDCLASS		wndclass ;
	TCHAR			szAppName[20],szAppCaption[20];
	
	LoadString(hInstance,IDS_APPMANE,szAppName,20);
	LoadString(hInstance,IDS_APPCAPTION,szAppCaption,20);
	wndclass.style         = CS_HREDRAW | CS_VREDRAW |CS_OWNDC;
	wndclass.lpfnWndProc   = WndProc ;
	wndclass.cbClsExtra    = 0 ;
	wndclass.cbWndExtra    = 0 ;
	wndclass.hInstance     = hInstance ;
	wndclass.hIcon         = LoadIcon (hInstance,MAKEINTRESOURCE(IDC_APPICON));
	wndclass.hCursor       = LoadCursor (NULL, IDC_ARROW) ;
	wndclass.hbrBackground = (HBRUSH) GetStockObject (WHITE_BRUSH) ;
	wndclass.lpszMenuName  = MAKEINTRESOURCE(IDR_MAINMENU);
	wndclass.lpszClassName = szAppName;

	if (!RegisterClass (&wndclass))
	{
		MessageBox (NULL, TEXT ("This program requires Windows NT!"), 
			szAppName, MB_ICONERROR) ;
		return 0 ;
	}

	RegisterClass (&wndclass);
	
	hWnd = CreateWindow (szAppName,					// window class name
						 szAppCaption,				// window caption
						 WS_SYSMENU | WS_MINIMIZEBOX |WS_OVERLAPPED,        // window style
						 CW_USEDEFAULT,              // initial x position
						 CW_USEDEFAULT,              // initial y position
						 CW_USEDEFAULT,              // initial x size
						 CW_USEDEFAULT,              // initial y size
						 NULL,                       // parent window handle
						 NULL,						 // window menu handle
						 hInstance,                  // program instance handle
						 NULL) ;                     // creation parameters
	hAccel=LoadAccelerators(hInstance,MAKEINTRESOURCE(IDR_ACCELERATOR));
 	ShowWindow (hWnd, iCmdShow) ;
	UpdateWindow (hWnd) ;	

	
	while (GetMessage (&msg, NULL, 0, 0))
	{	

		if (!TranslateAccelerator(hWnd,hAccel,&msg))
		{
			TranslateMessage (&msg) ;
			DispatchMessage (&msg) ;
		}
	}
	return msg.wParam ;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -