我想做一个程序,这个程序可在运行的时候动态的修改其它程序的大小与位置

builderman 2004-11-09 04:59:00
我想做一个程序,这个程序可在运行的时候动态的修改其它程序的大小与位置
请和位大侠指点指点
我想可能需要用到几个api
...全文
79 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
北京的雾霾天 2004-11-09
  • 打赏
  • 举报
回复

可能会用到这些吧:

[System.Runtime.InteropServices.DllImport("user32.dll")]
private static extern IntPtr FindWindow(string strclassName, string strWindowName);

[System.Runtime.InteropServices.DllImport("user32.dll")]
public static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);

[System.Runtime.InteropServices.DllImport("user32.dll")]
private static extern bool SetWindowPos(IntPtr hWnd, IntPtr pWndInsertAfter,int x,int y,int cx,int cy,uint nFlags );
[System.Runtime.InteropServices.DllImport("user32.dll")]
private static extern bool OpenIcon(IntPtr hWnd);

[System.Runtime.InteropServices.DllImport("user32.dll")]
private static extern bool IsIconic(IntPtr hWnd);

[System.Runtime.InteropServices.DllImport("user32.dll")]
private static extern int SetForegroundWindow(IntPtr hWnd);
Tomgus 2004-11-09
  • 打赏
  • 举报
回复
学习
cnhgj 2004-11-09
  • 打赏
  • 举报
回复
using System.Runtime.InteropServices;

[DllImport("user32.dll", EntryPoint="FindWindow")]
public static extern int FindWindow (
string lpClassName,
string lpWindowName
);

[DllImport("user32.dll", EntryPoint="MoveWindow")]
public static extern int MoveWindow (
int hwnd,
int x,
int y,
int nWidth,
int nHeight,
int bRepaint
);

private void button1_Click(object sender, System.EventArgs e)
{
int hwnd = FindWindow(null,"我的电脑");
MoveWindow(hwnd, 0, 0 ,200, 300, 1);
}
zhounet 2004-11-09
  • 打赏
  • 举报
回复
顶四下~~
paulwoo 2004-11-09
  • 打赏
  • 举报
回复
頂三下~~~
paulwoo 2004-11-09
  • 打赏
  • 举报
回复
頂兩下~~
paulwoo 2004-11-09
  • 打赏
  • 举报
回复
頂一下~~
swzlxm 2004-11-09
  • 打赏
  • 举报
回复


只有API了,具体不太清,取得窗体的句柄之类的,

110,567

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧