|
| 游客已登陆
(0)未知 |
| 笔行证 |
257310 |
| 昵称 |
kuan |
| 笔贝 |
Score1 |
| 加为好友 |
发送短信 |
- 就是可以查看颜色的。比如#FFCCFF你不知道是什么颜色。你就可以用它来查看。同样你看到你喜欢的颜色。可...
- 什么??晕死啊!!
- 好 啊
- 好东西。。等学完了再来看看。。。
- 学了点东西了。。呵呵
- 注意,上面代码,有一些显示不出来.过些天,哥德会把笔客完善一下.到时.所有代码就应该没错了.
- 这个函数是计算积分的.算法思想:求积分我们可以求他的面积,,沿X轴分成n份,计算n份的面积再相加.
f...
- float integral(float(*p)(float),float a,float b,int n)
{int i;
float x,h,s;
h=(b-a)/n;
x=a;
...
- ^_^ 好东西啊
- 阿宽又一新作
呵呵 厉害啊 说得很清楚了
- 厉害 呵呵 写得简单清晰
不错啊
- ^_^ 写得不错哦
支持下
访问计数:26982本文:223 今天:1 本月 223
|
|
|
|
| |
| 2007-06-28 晴 |
|
//用C函数封装Windows程序
#include<windows.h>
#include<stdio.h>
//定义全局变量
HINSTANCE hInst;
HWND hWnd;
MSG msg;
char lpszClassName[]="窗口";
char *ShowText;
//函数声明
ATOM MyRegisterClass(HINSTANCE hInstance);
BOOL Create(HINSTANCE,int);
int Run();
LRESULT CALLBACK WndProc(HWND,UINT,WPARAM,LPARAM);
//主函数
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
MyRegisterClass(hInstance);//定义和注册窗口类
Create(hInstance,nCmdShow);//创建窗口
ShowWindow(hWnd,nCmdShow);//显示窗口
UpdateWindow(hWnd);
return Run();
}
//------------------------下面是函数的定义-------------------------
//注册窗口类的函数
ATOM MyRegisterClass(HINSTANCE hInstance)
{
WNDCLASS wc;
wc.style=0;
wc.lpfnWndProc=WndProc;
wc.cbClsExtra=0;
wc.cbWndExtra=0;
wc.hInstance=hInstance;
wc.hIcon=LoadIcon(NULL,IDI_APPLICATION);
wc.hCursor=LoadCursor(NULL,IDC_ARROW);
wc.hbrBackground=(HBRUSH)GetStockObject(WHITE_BRUSH);
wc.lpszMenuName=NULL;
wc.lpszClassName=lpszClassName;
return RegisterClass(&wc);
}
//创建窗口的函数
BOOL Create(HINSTANCE hInstance,int nCmdShow)
{
hWnd=CreateWindow(lpszClassName,
"Windows",
WS_OVERLAPPEDWINDOW,
120,50,800,600,
NULL,
NULL,
hInstance,
NULL);
return TRUE;
}
//消息循环函数
int Run()
{
while(GetMessage(&msg,NULL,0,0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return msg.wParam;
}
//窗口函数
LRESULT CALLBACK WndProc(HWND hWnd,
UINT message,
WPARAM wParam,
LPARAM lParam)
{
PAINTSTRUCT ps;
HDC hdc;
switch(message)
{
case WM_LBUTTONDOWN:
ShowText="kuanlovefeng";
InvalidateRect(hWnd,NULL,1);
break;
case WM_PAINT:
hdc=BeginPaint(hWnd,&ps);
TextOut(hdc,50,50,ShowText,12);
EndPaint(hWnd,&ps);
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
default:
return DefWindowProc(hWnd,message,wParam,lParam);
}
return 0;
}.
|
|
| # posted by kuan @ 2007-06-28 13:27:59 评论(0) |
|
|
|
|
|
|