设为首页
加入收藏
首页
C语言
C++
面试
Linux
函数
Windows
数据库
下载
搜索
我要投稿
全站搜索
文章
图片
软件
视频
商品
FLASH
产品
高级搜索
当前位置:
首页
->
基础
->
windows编程基础
TOP
图形基础(七十五)
2010-12-30 21:10:52
来源:
作者: 【
大
中
小
】 浏览:
40147
次
Tags:
图形
基础
显示随机矩形的程式。这个RANDRECT如程式5-7中所示。
程式5-7 RANDRECT
RANDRECT.C
/*----------------------------------------------------------------------
RANDRECT.C -- Displays Random Rectangles
(c) Charles Petzold, 1998
-----------------------------------------------------------------------*/
#include <windows.h>
#include <stdlib.h> // for the rand function
LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM) ;
void DrawRectangle (HWND) ;
int cxClient, cyClient ;
int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
PSTR szCmdLine, int iCmdShow)
{
static TCHAR szAppName[] = TEXT ("RandRect") ;
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 (&wndcl
首页
上一页
72
73
74
75
76
77
78
下一页
尾页
75
/83/83
【
大
中
小
】【
打印
】
【
繁体
】【
投稿
】【
收藏
】 【
推荐
】【
举报
】【
评论
】 【
关闭
】 【
返回顶部
】
分享到:
上一篇
:
键盘
下一篇
:
输出文字
评论
帐 号:
密码:
(
新用户注册
)
验 证 码:
表 情:
内 容:
Copyright@https://www.cppentry.com all rights reserved
粤ICP备13067022号-3
Powered by
qibosoft V7.0
Code © 2003-11
qibosoft