当前位置:网站首页>C# 调用SendMessage刷新任务栏图标(强制结束时图标未消失)
C# 调用SendMessage刷新任务栏图标(强制结束时图标未消失)
2020-11-06 21:24:00 【程序猿欧文】
本文参考C++改写 https://blog.csdn.net/dpsying/article/details/20139651 (该文章的坐标理解的有误解,会导致功能无效)
SendMessage的移动鼠标里的坐标 是基于句柄内的 坐标,并不是屏幕坐标,任务栏宽度300 高度固定40,那么就应该从宽度0-300 坐标15之间 移动过去。
首先声明需要用到的 winapi 函数


1 [DllImport("user32.dll", EntryPoint = "FindWindow")] 2 private static extern int FindWindow(string lpszClass, string lpszWindow); 3 [DllImport("user32.dll", EntryPoint = "FindWindowEx")] 4 private static extern int FindWindowEx(int hwndParent, int hwndChildAfter, string lpszClass, string lpszWindow); 5 6 [DllImport("user32.dll", EntryPoint = "GetWindowRect")] 7 private static extern int GetWindowRect(int hwnd, ref System.Drawing.Rectangle lpRect); 8 [DllImport("user32.dll", EntryPoint = "SendMessage")] 9 private static extern int SendMessage(int hwnd, int wMsg, int wParam, int lParam);10 11 private static readonly int WM_MOUSEMOVE = 512;
winapi
封装调用的流程方法
版权声明
本文为[程序猿欧文]所创,转载请带上原文链接,感谢
https://my.oschina.net/mikeowen/blog/4556921
边栏推荐
- It's time for your financial report to change to a more advanced style -- financial analysis cockpit
- What knowledge do Python automated testing learn?
- Uncle Bob: the software architecture is similar to a house. Object oriented is the structure of the house, and the water pipe is functional programming
- 零基础打造一款属于自己的网页搜索引擎
- Gather in Beijing! The countdown to openi 2020
- Solve the problem of database insert data garbled in PL / SQL developer
- Lane change detection
- Windows 10 tensorflow (2) regression analysis of principles, deep learning framework (gradient descent method to solve regression parameters)
- (1) ASP.NET Introduction to core3.1 Ocelot
- Shh! Is this really good for asynchronous events?
猜你喜欢
前端工程师需要懂的前端面试题(c s s方面)总结(二)
Custom function form of pychar shortcut key
【:: 是什么语法?】
FastThreadLocal 是什么鬼?吊打 ThreadLocal 的存在!!
Network security engineer Demo: the original * * is to get your computer administrator rights! [maintain]
A course on word embedding
The dynamic thread pool in Kitty supports Nacos and Apollo multi configuration centers
游戏开发中的新手引导与事件管理系统
What are the criteria for selecting a cluster server?
Brief introduction and advantages and disadvantages of deepwalk model
随机推荐
Asp.Net Core learning notes: Introduction
It's time for your financial report to change to a more advanced style -- financial analysis cockpit
华为Mate 40 系列搭载HMS有什么亮点?
【應用程式見解 Application Insights】Application Insights 使用 Application Maps 構建請求鏈路檢視
一篇文章带你了解HTML表格及其主要属性介绍
[efficiency optimization] Nani? Memory overflow again?! It's time to sum up the wave!!
What knowledge do Python automated testing learn?
How to use Python 2.7 after installing anaconda3?
Basic principle and application of iptables
StickEngine-架构12-通信协议
Jetcache buried some of the operation, you can't accept it
How to turn data into assets? Attracting data scientists
GUI engine evaluation index
Five vuex plug-ins for your next vuejs project
A brief history of neural networks
Pollard's Rho algorithm
Using NLP and ml to extract and construct web data
Natural language processing - wrong word recognition (based on Python) kenlm, pycorrector
The difference between gbdt and XGB, and the mathematical derivation of gradient descent method and Newton method
The importance of big data application is reflected in all aspects