用C#代码打开exe文件,如何控制窗口弹出的位置
解决方案 »
- C#程序怎样让它在杀毒软件中显示安全?
- 如何实现这样的控件功能?
- 关于3层问题
- 查找该会员所发布超过15天的所有信息
- Me.FormBorderStyle = Windows.Forms.FormBorderStyle.None,后窗体只有工作区了,我想为为它画边框,我在onpaint方法里画了后发现边框把工作区占了,如何在非工作区画上边框呢?
- 如果把ListView中显示的数据,全部放到DataTable中
- 请问 SqlDataReader 和 SqlDataAdaper 用法区别在那里
- VB里面的activeX dll项目在VS里面怎么建?顶啊
- 关于Remoting
- 文本文件的问题
- 一个古怪的问题:A窗体调用B窗体构造函数时,执行一半时又跳到A窗体的构造函数~~
- .net修改远程xml文件
exe要不是你写的,你就参考楼下的答案。
public const int SWP_NOMOVE = 0x2;
public const int SWP_NOSIZE = 0x1; [DllImport("user32.dll", SetLastError = true)]
static extern IntPtr FindWindow(string lpClassName, string lpWindowName); [DllImport("user32.dll")]
static extern bool SetWindowPos(IntPtr hWnd, int hWndInsertAfter, int X,
int Y, int cx, int cy, uint uFlags); [DllImport("user32.dll")]
static extern bool MoveWindow(IntPtr hWnd, int X, int Y, int nWidth,
int nHeight, bool bRepaint); private void Test()
{
IntPtr hWnd = FindWindow("CabinetWClass", null);
if (hWnd.ToInt32() != 0)
{
//Get positions of the specified window(GetWindowPlacement).
SetWindowPos(hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE + SWP_NOMOVE);
MoveWindow(hWnd, 90, 27, 461, 426, true);
}
}