会员
周边
捐助
新闻
博问
闪存
赞助商
所有博客
当前博客
我的博客
我的园子
账号设置
简洁模式
...
退出登录
注册
登录
90%
sqmw
The awakening is always delayed, there seems to be some fog
博客园
|
首页
|
新随笔
|
新文章
|
联系
|
订阅
|
管理
2022年7月28日
测试html
摘要: 前缀 说明 WM_XXX msgId,系统定义的1-1023总共1024个 VK_XXX 虚拟键 SC_XXX System command
阅读全文
posted @ 2022-07-28 23:45 sqmw
阅读(21)
评论(0)
推荐(0)
编辑
win32 添加菜单
摘要: 菜单的分类 窗口顶层菜单: 弹出式菜单(标准叫法){下拉菜单:点击窗口顶层菜单形成的的下拉菜单、右键形成的} 系统菜单:操作系统提供的,每一个程序,左上角ICON都会有 菜单是容器,装的是菜单项,每个菜单项都有自己的ID 点击菜单项会产生 WM_COMMAND WM_COMMAND[命令消息] 对于
阅读全文
posted @ 2022-07-28 22:08 sqmw
阅读(162)
评论(0)
推荐(0)
编辑
C语言各种数据类型的输出
摘要: unsigned long %lu long %ld long long %lld (有符号类型),%llu (无符号类型) short %hd(以十进制显示), %ho(以八进制显示)
阅读全文
posted @ 2022-07-28 16:21 sqmw
阅读(184)
评论(0)
推荐(0)
编辑
win32 API SetTimer()定时器消息(类似js的SetInterval())
摘要: WM_TIMER 设置好定时器之后,会周期产生(GetMessage()产生)WM_TIMER这个消息(精度很高ms,准确性很低) wParam:定时器ID lParam:定时器的处理函数指针 创建定时器 UINT_PTR SetTimer( //UINT_PTR 64位的int,创建成功,返回 非
阅读全文
posted @ 2022-07-28 13:11 sqmw
阅读(306)
评论(0)
推荐(0)
编辑
win32 API 鼠标消息简单说明
摘要: wParam : 其他按键的状态(Ctrl / Shift 等) lParam : 鼠标的位置信息LOWORD(lParam) : 水平位置 HIWORD(lParam) 垂直位置(可能是相对于屏幕的,也可能是相对于窗口的) 鼠标消息一般成对出现 down / up,鼠标移动的过程中会产生 WM_M
阅读全文
posted @ 2022-07-28 12:06 sqmw
阅读(243)
评论(0)
推荐(0)
编辑
win32 各种宏说明
摘要: 前缀 说明 WM_XXX msgId,系统定义的1-1023总共1024个 VK_XXX 虚拟键 WS_XXX 窗口样式 CS_XXX 窗口类的style SW_XXX Show Window nCmdShow PM_XXX PeekMessage SC_XXX System command
阅读全文
posted @ 2022-07-28 11:49 sqmw
阅读(105)
评论(0)
推荐(0)
编辑
win32 API 键盘消息以及 WM_CHAR
摘要: 键盘消息 分类:[ WM_KEYDOWN WM_KEYUP WM_SYSKEYDOWN 如 alt F10 WM_SYSKEYUP 如 alt F10 WPARAM : 按键的 virtual key,就是按键的键码 VK_XXX LPARAM : 按键的参数,例如按下的次数 ] WM_CHAR:
阅读全文
posted @ 2022-07-28 11:37 sqmw
阅读(381)
评论(0)
推荐(0)
编辑
win32 API InvalidateRect
摘要: //用来声明失效的区域,即需要重绘的区域,最终会产生 WM_PAINT->由GetMessage发出 BOOL InvalidateRect(){ //自身不产生消息 HWND hWnd, // CONST RECT* lpRect, //矩形的重绘区域 NULL:全部 BOOL bErase, /
阅读全文
posted @ 2022-07-28 11:29 sqmw
阅读(94)
评论(0)
推荐(0)
编辑
win32 API 消息分类
摘要: 消息分类[系统消息,用户自定义消息] 系统消息 id [0-0x03FF],系统定义的消息,可以直接使用 1024个 自定义消息 id 0x0400 - 0x7FF[31743个] 为了方便自定义消息设置的宏 WM_USER {自己发送自己处理} (WM_USER == 1024) 自定义消息用Se
阅读全文
posted @ 2022-07-28 11:19 sqmw
阅读(67)
评论(0)
推荐(0)
编辑
win32 API SendMessage&PostMessage
摘要: BOOL PostMessage() | SendMessage(){ HWND hWnd, //消息发送的目的窗口 UINT Msg, //msgId WPARAM wparam, // 消息参数 LPARAM lParam // 消息参数 } SendMessage() 产生非队列消息,消息处理
阅读全文
posted @ 2022-07-28 11:15 sqmw
阅读(349)
评论(0)
推荐(0)
编辑
win32申请Console并且重定向输出流到Console
摘要: BOOL AllocConsole() //申请控制台 freopen("CONOUT$", "w", stdout); //重定向输出流至控制台 [FILE *freopen(const char *path, const char *mode, FILE *stream);] printf()
阅读全文
posted @ 2022-07-28 11:12 sqmw
阅读(104)
评论(0)
推荐(0)
编辑
win32常见的msgId(WM_XXX)说明
摘要: msgId | WM_XXX 产生时间 携带参数 一般用法 WM_DESTROY 窗口销毁时 窗口销毁前做处理,这个消息是defWndProc放进消息队列的 WM_QUIT 该消息由程序员发送 wParam PostQuitMessage()传递的参数 lParam:0; 这个消息不需要我们处理 W
阅读全文
posted @ 2022-07-28 11:00 sqmw
阅读(199)
评论(0)
推荐(0)
编辑
win32窗口处理函数
摘要: 是否所有窗口都具有? 窗口处理函数是每个窗口都具有的,并且参数和返回值格式必须为: LRESULT CALLBACK WndProc(hWnd,msgId,wParam,lParam){}//[函数的名字可以随便改]
阅读全文
posted @ 2022-07-28 10:40 sqmw
阅读(53)
评论(0)
推荐(0)
编辑
win32的GetMessage和PeekMessage
摘要: GetMessage 收到quit信息的时候就会返回 FALSE windows含有1024个消息id WM_XXX BOOL GetMessage(){ //阻塞函数,系统没有消息的时候,等候下一个消息 LPMSG lpMsg, //存放消息的buff HWND hWnd, //被抓消息的窗口的句
阅读全文
posted @ 2022-07-28 10:38 sqmw
阅读(269)
评论(0)
推荐(0)
编辑
windows消息
摘要: windows平台下面消息的结构(6个部分) typedef struct tagMSG { HWND hwnd; UINT message; WPARAM wParam; LPARAM lParam; DWORD time; POINT pt; } MSG 1. hWnd //产生消息的窗口 2.
阅读全文
posted @ 2022-07-28 10:24 sqmw
阅读(29)
评论(0)
推荐(0)
编辑
win32创建子窗口
摘要: win32创建子窗口(直接CreateWindow,不需要ShowWindow) 创建子窗口需要设置父窗口的句柄 风格需要添加 WS_CHILD | WS_VISIBLE
阅读全文
posted @ 2022-07-28 10:16 sqmw
阅读(377)
评论(0)
推荐(0)
编辑
win32的MessageBox()以及返回值
摘要: int MessageBox( HWND hWnd, //所有者窗口的句柄 LPCTSTR lpText, //消息框中的文本地址 LPCTSTR lpCaption, //消息框标题的地址 UINT UTYPE //样式的消息框 MB_XXX MB_ICONXXX ); 返回值: IDABORT
阅读全文
posted @ 2022-07-28 09:58 sqmw
阅读(333)
评论(0)
推荐(0)
编辑
公告