当前位置:网站首页>对话框管理器第一章:先热热身
对话框管理器第一章:先热热身
2022-07-21 18:53:00 【拓扑梅尔-漫漫开发路】
我认为大家关于对话框管理器的很多困惑,来自于没有真正地理解它的底层工作原理。这其实也没那么糟。在接下来的几篇文章中,我将首先描述对话框是如何创建的,然后我会讲解对话框消息循环,最后,我会再介绍一些有关导航相关的主题。
这一系列将会包含九篇文章,请做好,扶稳了。
对话框管理器的第一个主要部分,是它负责读取对话框模板并基于此模板创建一个对话框。
你会看到一些形如CreateDialogXxx的函数,它们用来创建对话框。而它们只是在底层调用CreateDialogIndirectParam这个函数。在这些函数中,有些直接是通过宏来定义的,例如CreateDialog只是简单地调用CreateDialogParam,并将一个参数设置为0.
类似的,CreateDialogIndirect也只是将一个参数设置为0并调用CreateDialogIndirectParam。
我们先来看看一个比较简单的包装器函数,如下图所示:
在上面的代码中,CreateDialogParam只是使用hinst/pszTemplate来定位对话框模板,然后使用此模板来调用CreateDialogIndirectParam,以创建对应的对话框。
好了,今天就先到这里,不复杂吧?
在下一篇文章中,我将会从一个模板中创建对话框,请小期待一下。
总结
地球人都知道,我一向不喜欢弹出式对话框,但是:人在江湖,身不由己。
TopomelBox也还是用到了一些对话框,这些对话框仅用于给使用者一些关键性提示。
要完全避免对话框的使用,我看,挺难的。但我的原则还是:对话框能不用,咱就不用。
没事瞎干扰用户干啥。
最后
Raymond Chen的《The Old New Thing》是我非常喜欢的博客之一,里面有很多关于Windows的小知识,对于广大Windows平台开发者来说,确实十分有帮助。
本文来自:《The dialog manager, part 1: Warm-ups》
边栏推荐
- OSPF 综合实验
- Development of login and exit function of Heima Ruiji takeout back desk
- 世界上最大的开源基金会 Apache 是如何运作的?
- 等额本金递增还款/等额本金递减按揭房贷还款计算器
- 能量原理与变分法笔记07: 多个自变函数的变分问题+条件极值问题的变分法+第一章的思考
- After leaving Google, the former head of go language changed to a small company
- Using tutorial 1- create X20 project and light LED lights
- < 3> Use of comparator
- 集合练习程序
- HD06-ASEMI贴片整流桥HD06
猜你喜欢
COPU名誉主席陆首群在第十七届开源中国开源世界高峰论坛上的致辞
Service & Endpoint
在线XML转CSV工具
Speech by Lu Shouqun, honorary chairman of copu, at the 17th open source China open source World Summit Forum
Time complexity hematemesis summary
How does Apache, the world's largest open source foundation, work?
世界上最大的开源基金会 Apache 是如何运作的?
Energy principle and variational method note 04: natural boundary conditions
RHCSA 硬鏈接與軟鏈接的區別、一級目錄的解釋、重定向、創建文件及目錄、删除文件及目錄、cp命令的使用、mv命令的使用
微软放弃“封禁”商业开源!
随机推荐
Moonbeam创始人解读多链新概念Connected Contract
Energy principle and variational method note 04: natural boundary conditions
从 Google 离职,前Go 语言负责人跳槽小公司
Use cpolar to build a business website (3)
集合(Properties)
RHCSA 压缩也解压缩、tar归档命令、文件的上传与下载、sehll中的变量、命令别名、命令历史
能量原理与变分法笔记05:自然边界条件例题
Différences entre les liens durs et les liens souples de rhcsa, interprétation des répertoires de premier niveau, redirection, création de fichiers et de répertoires, suppression de fichiers et de rép
集合练习程序
仅需3 小时,如何用 AI 做场景贴图,完成场景制作 ?AI创作工作流探索
Find all letter ectopic words in the string
Microgrid scheduling based on Kalman filter (matlab code implementation)
Unity C: use this keyword to expand class functions
Understanding of web standards and W3C?
C # and CAD secondary development, 20220721 essay code
Simply move one box to another. How do you realize the animation effect
day02
Concurrent modification exception
Deploy the jar package of Ruiji takeout project on the remote server and successfully run on the PC and mobile terminal
背会这些面试题,任何技术面能成功一半