当前位置:网站首页>els 消息循环
els 消息循环
2022-07-26 03:10:00 【joker_0030】
#include<Windows.h>
int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPreInstance,LPSTR ipCmdLine,int nCmdShow)
{
//初始化窗口类。
WNDCLASSEX db;
HWND hWnd;
MSG msg;//结构体变量。
db.cbClsExtra = 0;
db.cbSize = sizeof(WNDCLASSEX);
db.cbWndExtra = 0;
db.hbrBackground = (HBRUSH)COLOR_WINDOW;
db.hCursor = NULL;
db.hIcon = NULL;
db.hIconSm = NULL;
db.hInstance = hInstance;
db.lpfnWndProc = NULL;
db.lpszClassName = "els";
db.lpszMenuName = NULL;
db.style = CS_HREDRAW | CS_VREDRAW;
if(0==RegisterClassEx(&db));
{
int a = GetLastError();
return 0;
}
//创建窗口。hWnd窗口句柄 失败返回NULL。
hWnd=CreateWindowEx(WS_EX_TOPMOST,"els","elsfangkuai",WS_OVERLAPPEDWINDOW,100,100,100,100,NULL,NULL,hInstance,NULL);
if (NULL == hWnd)//窗口句柄。 窗口的唯一标识。
{
return 0;
}
//显示窗口
ShowWindow(hWnd, nCmdShow);
//消息循环。队列。
//返回值:失败返回NULL。
//参数1:指向MSG消息结构体的指针。
//参数2:指定窗口的句柄,用处理该窗口的消息。NULL表示当前实列的所有信息。
//参数3,4:设定要处理的消息的范围,0,0表示所有信息。
GetMessage(&msg, NULL, 0, 0)//NULL和非NULL的区别。
{
//该函数将虚拟键消息转换字符消息。字符消息被寄送到调用现成的消息队列里。
//返回值:如果消息被转换,返回非零值。
//参数:指向MSG消息结构体的指针。
TranslateMessage(&msg);//翻译消息。
//该函数分发一个消息给窗口程序。
//返回值:返回值是窗口程序返回的值。尽管返回值的含义依赖于被调度的信息,但返回值通常被忽略。
//参数:指向MSG消息结构体的指针。
DispatchMessage(&msg);//分发消息。标准消息 命令消息 通知消息 自定义消息。
}
return 0;
}
边栏推荐
- Unity quickly builds urban scenes
- ES6 set and map
- What's good for starting a business with 10000 yuan? Is we media OK?
- Dataframe sorting: datetime format splitting; Delete a specific line; Group integration.
- The source of everything, the choice of code branching strategy
- Parallelloopbody in opencv
- 【TensorFlow&PyTorch】图像数据增强API
- Neo4j import CSV data error: neo4j load CSV error: couldn't load the external resource
- Arthas download and startup
- How about GF Securities? Is it safe to open an account online?
猜你喜欢

Matlab simulation of vertical handover between MTD SCDMA and TD LTE dual networks

OxyCon 2022 网络抓取前沿大会即将开启!

Standardize your own debug process

Opencv 在图像上进行标注(画框+写字)

ByteDance (Tiktok) software test monthly salary 23K post, technical two-sided interview questions are newly released

How to close the case prompt icon of win11? Closing method of win11 case prompt Icon
![[SQL] 自连接的用法](/img/92/92474343b4b4e6ea60453b4799cb55.jpg)
[SQL] 自连接的用法

记一次SQL优化

MySQL tutorial: MySQL database learning classic (from getting started to mastering)

Unknown-Aware Object Detection:Learning What You Don’t Know from Videos in the Wild(CVPR 2022)
随机推荐
多线程编程
[translation] safety. Value of sboms
How to design test cases according to the requirements of login testing?
Understand preloading and lazy loading, and learn slow animation
STM - exti external interrupt learning notes
canvas——矩形的绘制——柱状图的制作
FPGA_Vivado软件初次使用流程_超详细
Anti electronic ink screen st7302
一切的源头,代码分支策略的选择
CMD CPM command summary
.net serialize enumeration as string
【尤里复裂人】带你轻松理解——深拷贝和浅拷贝
QT signal transmission between multi-level objects signal transmission between multi-level nested class objects
Win11麦克风权限的开启方法
js中数组排序的方法有哪些
Detailed explanation of extended physics informedneural networks paper
Execution process behind shell commands
"Xiao Deng's view" the value brought by Siem to enterprises (II)
Installation and operation of orb-slam2 under ROS
canvas——心电图的设计,以及如何清理画布