Add simple function to get a specified processes main Window as an instance of Wnd32
This commit is contained in:
parent
2c26188fd9
commit
1b59434855
|
@ -1,6 +1,7 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
|
@ -19,6 +20,8 @@ namespace CC_Functions.W32
|
|||
|
||||
public static Wnd32 fromHandle(IntPtr handle) => new Wnd32(handle);
|
||||
|
||||
public static Wnd32 getProcessMain(Process process) => fromHandle(process.MainWindowHandle);
|
||||
|
||||
public static Wnd32 fromMetadata(string lpClassName = null, string lpWindowName = null) =>
|
||||
fromHandle(FindWindow(lpClassName, lpWindowName));
|
||||
|
||||
|
|
Reference in New Issue