zcgw.net
当前位置:首页 >> C# sEtwinDowpos >>

C# sEtwinDowpos

public const uint SWP_NOSIZE = 0x1; public const uint SWP_NOMOVE = 0x2; public const uint SWP_SHOWWINDOW = 0x40; public const UInt32 SWP_NOACTIVATE = 0x0010;

1.你要实现上述功能直接使用.NET库就可以了,为什么非得用Windows API? 2.请把错误信息贴出来

SetWindowPos(hwnd, 0, 0, 0, 0, 0, 0);//hwnd是窗体句柄

置顶可以将topmost设为true; 上面两位调用windiows API函数当也是可以的。。

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

using System.Runtime.InteropServices; using System.Diagnostics; [DllImport("user32")] public static extern long SetWindowPos(IntPtr hwnd , long hWndInsertAfter , long x , long y , long cx , long cy , long uFlags); hwnd是窗体句...

class Program { [DllImport( "Win32dll.dll", EntryPoint = "FuncA" )] public static extern long FuncA(); static void Main( string[] args ) { FuncA(); } } 类似这样的方法引用dll中的函数,如果找不到命名空间,用: using System.Runtim...

用api设置窗体的parent window ,提供几个api给你 ,可以设置窗体的parent,窗体的位置,去掉窗体的边框等,用C#中的Process类可以获取外部程序的主窗体句柄(IntPtr) public const int GWL_STYLE = -16; //public const int WS_VISIBLE = 0x1000...

引用: using System.Runtime.InteropServices; 在定义部分引入下面两个函数: [DllImport("user32")] private static extern IntPtr FindWindow(string lpClassName,string lpWindowName); [DllImport("user32")] private static extern IntPtr...

窗体.showdialog();

网站首页 | 网站地图
All rights reserved Powered by www.zcgw.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com