一.命令消息

有两个命令

1.WM_SYSCOMMAND

这个命令与本身程序有关,如最小化窗体,关闭窗体等

2.WM_APPCOMMAND

这个命令可以控制操作系统本身的很多功能,如打开浏览器,邮箱,调节音量等.

使用非常简单,无须额外的处理

SendMessage(hwnd,WM_APPCOMMAND, (WPARAM)hwnd, MAKELPARAM(0x0000, APPCOMMAND_VOLUME_UP));

二.SHDeleteKey,RegDeleteKey

Deletes a subkey and all its descendants. The function will remove the key and all of the key's values from the registry.

发现SH开头的函数都是那么的方便

RegDeleteKey

Deletes a subkey and its values.

三.GetWindowThreadProcessId

获取创建该窗体线程的进程

//获得应用程序指针
CDemoApp* pApp = (CDemoApp*)AfxGetApp();
//获得主窗口指针
CWnd* pMainWnd = pApp->m_pMainWnd;
DWORD word=::GetCurrentProcessId();
DWORD pword;
GetWindowThreadProcessId(pMainWnd->GetSafeHwnd(),&pword);
ASSERT(word==pword);

四.SendMessageTimeout

If the specified window was created by the calling thread, the window procedure is called immediately as a subroutine. If the specified window was created by a different thread, the system switches to that thread and calls the appropriate window procedure. Messages sent between threads are processed only when the receiving thread executes message retrieval code. The sending thread is blocked until the receiving thread processes the message. However, the sending thread will process incoming nonqueued messages while waiting for its message to be processed. To prevent this, use SendMessageTimeout with SMTO_BLOCK set.

五.LoadImage && CopyImage

Loads an icon, cursor, animated cursor, or bitmap.

     wndclass.hIcon=LoadImage(hInstance,MAKEINTRESOURCE (IDI_ICON),IMAGE_ICON,32,32,LR_DEFAULTCOLOR);//wndclass.hIcon         = LoadIcon (hInstance, MAKEINTRESOURCE (IDI_ICON)) ;

可以理解为LoadImage为LoadIcon、LoadCursor、LoadBitmap的一个全局函数,但是销毁资源时候还是需要用到DestoryIcon,DestoryCursor等

HANDLE CopyImage(      HANDLE hImage,UINT uType,int cxDesired,int cyDesired,UINT fuFlags
);

同理CopyImage也可以复制原有的Icon、Cursor、Bitmap等资源

六.GetInputState

The GetInputState function determines whether there are mouse-button or keyboard messages in the calling thread's message queue.

七.SendInput

The SendInput function synthesizes keystrokes, mouse motions, and button clicks.

http://baike.baidu.com/view/3638567.htm

模拟鼠标,键盘事件

八.AttachThreadInput

Windows created in different threads typically process input independently of each other. That is, they have their own input states (focus, active, capture windows, key state, queue status, and so on), and they are not synchronized with the input processing of other threads. By using the AttachThreadInput function, a thread can attach its input processing to another thread. This also allows threads to share their input states, so they can call the SetFocus function to set the keyboard focus to a window of a different thread. This also allows threads to get key-state information. These capabilities are not generally possible.

转载于:https://www.cnblogs.com/Clingingboy/archive/2011/06/06/2073611.html

Visual C++ 2011-5-27相关推荐

  1. Visual Studio 2011开发者预览版发布

    关键词:Visual,Studio | 作者:虫虫 | 收藏这篇资讯 Visual Studio 2011,也叫"vNext"是微软的下一代IDE.它覆盖了软件开发的整个生命周期, ...

  2. 2011/08/27 刷机器,遭遇白苹果,不可连接ipod服务器 的解决

    2011/08/27 刷机器,遭遇白苹果,不可连接ipod服务器 的解决 是第一代手机i, 版本支持有好多限制,每次都是不像样子了,才刷机 是在被逼无奈,家里的机器连不上手机,手机的也不能传送歌曲下载 ...

  3. 终于记住回车和换行cr lf的来由和含义了 -参考: http://www.cnblogs.com/me115/archive/2011/04/27/2030762.html...

    回车: carriage return, 是将光标在同一行中, 回到当前行的 行首. 回来的本意就是 返回.. 所以 是同一行的行首. CR 换行: line feed: feed: 饲养(动物); ...

  4. SQL查询效率注意事项 2011.12.27

    一.查询条件精确,针对有参数传入情况 二.SQL逻辑执行顺序 FROM-->JOIN-->WHERE-->GROUP-->HAVING-->DISTINCT-->O ...

  5. 2011年11月27日学习内容总结

    1.使用JDBC连接数据库五个步骤,每个步骤的原因.加载驱动:连接不同的数据库要加载不同的驱动:建立连接:访问一个数据库,要知道IP+端口号+数据库名,此外还有用户名和密码:声明要求:将sql语句传送 ...

  6. (Microsoft) Visual Studio LightSwitch

    在蓝色小铺,听到了前辈 阿源哥哥提到  Visual Studio LightSwitch "号称"  可以快速开发桌面.云端的应用程序. http://www.microsoft ...

  7. Visual Studio 2005 重置设置

    http://www.cnblogs.com/xiebin1986/archive/2011/06/27/2091201.html 开始->所有程序->Microsoft Visual S ...

  8. Visual C++中的C运行时库浅析

    1.概论 运行时库是程序在运行时所需要的库文件,通常运行时库是以LIB或DLL形式提供的.C运行时库诞生于20世纪70年代,当时的程序世界还很单纯,应用程序都是单线程的,多任务或多线程机制在此时还属于 ...

  9. 中南大学计算机二级证书领取,中南大学本科生院医学教育办2011下半年全国计算机等考报名通知...

    关于2011年下半年第34次全国计算机等级考试报名的通知 各年级办.学生班: 2011年下半年第34次全国计算机等级考试报名工作即将开始,现将有关事项通知如下: 一.考试时间 笔试2011年9月17日 ...

  10. 2011年工作总结和展望(上篇)

    还有几天就是辞旧迎新的日子了,在即将迈入2012年的时候,我们有必要总结一下过去的2011.主要讨论自己在工作上的相关事情,同时对未来技术一个展望,观点只代表本人,不涉及我所在的公司. 2011年3月 ...

最新文章

  1. 信用评分如何应用在风控策略中(二)
  2. Python 读写操作Excel —— 安装第三方库(xlrd、xlwt、xlutils、openpyxl)
  3. iptables redirect 劫持跳转引起 Go 服务故障
  4. Linux进程分配内存的两种方式--brk() 和mmap()
  5. java运维工程师做什么_网络工程师和网络运维工程师有什么不同?
  6. Appnium学习日记一(下载安装Appnium)
  7. 白鹭引擎 - 事件机制 ( Event, addEventListener, dispatchEvent )
  8. WEB应用程序--概述
  9. Second copy 的增量备份
  10. 相机标定—— 张正友标定法(2)
  11. 【文献管理】Zotero基础操作
  12. Dalvik与ART的介绍及区别(一)
  13. LaTex关于数学公式的使用(7)--- 函数单边大括号
  14. 双十一,美团为何静悄悄?
  15. fastdfs安装部署整理
  16. VS Code 多光标快捷键
  17. 如何搬运短视频,从快手搬运视频图文教程攻略
  18. 2022.11.27 第10次周报
  19. 心流:提升幸福的奥秘
  20. 把微信做成找券机器人,淘宝查券返利小助手实现方法分享

热门文章

  1. 一键发布部署vs插件[AntDeploy],让net开发者更幸福
  2. 互联网开发(一) 并发基础知识
  3. Android 用户界面---定制组件(Custom Components)
  4. 求最小子数组之二维篇
  5. websocket心跳链接代码_Hyperf+RabbitMQ+WebSocket实现大屏幕消息推送
  6. C语言经典例80-猴子分桃
  7. 【组合数学】递推方程 ( 通解定义 | 无重根下递推方程通解结构定理 )
  8. 【Android 性能优化】应用启动优化 ( 安卓应用启动分析 | Launcher 应用启用普通安卓应用 | 应用进程分析 )
  9. 【Android RTMP】x264 图像数据编码 ( NV21 格式中的 YUV 数据排列 | Y 灰度数据拷贝 | U 色彩值数据拷贝 | V 饱和度数据拷贝 | 图像编码操作 )
  10. 【计算理论】下推自动机 PDA ( 设计下推自动机 | 上下文无关语法 CFG 等价于 下推自动机 PDA )