admin管理员组

文章数量:1568732

2024年6月21日发(作者:)

流星雨C语言代码

#include

#define ID_TIMER 1

#define STRMAXLEN 25 //一个显示列的最大长度

#define STRMINLEN 8 //一个显示列的最小长度

LRESULT CALLBACK WndProc (HWND, UINT, WPARAM,

LPARAM) ;

//////////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////////

typedef struct tagCharChain //整个当作屏幕的一个显示列,这是

个双向列表

{

struct tagCharChain *prev; //链表的前个元素

TCHAR ch; //一个显示列中的一个字符

struct tagCharChain *next; //链表的后个元素

}CharChain, *pCharChain;

typedef struct tagCharColumn

{

CharChain *head, *current, *point;

int x, y, iStrLen; //显示列的开始显示的x,y坐标,iStrLen是这个列

的长度

int iStopTimes, iMustStopTimes; //已经停滞的次数和必须停滞

的次数,必须停滞的次数是随机的

}CharColumn, *pCharColumn;

int main(HINSTANCE hInstance, HINSTANCE hPrevInstance,

PSTR szCmdLine, int iCmdShow)

{

static TCHAR szAppName[] = TEXT ("matrix") ;

HWND hwnd ;

MSG msg ;

WNDCLASS wndclass ;

= CS_HREDRAW | CS_VREDRAW ;

dProc = WndProc ;

xtra = 0 ;

xtra = 0 ;

nce = hInstance ;

= LoadIcon (NULL, IDI_APPLICATION) ;

r = LoadCursor (NULL, IDC_ARROW) ;

kground = (HBRUSH) GetStockObject

(BLACK_BRUSH) ;

nuName = NULL ;

assName = szAppName ;

if(!RegisterClass (&wndclass))

{

MessageBox (NULL, TEXT ("此程序必须运行在NT下!"),

szAppName, MB_ICONERROR) ;

return 0;

}

hwnd = CreateWindow (szAppName, NULL,

本文标签: 显示流星雨双向链表次数