当前位置:网站首页>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
边栏推荐
- 一篇文章教会你使用HTML5 SVG 标签
- 【自学unity2d传奇游戏开发】如何让角色动起来
- 一篇文章教会你使用Python网络爬虫下载酷狗音乐
- 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
- Construction of encoder decoder model with keras LSTM
- The data of pandas was scrambled and the training machine and testing machine set were selected
- Windows 10 tensorflow (2) regression analysis of principles, deep learning framework (gradient descent method to solve regression parameters)
- How to use Python 2.7 after installing anaconda3?
- What are the criteria for selecting a cluster server?
- 只有1个字节的文件实际占用多少磁盘空间
猜你喜欢
Even liver three all night, jvm77 high frequency interview questions detailed analysis, this?
What are PLC Analog input and digital input
Python Jieba segmentation (stuttering segmentation), extracting words, loading words, modifying word frequency, defining thesaurus
给字节的学姐讲如何准备“系统设计面试”
How to understand Python iterators and generators?
A course on word embedding
Brief introduction and advantages and disadvantages of deepwalk model
Music generation through deep neural network
The importance of big data application is reflected in all aspects
keras model.compile Loss function and optimizer
随机推荐
Introduction to Google software testing
C#和C/C++混合编程系列5-内存管理之GC协同
開源一套極簡的前後端分離專案腳手架
使用 Iceberg on Kubernetes 打造新一代雲原生資料湖
事件监听问题
一篇文章带你了解CSS3 背景知识
Custom function form of pychar shortcut key
Unity性能优化整理
快速排序为什么这么快?
Humor: hacker programming is actually similar to machine learning!
游戏主题音乐对游戏的作用
只有1个字节的文件实际占用多少磁盘空间
StickEngine-架构11-消息队列(MessageQueue)
How to get started with new HTML5 (2)
Vite + TS quickly build vue3 project and introduce related features
一篇文章教会你使用Python网络爬虫下载酷狗音乐
Get twice the result with half the effort: automation without cabinet
仅用六种字符来完成Hello World,你能做到吗?
Brief introduction and advantages and disadvantages of deepwalk model
Discussion on the technical scheme of text de duplication (1)