NativeWin
Assembly: ServiceStack.Desktop.dll
View Source
public static class NativeWin : object
Properties
ScreenX
View Source
public static int ScreenX { get; }
ScreenY
View Source
public static int ScreenY { get; }
Fields
MAX_PATH
View Source
public const int MAX_PATH = null
MAX_UNICODESTRING_LEN
View Source
public const int MAX_UNICODESTRING_LEN = null
SB_HORZ
View Source
public const int SB_HORZ = null
SB_VERT
View Source
public const int SB_VERT = null
SB_CTL
View Source
public const int SB_CTL = null
SB_BOTH
View Source
public const int SB_BOTH = null
LWA_ALPHA
View Source
public const int LWA_ALPHA = null
LWA_COLORKEY
View Source
public const int LWA_COLORKEY = null
cfUnicodeText
View Source
public const uint cfUnicodeText = null
LibUser
View Source
public const string LibUser = null
LibCommonDlg
View Source
public const string LibCommonDlg = null
LibKernel
View Source
public const string LibKernel = null
LibShell
View Source
public const string LibShell = null
Methods
GetDesktopInfo()
View Source
public static Dictionary<string, string> GetDesktopInfo()
Returns
Dictionary<System.String,System.String>
SetDesktopInfo(Dictionary<String, String>)
View Source
public static void SetDesktopInfo(Dictionary<string, string> info)
Parameters
Type | Name |
---|---|
Dictionary<System.String,System.String> | info |
ToObject(Drawing.Size)
View Source
public static Dictionary<string, object> ToObject(Drawing.Size size)
Returns
Dictionary<System.String,System.Object>
Parameters
Type | Name |
---|---|
System.Drawing.Size | size |
ToObject(Drawing.Rectangle)
View Source
public static Dictionary<string, object> ToObject(Drawing.Rectangle rect)
Returns
Dictionary<System.String,System.Object>
Parameters
Type | Name |
---|---|
System.Drawing.Rectangle | rect |
ToObject(RECT)
View Source
public static Dictionary<string, object> ToObject(RECT rect)
Returns
Dictionary<System.String,System.Object>
Parameters
Type | Name |
---|---|
RECT | rect |
ToObject(MonitorInfo)
View Source
public static Dictionary<string, object> ToObject(MonitorInfo mi)
Returns
Dictionary<System.String,System.Object>
Parameters
Type | Name |
---|---|
ServiceStack.Desktop.MonitorInfo | mi |
Open(String)
View Source
public static bool Open(string cmd)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.String | cmd |
Start(String)
View Source
public static Process Start(string url)
Returns
Process
Parameters
Type | Name |
---|---|
System.String | url |
ExpandEnvVars(String)
View Source
public static string ExpandEnvVars(string path)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | path |
OpenFile(IntPtr, Dictionary<String, Object>)
View Source
public static DialogResult OpenFile(this IntPtr hWnd, Dictionary<string, object> options)
Returns
ServiceStack.Desktop.DialogResult
Parameters
Type | Name |
---|---|
IntPtr | hWnd |
Dictionary<System.String,System.Object> | options |
OpenFolder(IntPtr, Dictionary<String, Object>)
View Source
public static DialogResult OpenFolder(this IntPtr hWnd, Dictionary<string, object> options)
Returns
ServiceStack.Desktop.DialogResult
Parameters
Type | Name |
---|---|
IntPtr | hWnd |
Dictionary<System.String,System.Object> | options |
CenterToScreen(IntPtr, Boolean)
View Source
public static void CenterToScreen(this IntPtr hWnd, bool useWorkArea = true)
Parameters
Type | Name |
---|---|
IntPtr | hWnd |
System.Boolean | useWorkArea |
SetSize(IntPtr, Int32, Int32)
View Source
public static bool SetSize(this IntPtr hWnd, int width, int height)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
IntPtr | hWnd |
System.Int32 | width |
System.Int32 | height |
SetPosition(IntPtr, Int32, Int32)
View Source
public static bool SetPosition(this IntPtr hWnd, int x, int y)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
IntPtr | hWnd |
System.Int32 | x |
System.Int32 | y |
SetPosition(IntPtr, Int32, Int32, Int32, Int32)
View Source
public static bool SetPosition(this IntPtr hWnd, int x, int y, int width, int height)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
IntPtr | hWnd |
System.Int32 | x |
System.Int32 | y |
System.Int32 | width |
System.Int32 | height |
SetPosition(IntPtr, Int32, Int32, Int32, Int32, User32.SetWindowPosFlags)
View Source
public static bool SetPosition(this IntPtr hWnd, int x, int y, int width, int height, User32.SetWindowPosFlags flags)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
IntPtr | hWnd |
System.Int32 | x |
System.Int32 | y |
System.Int32 | width |
System.Int32 | height |
User32.SetWindowPosFlags | flags |
SetPosition(IntPtr, ref RECT)
View Source
public static bool SetPosition(this IntPtr hWnd, ref RECT rect)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
IntPtr | hWnd |
RECT | rect |
SetPosition(IntPtr, RECT)
View Source
public static bool SetPosition(this IntPtr hWnd, RECT rect)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
IntPtr | hWnd |
RECT | rect |
SetPosition(IntPtr, RECT, User32.SetWindowPosFlags)
View Source
public static bool SetPosition(this IntPtr hWnd, RECT rect, User32.SetWindowPosFlags flags)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
IntPtr | hWnd |
RECT | rect |
User32.SetWindowPosFlags | flags |
SetPosition(IntPtr, ref RECT, User32.SetWindowPosFlags)
View Source
public static bool SetPosition(this IntPtr hWnd, ref RECT rect, User32.SetWindowPosFlags flags)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
IntPtr | hWnd |
RECT | rect |
User32.SetWindowPosFlags | flags |
RedrawFrame(IntPtr)
View Source
public static void RedrawFrame(this IntPtr hWnd)
Parameters
Type | Name |
---|---|
IntPtr | hWnd |
GetScalingFactor(User32.SafeDCHandle)
View Source
public static float GetScalingFactor(this User32.SafeDCHandle hdc)
Returns
System.Single
Parameters
Type | Name |
---|---|
User32.SafeDCHandle | hdc |
GetScreenResolution()
View Source
public static Drawing.Size GetScreenResolution()
Returns
System.Drawing.Size
SetKioskMode(IntPtr)
View Source
public static MonitorInfo? SetKioskMode(this IntPtr hWnd)
Returns
System.Nullable<ServiceStack.Desktop.MonitorInfo>
Parameters
Type | Name |
---|---|
IntPtr | hWnd |
SetWindowFullScreen(IntPtr)
View Source
public static void SetWindowFullScreen(this IntPtr hWnd)
Parameters
Type | Name |
---|---|
IntPtr | hWnd |
ResizeWindow(IntPtr, Int32, Int32)
View Source
public static void ResizeWindow(this IntPtr hWnd, int width, int height)
Parameters
Type | Name |
---|---|
IntPtr | hWnd |
System.Int32 | width |
System.Int32 | height |
GetClientRect(IntPtr)
View Source
public static RECT GetClientRect(this IntPtr hWnd)
Returns
RECT
Parameters
Type | Name |
---|---|
IntPtr | hWnd |
GetClientSize(IntPtr)
View Source
public static Drawing.Size GetClientSize(this IntPtr hWnd)
Returns
System.Drawing.Size
Parameters
Type | Name |
---|---|
IntPtr | hWnd |
GetWindowSize(IntPtr)
View Source
public static Drawing.Size GetWindowSize(this IntPtr hWnd)
Returns
System.Drawing.Size
Parameters
Type | Name |
---|---|
IntPtr | hWnd |
GetPrimaryMonitorInfo(IntPtr, out MonitorInfo)
View Source
public static bool GetPrimaryMonitorInfo(this IntPtr hWnd, out MonitorInfo monitorInfo)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
IntPtr | hWnd |
ServiceStack.Desktop.MonitorInfo | monitorInfo |
GetNearestMonitorInfo(IntPtr, out MonitorInfo)
View Source
public static bool GetNearestMonitorInfo(this IntPtr hWnd, out MonitorInfo monitorInfo)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
IntPtr | hWnd |
ServiceStack.Desktop.MonitorInfo | monitorInfo |
ShowScrollBar(IntPtr, Boolean)
View Source
public static void ShowScrollBar(this IntPtr hWnd, bool show)
Parameters
Type | Name |
---|---|
IntPtr | hWnd |
System.Boolean | show |
SetText(IntPtr, String)
View Source
public static bool SetText(this IntPtr hWnd, string text)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
IntPtr | hWnd |
System.String | text |
GetText(IntPtr)
View Source
public static string GetText(this IntPtr hWnd)
Returns
System.String
Parameters
Type | Name |
---|---|
IntPtr | hWnd |
TryOpenClipboard()
View Source
public static void TryOpenClipboard()
GetClipboardAsString()
View Source
public static string GetClipboardAsString()
Returns
System.String
SetStringInClipboard(String)
View Source
public static bool SetStringInClipboard(string text)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.String | text |
ApplyTransparency(IntPtr, Byte)
View Source
public static void ApplyTransparency(IntPtr hWnd, byte transparency)
Parameters
Type | Name |
---|---|
IntPtr | hWnd |
System.Byte | transparency |
MessageBox(Int32, String, String, UInt32)
public static extern int MessageBox(int hWnd, string text, string caption, uint type)
Returns
System.Int32
Parameters
Type | Name |
---|---|
System.Int32 | hWnd |
System.String | text |
System.String | caption |
System.UInt32 | type |
GetWindowText(IntPtr, StringBuilder, Int32)
public static extern int GetWindowText(IntPtr hWnd, StringBuilder lpString, int nMaxCount)
Returns
System.Int32
Parameters
Type | Name |
---|---|
IntPtr | hWnd |
StringBuilder | lpString |
System.Int32 | nMaxCount |
IsWindowEnabled(IntPtr)
public static extern bool IsWindowEnabled(this IntPtr hWnd)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
IntPtr | hWnd |
GetOpenFileName(OpenFileName)
public static extern bool GetOpenFileName(OpenFileName ofn)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
ServiceStack.Desktop.OpenFileName | ofn |
IsClipboardFormatAvailable(UInt32)
public static extern bool IsClipboardFormatAvailable(uint format)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.UInt32 | format |
SetFocus(IntPtr)
public static extern IntPtr SetFocus(this IntPtr hWnd)
Returns
IntPtr
Parameters
Type | Name |
---|---|
IntPtr | hWnd |
GetClipboardData(UInt32)
public static extern IntPtr GetClipboardData(uint uFormat)
Returns
IntPtr
Parameters
Type | Name |
---|---|
System.UInt32 | uFormat |
SetClipboardData(UInt32, IntPtr)
public static extern IntPtr SetClipboardData(uint uFormat, IntPtr data)
Returns
IntPtr
Parameters
Type | Name |
---|---|
System.UInt32 | uFormat |
IntPtr | data |
GlobalSize(IntPtr)
public static extern int GlobalSize(IntPtr hMem)
Returns
System.Int32
Parameters
Type | Name |
---|---|
IntPtr | hMem |
MonitorFromWindow(IntPtr, User32.MonitorOptions)
public static extern IntPtr MonitorFromWindow(this IntPtr hWnd, User32.MonitorOptions dwFlags)
Returns
IntPtr
Parameters
Type | Name |
---|---|
IntPtr | hWnd |
User32.MonitorOptions | dwFlags |
GetMonitorInfo(IntPtr, ref MonitorInfo)
public static extern bool GetMonitorInfo(IntPtr hMonitor, ref MonitorInfo mi)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
IntPtr | hMonitor |
ServiceStack.Desktop.MonitorInfo | mi |
GetWindowLongPtr(IntPtr, Int32)
View Source
public static IntPtr GetWindowLongPtr(IntPtr hWnd, int nIndex)
Returns
IntPtr
Parameters
Type | Name |
---|---|
IntPtr | hWnd |
System.Int32 | nIndex |
GetWindowLongPtr32(IntPtr, Int32)
public static extern IntPtr GetWindowLongPtr32(IntPtr hWnd, int nIndex)
Returns
IntPtr
Parameters
Type | Name |
---|---|
IntPtr | hWnd |
System.Int32 | nIndex |
GetWindowLongPtr64(IntPtr, Int32)
public static extern IntPtr GetWindowLongPtr64(IntPtr hWnd, int nIndex)
Returns
IntPtr
Parameters
Type | Name |
---|---|
IntPtr | hWnd |
System.Int32 | nIndex |
SetWindowLongPtr(IntPtr, Int32, IntPtr)
View Source
public static IntPtr SetWindowLongPtr(IntPtr hWnd, int nIndex, IntPtr dwNewLong)
Returns
IntPtr
Parameters
Type | Name |
---|---|
IntPtr | hWnd |
System.Int32 | nIndex |
IntPtr | dwNewLong |
SetWindowLong32(IntPtr, Int32, Int32)
public static extern int SetWindowLong32(IntPtr hWnd, int nIndex, int dwNewLong)
Returns
System.Int32
Parameters
Type | Name |
---|---|
IntPtr | hWnd |
System.Int32 | nIndex |
System.Int32 | dwNewLong |
SetWindowLongPtr64(IntPtr, Int32, IntPtr)
public static extern IntPtr SetWindowLongPtr64(IntPtr hWnd, int nIndex, IntPtr dwNewLong)
Returns
IntPtr
Parameters
Type | Name |
---|---|
IntPtr | hWnd |
System.Int32 | nIndex |
IntPtr | dwNewLong |
GetWindowLongA(IntPtr, Int32)
public static extern int GetWindowLongA(IntPtr hWnd, int nIndex)
Returns
System.Int32
Parameters
Type | Name |
---|---|
IntPtr | hWnd |
System.Int32 | nIndex |
SetWindowLongA(IntPtr, Int32, Int32)
public static extern int SetWindowLongA(IntPtr hWnd, int nIndex, int dwNewLong)
Returns
System.Int32
Parameters
Type | Name |
---|---|
IntPtr | hWnd |
System.Int32 | nIndex |
System.Int32 | dwNewLong |
SetLayeredWindowAttributes(IntPtr, UInt32, Byte, UInt32)
public static extern bool SetLayeredWindowAttributes(IntPtr hWnd, uint crKey, byte bAlpha, uint dwFlags)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
IntPtr | hWnd |
System.UInt32 | crKey |
System.Byte | bAlpha |
System.UInt32 | dwFlags |
MoveWindow(IntPtr, Int32, Int32, Int32, Int32, Boolean)
public static extern bool MoveWindow(this IntPtr hWnd, int X, int Y, int nWidth, int nHeight, bool bRepaint)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
IntPtr | hWnd |
System.Int32 | X |
System.Int32 | Y |
System.Int32 | nWidth |
System.Int32 | nHeight |
System.Boolean | bRepaint |
GetClientRect(IntPtr, out RECT)
public static extern bool GetClientRect(this IntPtr hWnd, out RECT lpRect)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
IntPtr | hWnd |
RECT | lpRect |
ShowScrollBar(IntPtr, Int32, Boolean)
public static extern bool ShowScrollBar(this IntPtr hWnd, int wBar, bool bShow)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
IntPtr | hWnd |
System.Int32 | wBar |
System.Boolean | bShow |
SendMessage(IntPtr, Int32, Int32, String)
public static extern IntPtr SendMessage(IntPtr hWnd, int msg, int wParam, string lParam)
Returns
IntPtr
Parameters
Type | Name |
---|---|
IntPtr | hWnd |
System.Int32 | msg |
System.Int32 | wParam |
System.String | lParam |
SendMessage(IntPtr, Int32, Int32, Int32)
public static extern IntPtr SendMessage(IntPtr hWnd, int msg, int wParam, int lParam)
Returns
IntPtr
Parameters
Type | Name |
---|---|
IntPtr | hWnd |
System.Int32 | msg |
System.Int32 | wParam |
System.Int32 | lParam |
SHBrowseForFolder(BROWSEINFO)
public static extern IntPtr SHBrowseForFolder(BROWSEINFO lpbi)
Returns
IntPtr
Parameters
Type | Name |
---|---|
ServiceStack.Desktop.BROWSEINFO | lpbi |
SHGetPathFromIDListLongPath(IntPtr, ref IntPtr)
View Source
public static bool SHGetPathFromIDListLongPath(IntPtr pidl, ref IntPtr pszPath)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
IntPtr | pidl |
IntPtr | pszPath |