当前位置:网站首页>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
边栏推荐
- NLP model Bert: from introduction to mastery (1)
- What are Devops
- Free patent download tutorial (HowNet, Espacenet)
- Details of dapr implementing distributed stateful service
- How to use parameters in ES6
- Introduction to the structure of PDF417 bar code system
- StickEngine-架构11-消息队列(MessageQueue)
- 零基础打造一款属于自己的网页搜索引擎
- Get twice the result with half the effort: automation without cabinet
- Building and visualizing decision tree with Python
猜你喜欢
Individual annual work summary and 2019 work plan (Internet)
If PPT is drawn like this, can the defense of work report be passed?
StickEngine-架构11-消息队列(MessageQueue)
Word segmentation, naming subject recognition, part of speech and grammatical analysis in natural language processing
Behind the first lane level navigation in the industry
What to do if you are squeezed by old programmers? I don't want to quit
Using NLP and ml to extract and construct web data
[Xinge education] poor learning host computer series -- building step 7 Simulation Environment
一篇文章教会你使用Python网络爬虫下载酷狗音乐
Brief introduction and advantages and disadvantages of deepwalk model
随机推荐
MeterSphere开发者手册
2020年数据库技术大会助力技术提升
Introduction to X Window System
只有1个字节的文件实际占用多少磁盘空间
JVM内存分配 -Xms128m -Xmx512m -XX:PermSize=128m -XX:MaxPermSize=512m
Three Python tips for reading, creating and running multiple files
ES6学习笔记(二):教你玩转类的继承和类的对象
keras model.compile Loss function and optimizer
【應用程式見解 Application Insights】Application Insights 使用 Application Maps 構建請求鏈路檢視
新建一个空文件占用多少磁盘空间?
Pollard's Rho algorithm
Unity性能优化整理
Using NLP and ml to extract and construct web data
[C] (original) step by step teach you to customize the control element - 04, ProgressBar (progress bar)
Windows 10 tensorflow (2) regression analysis of principles, deep learning framework (gradient descent method to solve regression parameters)
每个大火的“线上狼人杀”平台,都离不开这个新功能
What are the common problems of DTU connection
How to hide part of barcode text in barcode generation software
Music generation through deep neural network
【字节跳动 秋招岗位开放啦】Ohayoo!放学别走,我想约你做游戏!!!