Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
VIZ.Framework
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
刘龙飞
VIZ.Framework
Commits
0b2808d7
Commit
0b2808d7
authored
Dec 22, 2022
by
liulongfei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加缺失文件
parent
c0ee5238
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
65 additions
and
0 deletions
+65
-0
VIZ.Framework.Core/Core/Win32/Win32Helper.cs
+65
-0
No files found.
VIZ.Framework.Core/Core/Win32/Win32Helper.cs
0 → 100644
View file @
0b2808d7
using
log4net
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Runtime.InteropServices
;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Web.UI.WebControls
;
namespace
VIZ.Framework.Core
{
/// <summary>
/// Win32辅助类
/// </summary>
public
static
class
Win32Helper
{
/// <summary>
/// 查找窗口
/// </summary>
/// <param name="hwndParent">
/// 要查找的子窗口所在的父窗口的句柄(如果设置了hWnd,
/// 则表示从这个hwndParent指向的父窗口中搜索子窗口)要查找的子窗口所在的父窗口的句柄(如果设置了hwndParent,
/// 则表示从这个hwndParent指向的父窗口中搜索子窗口)
/// </param>
/// <param name="hwndChildAfter">
/// 子窗口句柄。查找从在Z序中的下一个子窗口开始。子窗口必须为hwndParent窗口的直接子窗口而非后代窗口。
/// 如果HwndChildAfter为NULL,查找从hwndParent的第一个子窗口开始。如果hwndParent 和 hwndChildAfter同时为NULL,
/// 则函数查找所有的顶层窗口及消息窗口
/// </param>
/// <param name="lpszClass">
/// 指向一个指定了类名的空结束字符串,或一个标识类名字符串的成员的指针。如果该参数为一个成员,
/// 则它必须为前次调用theGlobaIAddAtom函数产生的全局成员。该成员为16位,必须位于lpClassName的低16位,高位必须为0。
/// </param>
/// <param name="lpszWindow">
/// 指向一个指定了窗口名(窗口标题)的空结束字符串。如果该参数为 NULL,则为所有窗口全匹配。
/// </param>
/// <returns>
/// 找到的窗口的句柄。如未找到相符窗口,则返回零。会设置GetLastError
/// </returns>
[
DllImport
(
"user32.dll"
)]
public
static
extern
IntPtr
FindWindowEx
(
IntPtr
hwndParent
,
IntPtr
hwndChildAfter
,
string
lpszClass
,
string
lpszWindow
);
/// <summary>
/// 改变指定窗口的位置和大小
/// </summary>
/// <param name="hWnd">指定了窗口的句柄</param>
/// <param name="X">指定了窗口的X坐标</param>
/// <param name="Y">指定了窗口的Y坐标</param>
/// <param name="nWidth">指定了窗口的宽度</param>
/// <param name="nHeight">指定了窗口的高度</param>
/// <param name="bRepaint">指定了是否要重画窗口</param>
/// <returns>是否操作成功</returns>
[
DllImport
(
"user32.dll"
)]
public
static
extern
bool
MoveWindow
(
IntPtr
hWnd
,
int
X
,
int
Y
,
int
nWidth
,
int
nHeight
,
bool
bRepaint
);
/// <summary>
/// 设置
/// </summary>
/// <param name="hWnd"></param>
/// <param name="hWndParent"></param>
/// <returns></returns>
[
DllImport
(
"user32.dll"
)]
public
static
extern
IntPtr
SetParent
(
IntPtr
hWnd
,
IntPtr
hWndParent
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment