資源簡介
2012年小學期吉林大學《Windows程序設計》課部分作業。

代碼片段和文件信息
/*-------------------------------------------------
CHECKER1.C?--?Mouse?Hit-Test?Demo?Program?No.?1
(c)?Charles?Petzold?1998
-------------------------------------------------*/
#include?
#include?
#include?
#include?
#include?
LRESULT?CALLBACK?WndProc?(HWND?UINT?WPARAM?LPARAM)?;
int?squire[10][10]?;
int?fState[10][10]?;
int?explode;
HFONT?hF_big;
int?WINAPI?WinMain?(HINSTANCE?hInstance?HINSTANCE?hPrevInstancePSTR??szCmdLine?int?iCmdShow)
{
static?TCHAR?szAppName[]?=?TEXT?(“SaoLei“)?;
HWND?????????hwnd?;
MSG??????????msg?;
WNDCLASS?????wndclass?;
wndclass.style?????????=?CS_HREDRAW?|?CS_VREDRAW?;
wndclass.lpfnWndProc???=?WndProc?;
wndclass.cbClsExtra????=?0?;
wndclass.cbWndExtra????=?0?;
wndclass.hInstance?????=?hInstance?;
wndclass.hIcon?????????=?LoadIcon?(NULL?IDI_APPLICATION)?;
wndclass.hCursor???????=?LoadCursor?(NULL?IDC_ARROW)?;
wndclass.hbrBackground?=?(HBRUSH)?GetStockobject?(WHITE_BRUSH)?;
wndclass.lpszMenuName??=?NULL?;
wndclass.lpszClassName?=?szAppName?;
if?(!RegisterClass?(&wndclass))
{
MessageBox?(NULL?TEXT?(“Program?requires?Windows?NT!“)?
szAppName?MB_IConerror)?;
return?0?;
}
hwnd?=?CreateWindow?(szAppName?TEXT?(“掃雷“)
WS_OVERLAPPEDWINDOW?&?~WS_MAXIMIZEBOX?&?~WS_THICKframe
CW_USEDEFAULT?CW_USEDEFAULT
615?740
NULL?NULL?hInstance?NULL)?;
ShowWindow?(hwnd?iCmdShow)?;
UpdateWindow?(hwnd)?;
while?(GetMessage?(&msg?NULL?0?0))
{
TranslateMessage?(&msg)?;
DispatchMessage?(&msg)?;
}
return?msg.wParam?;
}
void?Drawframe(HDC?hdcint?cxClient?int?cyClient){
RECT ?rect;
int?i;
Selectobject(hdcCreateSolidBrush?(RGB?(230?170?0)));
Selectobject(hdcCreatePen(PS_SOLID3RGB(240240240)));
Rectangle(hdc00cxClientcyClient);
Selectobject(hdcCreateSolidBrush?(RGB?(240240240)));
Rectangle(hdc00cxClient100);
Selectobject(hdcCreateSolidBrush?(RGB?(230?170?0)));
Rectangle(hdc1802042095);
rect.left=180;
rect.right=420;
rect.top=20;
rect.bottom=95;
SetBkMode(hdcTRANSPARENT);
SetTextColor(hdcRGB(255255255));
hF_big=CreateFont(50000FW_NORMAL000ANSI_CHARSETOUT_DEFAULT_PRECISCLIP_DEFAULT_PRECISDEFAULT_QUALITYDEFAULT_PITCHTEXT(“微軟雅黑“));
Selectobject(hdchF_big);
DrawText?(hdc?TEXT?(“再?來?一?次“)?-1?&rectDT_SINGLELINE?|?DT_CENTER?|?DT_VCENTER)?;
for?(i?=?1;?i?<=?9;?i++)
{
MoveToEx?(hdc060*i+100?NULL);
LineTo???(hdccxClient60*i+100)?;
MoveToEx?(hdc60*i100?NULL);
LineTo???(hdc60*icyClient)?;
}
}
void?Init(){????//初始化
int?i;
int?j;
int?r1;
int?r2;
explode=0;
srand((unsigned?long)time(0));
for?(i=0;?i<10;?i++){
for?(j=0;?j<10;?j++){
squire[i][j]=0;
fState[i][j]=-2;
}
}
i=0;
while?(i<10){
r1=rand()%10;
r2=rand()%10;
if?(?squire[r1][r2]?!=?-1?){????//-1表示有雷
squire[r1][r2]?=?-1;
i++;
}
}
for?(i=0;?i<10;?i++){
for?(
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件??????35328??2012-09-04?22:45??Debug\li.exe
?????文件?????290604??2012-09-04?22:45??Debug\li.ilk
?????文件?????461824??2012-09-04?22:45??Debug\li.pdb
?????文件??????37888??2012-09-06?04:24??Debug\SaoLei.exe
?????文件?????370808??2012-09-06?04:24??Debug\SaoLei.ilk
?????文件?????543744??2012-09-06?04:24??Debug\SaoLei.pdb
?????文件??????42496??2012-09-04?23:25??Debug\ScrollingText.exe
?????文件?????991292??2012-09-04?23:25??Debug\ScrollingText.ilk
?????文件?????560128??2012-09-04?23:25??Debug\ScrollingText.pdb
?????文件??????39936??2012-09-05?20:14??Debug\Test.exe
?????文件?????362700??2012-09-05?20:14??Debug\Test.ilk
?????文件?????445440??2012-09-05?20:14??Debug\Test.pdb
?????文件??????33792??2012-09-04?21:46??Debug\WavingSine.exe
?????文件?????298292??2012-09-04?21:46??Debug\WavingSine.ilk
?????文件?????519168??2012-09-04?21:46??Debug\WavingSine.pdb
?????文件????????566??2012-09-06?04:24??SaoLei\Debug\cl.command.1.tlog
?????文件??????19420??2012-09-06?04:24??SaoLei\Debug\CL.read.1.tlog
?????文件????????274??2012-09-06?04:24??SaoLei\Debug\CL.write.1.tlog
?????文件??????????2??2012-09-06?04:24??SaoLei\Debug\li
?????文件??????????2??2012-09-06?04:24??SaoLei\Debug\li
?????文件??????????2??2012-09-06?04:24??SaoLei\Debug\li
?????文件??????????2??2012-09-06?04:24??SaoLei\Debug\li
?????文件??????????2??2012-09-06?04:24??SaoLei\Debug\li
?????文件??????????2??2012-09-06?04:24??SaoLei\Debug\li
?????文件??????????2??2012-09-06?04:24??SaoLei\Debug\li
?????文件??????????2??2012-09-06?04:24??SaoLei\Debug\li
?????文件??????????2??2012-09-06?04:24??SaoLei\Debug\li
?????文件??????????2??2012-09-06?04:24??SaoLei\Debug\li
?????文件??????????2??2012-09-06?04:24??SaoLei\Debug\li
?????文件??????????2??2012-09-06?04:24??SaoLei\Debug\li
............此處省略88個文件信息
評論
共有 條評論