实现星空流动效果
代码如下
#include
#include
const int StarNum = 300;
void DrawStar (HWND hwnd);
int cxClient, cyClient;
short arr[StarNum][3];
HDC hdc;
static int num= 0;
LRESULT CALLBACK WndProc(HWND hwnd, UI...
windows 随机矩形绘制
代码如下
#include
void DrawRect (HWND hwnd);
int cxClient, cyClient;
LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
int WINAPI WinMain(HINSTANCE hInstan...
protected override void WndProc(ref Message m) { const int WM_SYSCOMMAND = 0x0112; const int SC_CLOSE = 0xF060; if (m.Msg == WM_SYSCOMMAND...
分类:
其他好文 时间:
2014-09-14 23:35:17
阅读次数:
264
程序运行效果:在创建窗口的时候,播放一个声音。且在窗口的客户区中央画一句文字:Hello, Windows 98!,无论程序怎么移动、最大化,文字始终在程序的中央部位。程序总共分为六个步骤:定义,注册,创建,显示,刷新,消息循环。其中定义部分还包括一个窗口回调函数WndProc。/*--------...
WndProc函数作用:主要用在拦截并处理系统消息和自定义消息比如:windows程序会产生很多消息,比如你单击鼠标,移动窗口都会产生消息。这个函数就是默认的消息处理函数。你可以重载这个函数来制定自己的消息处理流程.在CS中,可以重写WndProc函数,来捕捉所有发生有窗口消息。这样,我们就可以"篡...
分类:
其他好文 时间:
2014-09-13 22:47:26
阅读次数:
176
LRESULT CALLBACK WndProc(...){case WM_CREATE: .... return 0;case WM_DESTROY: PostQuitMessage (0) ; return 0 ; return DefWindowProc (hwnd, message, wPa...
本程序使用GetSystemMetrics获取windows各种图像选项,并输出字符到窗口中。#define WINVER 0x0500#include #include "sysmets.h"LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM)...
第一个win32程序,简单的创建窗口:#include LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM) ;int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, ....
const int WM_SYSCOMMAND = 0x0112;const int SC_CLOSE = 0xF060; protected override void WndProc(refMessage msg) { if (msg.Msg == WM_SYSCOMMAND&& ((int)....
protected override void WndProc(ref Message m) { const int WM_SYSCOMMAND = 0x0112; const int SC_CLOSE = 0xF060; if (m.Msg == WM_SYSCOMMAND...
分类:
其他好文 时间:
2014-08-13 12:49:36
阅读次数:
184