C#在桌面上移动其他程序 [英] C# moving other programs around on the desktop

查看:137
本文介绍了C#在桌面上移动其他程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否有可能在屏幕上移动其他程序,例如,我点击我的程序中的一个按钮,它将在屏幕的右上角移动skype并让它在pos(x-100, Y - 50)?



如果有可能,请告诉我有关如何做到这一点的信息,因为我真的厌倦了我的游戏总是转向我的屏幕中心。

I was wondering if it is possible to move other programs around on the screen for example, i click a button in my program and it will move skype the top right of the screen and lets say its at pos(x- 100, Y - 50)?

If this is possible to do please give me information on how to do it or something, because Im really sick of my game always moving to the centre of my screen.

推荐答案

有可能是关于如何做到这一点的一些信息,我在VC ++的基础上解释但我相信你可以在C#中实现同样的目标。



通过窗口ID或搜索DesktopWindows捕获应用程序的窗口句柄

使用句柄调用SetWindowPos移动窗口
使用-setwindowpos-in-c-sharp-to-move-windows-around [ ^ ]
It is possible some information on how to do this, am explain in the basis of VC++ but I believe you can achieve the same in C#.

Capture the Window Handle of your application by window Id or by searching DesktopWindows
Using the Handle call the SetWindowPos to move your window

some examples
using-setwindowpos-in-c-sharp-to-move-windows-around[^]


这篇关于C#在桌面上移动其他程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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