获取任务栏按钮的位置 [英] Get Position of Taskbar button

查看:105
本文介绍了获取任务栏按钮的位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是专门针对Windows 7的,但任何见解都会很棒。我的应用程序当前启动并在光标位置显示一个表单,但这对于我想要的是不可行的,因为用户可以在启动应用程序后快速移动鼠标。那么我如何获得任务栏按钮的位置并在那里显示窗口?

解决方案

http://forums.devshed.com/c-programm...-c- 295635.html
http://support.microsoft.com / kb / 179908


看起来你需要使用一些windows dll来拨打你需要的电话,这意味着你需要使用dllimport的。我不想在这里解释它,因为我自己使用它并不熟悉,并且对Windows库本身没有很好的理解。


Google应该能够帮助你弄清楚你需要什么,或者希望在这方面有更多经验的人可以帮助你。这两个链接应该让你开始吧。


祝你好运!


如果我错了,请纠正我但......任务栏在主监视器。这就是使该监视器成为主要的原因,对吗?所以只需要获得主屏幕的WorkingArea。


在MSDN上为System.Windows.Forms.Screen.AllScreens做一点阅读;


当你说任务栏按钮时,你的意思是位于菜单栏中的启动器(类似于XP中的快速启动栏)?

为什么你的表单需要在启动器旁边弹出?

This is specifically for Windows 7, but any insight would be great. My app currently starts up and shows a form at the cursor position, but this is not feasible for what I would like as the user can quickly move the mouse after launching the application. So how would I got about getting the position of the task bar button and showing the window there?

解决方案

http://forums.devshed.com/c-programm...-c-295635.html
http://support.microsoft.com/kb/179908

It looks like you need to use some of the windows dlls to make the call you need, which means you''ll need to make use of DLLImport. I won''t try to explain it here because I''m pretty new at using it myself, and don''t have a good understanding of the windows libraries themselves.

Google should be able to help you figure out what you need, or hopefully someone here with more experience in that area can help you. Those two links should get you started though.

Good luck!


Correct me if I am wrong but... The taskbar is on the primary monitor. That''s what makes that monitor "primary", right? So just get the WorkingArea of the primary screen.

Do a little reading on MSDN for System.Windows.Forms.Screen.AllScreens;


When you say taskbar button, you mean the launcher that sits in the menu bars (similar to the "quick launch" bar in XP)?
Why does your form need to popup right next to the launcher?


这篇关于获取任务栏按钮的位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆