如何以编程方式移动Windows任务栏? [英] How to programmatically move Windows taskbar?

查看:184
本文介绍了如何以编程方式移动Windows任务栏?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道任何类型的API或解决方法(例如脚本或注册表)将Windows任务栏移动(或调整)到另一个位置,包括另一个显示器(如果是双显示器)。当然,我们可以使用鼠标移动任务栏,但是我想通过一个程序或一种自动的方式移动它。

I'd like to know any sort of API or workaround (e.g., script or registry) to move (or resize) Windows taskbar to another position including another monitor (if dual monitors). Definitely, we can move task bar by using mouse, but I want to move it by a program, or a sort of automated way.

我试图找到Win32 API,

I tried to find Win32 API, but it seems no one does this job.

编辑:我对许多人的意见感到惊讶。让我解释为什么我想要它。在我的工作场所,我使用双显示器(分辨率不同),并且任务栏放置在左监视器上,而主监视器是正确的监视器。但是,我经常通过远程桌面连接到我的工作场所计算机。远程连接后,将切换任务栏位置。这就是为什么我想做一个简单的程序,可以保存/恢复任务栏的位置。每天我必须重新排列我的任务栏。而已。

EDIT: I was surprised by many people's opinion. Let me explain why I wanted it. In my workplace, I'm using dual monitors (resolutions are different), and the taskbar is placed on the left monitor while the primary monitor is the right monitor. However, I often connect to my workplace computer via remote desktop. After the remote connection, the taskbar position is switched. That's why I wanted to make a simple program that can save/restore taskbar's position. Everyday I have to rearrange my taskbar. That's it. I just want it for me.

推荐答案

据我所知,Vista和其他版本任何程序试图移动任务栏。旧的方法是ABM_SETPOS + MoveWindow,并且这不再在任务栏上工作。我知道的唯一方法仍然工作是模拟鼠标移动(点击移动释放)。我已经读过这个方法,但我从来没有做过。

As far as I can tell, Vista and onwards ignore any program trying to move the taskbar. The old method was ABM_SETPOS + MoveWindow, and this no longer works on the taskbar. The only way that I am aware of that still works is simulating a mouse move (click-move-release). I've read about that method, but I've never done it myself.

这篇关于如何以编程方式移动Windows任务栏?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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