/* Send message to WindowProcedure */
DispatchMessage(&messages);
}
/* The program return-value is 0 – The value that PostQuitMessage() gave */
return messages.wParam;
}
/* This function is called by the Windows function DispatchMessage() */
LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
int initx=20,inity=20,grid=50,interspace=3,arc=25;
int i,j,m=0;
char s[100];
switch (message) /* handle the messages */
{
case WM_CREATE:
{
CreateWindow("BUTTON","解题",WS_CHILD|WS_VISIBLE|BS_PUSHBUTTON,350,150,100,
30,hwnd,(HMENU)1000,((LPCREATESTRUCT) lParam)->hInstance,NULL);
CreateWindow("BUTTON","自定义布局",WS_CHILD|WS_VISIBLE|BS_PUSHBUTTON,350,90,100,
30,hwnd,(HMENU)1001,((LPCREATESTRUCT) lParam)->hInstance,NULL);
CreateWindow("EDIT","27732773144115510660",WS_CHILD|WS_VISIBLE|ES_NUMBER|WS_BORDER,350,50,165,
20,hwnd,(HMENU)1002,((LPCREATESTRUCT) lParam)->hInstance,NULL);
GetClientRect(hwnd,&rect);
hdc=GetDC(hwnd);
memdc=CreateCompatibleDC(hdc);
hbit=CreateCompatibleBitmap(hdc,rect.right,rect.bottom);
SelectObject(memdc,hbit);
hbrush = (HBRUSH) GetStockObject(WHITE_BRUSH);
SelectObject(memdc, hbrush);
//hpen = (HPEN) GetStockObject(BLACK_PEN);
//SelectObject(memdc, hpen);
ReleaseDC(hwnd,hdc);
///////////////////////////////////////
display_node[0][0]=GENERAL1;
display_node[0][1]=CAOCAO;
display_node[0][2]=CAOCAO;
display_node[0][3]=GENERAL2;
display_node[1][0]=GENERAL1;
display_node[1][1]=CAOCAO;
display_node[1][2]=CAOCAO;
display_node[1][3]=GENERAL2;
display_node[2][0]=GENERAL3;
display_node[2][1]=GENERAL5;
display_node[2][2]=GENERAL5;
display_node[2][3]=GENERAL4;
display_node[3][0]=GENERAL3;
display_node[3][1]=SOLDIER;
display_node[3][2]=SOLDIER;
display_node[3][3]=GENERAL4;
display_node[4][0]=SOLDIER;
display_node[4][1]=BLANK;
display_node[4][2]=BLANK;
display_node[4][3]=SOLDIER;
break;
}
case WM_TIMER:
{
if(current_step<hrd.depth)
current_step++;
else
{
current_step=0;
KillTimer(hwnd,1);
Sleep(2000);
}
for( i=0;i<5;i++)
for( j=0;j<4;j++)
display_node[i][j]=hrd.out[current_step].state[i][j];
InvalidateRect(hwnd, NULL, 0);
break;
}
case WM_COMMAND:
if(HIWORD(wParam)==BN_CLICKED)
switch (LOWORD(wParam))
{
case 1000:
{
//hrd= new hrd_Calculate;
hrd.InitState(display_node);
if( hrd.SearchNode())
{
sprintf(s, "解题成功!\n\n解题深度:%d 节点数:%d", hrd.depth,hrd.totalnodes);
- 陈旧衣服红酒渍应对办法,生活常识如何去除陈旧衣服上的红酒渍简单方法
- 黄河的发源地在哪里,黄河的发源地在哪里?
- 慈禧与光绪皇帝什么关系,光绪和慈禧是什么关系?
- 美术考级有用吗,美术考级有用吗
- 落日余晖映晚霞下一句,落日余晖映晚霞 一抹夕阳美如画
- 汤臣倍健维生素c片怎么服用,汤臣倍健维生素B族片和维生素C片怎么吃
- 海鲜能带上高铁吗,高铁可以带海鲜吗?
- 兼得是什么意思,两者兼得什么意思
- 迈锐宝为什么那么便宜,求知。迈锐宝为什么要比君威便宜?是品牌问题,还是做工用料问题?