没有合适的资源?快使用搜索试试~ 我知道了~
小时钟 C++代码
需积分: 10 1 下载量 194 浏览量
2012-06-10
12:16:38
上传
评论
收藏 7KB TXT 举报
温馨提示
试读
11页
用api写的C++小时钟的代码
资源推荐
资源详情
资源评论
// Clock.cpp : Defines the entry point for the application.
//
#include "stdafx.h"
//#include <afxcmn.h>
#include<math.h>
#define IDT_CLOCK 1
static int IDM_HELP=100;
static int IDM_TOPMOST=101;
LRESULT CALLBACK WndProc(HWND,UINT,WPARAM,LPARAM);
void SetIsotropic(HDC,int,int);
void DrawClockFace(HDC);
void DrawHand(HDC,int,int,int,COLORREF);
static int s_nPreHour;
static int s_nPreMinute;
static int s_nPreSecond;
static int s_cxClient;
static int s_cyClient;
static BOOL s_bTopMost;
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
char szClassName[]="MainWClass";
WNDCLASSEX wndclass;
wndclass.cbSize=sizeof(wndclass);
wndclass.style=CS_HREDRAW|CS_VREDRAW;
wndclass.lpfnWndProc=WndProc;
//
#include "stdafx.h"
//#include <afxcmn.h>
#include<math.h>
#define IDT_CLOCK 1
static int IDM_HELP=100;
static int IDM_TOPMOST=101;
LRESULT CALLBACK WndProc(HWND,UINT,WPARAM,LPARAM);
void SetIsotropic(HDC,int,int);
void DrawClockFace(HDC);
void DrawHand(HDC,int,int,int,COLORREF);
static int s_nPreHour;
static int s_nPreMinute;
static int s_nPreSecond;
static int s_cxClient;
static int s_cyClient;
static BOOL s_bTopMost;
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
char szClassName[]="MainWClass";
WNDCLASSEX wndclass;
wndclass.cbSize=sizeof(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=szClassName;
wndclass.hIconSm=NULL;
::RegisterClassEx(&wndclass);
HWND hwnd=::CreateWindowEx(
0,
szClassName,
"My Clock",
WS_POPUP|WS_SYSMENU|WS_SIZEBOX,
100,
100,
300,
300,
NULL,
NULL,
hInstance,
NULL);
if(hwnd==NULL)
{
::MessageBox(NULL,"Fail to establish the window!","error",MB_OK);
return 0;
}
::ShowWindow(hwnd,nCmdShow);
::UpdateWindow(hwnd);
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=szClassName;
wndclass.hIconSm=NULL;
::RegisterClassEx(&wndclass);
HWND hwnd=::CreateWindowEx(
0,
szClassName,
"My Clock",
WS_POPUP|WS_SYSMENU|WS_SIZEBOX,
100,
100,
300,
300,
NULL,
NULL,
hInstance,
NULL);
if(hwnd==NULL)
{
::MessageBox(NULL,"Fail to establish the window!","error",MB_OK);
return 0;
}
::ShowWindow(hwnd,nCmdShow);
::UpdateWindow(hwnd);
剩余10页未读,继续阅读
资源评论
zhouchengwei100
- 粉丝: 2
- 资源: 3
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功