資源簡介
數字九宮格自動排序問題實驗,八數碼求解過程動態演示源代碼-Digital Jiugongge automatic test scheduling problem, eight digital dynamic presentation source code solution process

代碼片段和文件信息
//?9Gird.cpp?:?Defines?the?entry?point?for?the?application.
//?Download?by?http://www.codefans.net
//
//?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?
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????4621??2009-09-04?14:55??9Gird.cpp
?????文件???????4662??2004-12-05?22:37??9Gird.dsp
?????文件????????535??2004-12-04?15:13??9Gird.dsw
?????文件????????450??2009-09-04?14:55??9Gird.h
?????文件???????1078??2004-12-04?19:03??9Gird.ICO
?????文件???????3801??2004-12-06?11:56??9Gird.rc
?????文件??????10880??2009-09-04?14:55??NineGird.cpp
?????文件???????1395??2009-09-04?14:55??NineGird.h
?????文件???????2055??2004-12-04?12:34??ReadMe.txt
?????文件?????????20??2011-05-11?21:20??Read_Me.txt
?????文件???????1076??2009-09-04?14:55??resource.h
?????文件????????318??2004-12-05?12:31??SMALL.ICO
?????文件????????330??2009-09-04?14:55??StdAfx.cpp
?????文件???????1013??2009-09-04?14:55??StdAfx.h
-----------?---------??----------?-----??----
????????????????32234????????????????????14
評論
共有 條評論