資源簡介
九宮格源代碼(八數(shù)碼算法VC實現(xiàn)).rar

代碼片段和文件信息
//?9Gird.cpp?:?Defines?the?entry?point?for?the?application.
//
//
//?Created?by?ZhaoHongWei?2004-12-6
//?Feel?free?to?use?this?code?in?any?way?you?want.
#include?“stdafx.h“
#include?“resource.h“
#include?“NineGird.h“
#define?MAX_LOADSTRING?100
//?Global?Variables:
HINSTANCE?hInst; //?current?instance
TCHAR?sztitle[MAX_LOADSTRING]; //?The?title?bar?text
TCHAR?szWindowClass[MAX_LOADSTRING]; //?The?title?bar?text
CNineGird?g_9Gird;
//?Foward?declarations?of?functions?included?in?this?code?module:
ATOM MyRegisterClass(HINSTANCE?hInstance);
BOOL InitInstance(HINSTANCE?int);
LRESULT?CALLBACK WndProc(HWND?UINT?WPARAM?LPARAM);
LRESULT?CALLBACK About(HWND?UINT?WPARAM?LPARAM);
int?APIENTRY?WinMain(HINSTANCE?hInstance
?????????????????????HINSTANCE?hPrevInstance
?????????????????????LPSTR?????lpCmdLine
?????????????????????int???????nCmdShow)
{
? //?TODO:?Place?code?here.
MSG?msg;
HACCEL?hAccelTable;
//?Initialize?global?strings
LoadString(hInstance?IDS_APP_title?sztitle?MAX_LOADSTRING);
LoadString(hInstance?IDC_MY9GIRD?szWindowClass?MAX_LOADSTRING);
MyRegisterClass(hInstance);
//?Perform?application?initialization:
if?(!InitInstance?(hInstance?nCmdShow))?
{
return?FALSE;
}
hAccelTable?=?LoadAccelerators(hInstance?(LPCTSTR)IDC_MY9GIRD);
//?Main?message?loop:
while?(GetMessage(&msg?NULL?0?0))?
{
if?(!TranslateAccelerator(msg.hwnd?hAccelTable?&msg))?
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
return?msg.wParam;
}
ATOM?MyRegisterClass(HINSTANCE?hInstance)
{
WNDCLASSEX?wcex;
wcex.cbSize?=?sizeof(WNDCLASSEX);?
wcex.style =?CS_HREDRAW?|?CS_VREDRAW;
wcex.lpfnWndProc =?(WNDPROC)WndProc;
wcex.cbClsExtra =?0;
wcex.cbWndExtra =?0;
wcex.hInstance =?hInstance;
wcex.hIcon =?LoadIcon(hInstance?(LPCTSTR)IDI_MY9GIRD);
wcex.hCursor =?LoadCursor(NULL?IDC_ARROW);
wcex.hbrBackground =?(HBRUSH)(COLOR_WINDOW+1);
wcex.lpszMenuName =?(LPCSTR)IDC_MY9GIRD;
wcex.lpszClassName =?szWindowClass;
wcex.hIconSm =?LoadIcon(wcex.hInstance?(LPCTSTR)IDI_SMALL);
return?RegisterClassEx(&wcex);
}
BOOL?InitInstance(HINSTANCE?hInstance?int?nCmdShow)
{
???HWND?hWnd;
???hInst?=?hInstance;?//?Store?instance?handle?in?our?global?variable
???hWnd?=?CreateWindow(szWindowClass?sztitle?WS_OVERLAPPEDWINDOW
??????CW_USEDEFAULT?0?CW_USEDEFAULT?0?NULL?NULL?hInstance?NULL);
???if?(!hWnd)
???{
??????return?FALSE;
???}
???SetWindowPos(hWnd??NULL??0??0??400??210??NULL?);
???ShowWindow(hWnd?nCmdShow);
???UpdateWindow(hWnd);
???return?TRUE;
}
LRESULT?CALLBACK?WndProc(HWND?hWnd?UINT?message?WPARAM?wParam?LPARAM?lParam)
{
int?wmId?wmEvent;
PAINTSTRUCT?ps;
HDC?hdc;
RECT?rt;
GetClientRect(hWnd?&rt);
switch?(message)?
{
case?WM_COMMAND:
wmId????=?LOWORD(wParam);?
wmEvent?=?HIWORD(wParam);?
//?Parse?the?menu?selections:
switch?(wmId)
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????4585??2004-12-06?11:59??九宮問題\9Gird.cpp
?????文件???????4662??2004-12-05?22:37??九宮問題\9Gird.dsp
?????文件????????535??2004-12-04?15:13??九宮問題\9Gird.dsw
?????文件??????49152??2004-12-06?11:56??九宮問題\9Gird.exe
?????文件????????414??2004-12-06?11:59??九宮問題\9Gird.h
?????文件???????1078??2004-12-04?19:03??九宮問題\9Gird.ICO
?????文件????5704704??2014-10-02?23:41??九宮問題\9Gird.ncb
?????文件???????3801??2004-12-06?11:56??九宮問題\9Gird.rc
?????文件????????874??2008-09-18?11:35??九宮問題\9Gird.sln
????..A..HR?????34304??2014-10-02?23:41??九宮問題\9Gird.suo
?????文件???????7208??2008-09-18?11:41??九宮問題\9Gird.vcproj
?????文件???????1427??2010-11-03?12:10??九宮問題\9Gird.vcproj.LENOVO-8C5698CA.Administrator.user
?????文件???????1421??2014-10-02?23:41??九宮問題\9Gird.vcproj.POST2014-007.MM969.user
?????文件???????1427??2009-01-07?11:23??九宮問題\9Gird.vcproj.YLPOST-0A58C308.lsh2008.user
?????文件??????10844??2004-12-06?11:59??九宮問題\NineGird.cpp
?????文件???????1359??2004-12-06?11:59??九宮問題\NineGird.h
?????文件???????2055??2004-12-04?12:34??九宮問題\ReadMe.txt
?????文件???????1040??2004-12-04?18:55??九宮問題\resource.h
?????文件????????318??2004-12-05?12:31??九宮問題\SMALL.ICO
?????文件????????292??2004-12-04?12:34??九宮問題\StdAfx.cpp
?????文件????????977??2004-12-04?18:32??九宮問題\StdAfx.h
?????文件?????154112??2014-10-02?17:59??九宮問題\九宮疑難(八數(shù)碼)求解過程動態(tài)演示.doc
?????目錄??????????0??2014-12-14?14:19??九宮問題
-----------?---------??----------?-----??----
??????????????5986589????????????????????23
評論
共有 條評論