Skip to main content

NativeWin

Assembly: ServiceStack.Desktop.dll
View Source
Declaration
public static class NativeWin : object

Properties

ScreenX

View Source
Declaration
public static int ScreenX { get; }

ScreenY

View Source
Declaration
public static int ScreenY { get; }

Fields

MAX_PATH

View Source
Declaration
public const int MAX_PATH = null

MAX_UNICODESTRING_LEN

View Source
Declaration
public const int MAX_UNICODESTRING_LEN = null

SB_HORZ

View Source
Declaration
public const int SB_HORZ = null

SB_VERT

View Source
Declaration
public const int SB_VERT = null

SB_CTL

View Source
Declaration
public const int SB_CTL = null

SB_BOTH

View Source
Declaration
public const int SB_BOTH = null

LWA_ALPHA

View Source
Declaration
public const int LWA_ALPHA = null

LWA_COLORKEY

View Source
Declaration
public const int LWA_COLORKEY = null

cfUnicodeText

View Source
Declaration
public const uint cfUnicodeText = null

LibUser

View Source
Declaration
public const string LibUser = null

LibCommonDlg

View Source
Declaration
public const string LibCommonDlg = null

LibKernel

View Source
Declaration
public const string LibKernel = null

LibShell

View Source
Declaration
public const string LibShell = null

Methods

GetDesktopInfo()

View Source
Declaration
public static Dictionary<string, string> GetDesktopInfo()
Returns

Dictionary<System.String,System.String>

SetDesktopInfo(Dictionary<String, String>)

View Source
Declaration
public static void SetDesktopInfo(Dictionary<string, string> info)
Parameters
TypeName
Dictionary<System.String,System.String>info

ToObject(Drawing.Size)

View Source
Declaration
public static Dictionary<string, object> ToObject(Drawing.Size size)
Returns

Dictionary<System.String,System.Object>

Parameters
TypeName
System.Drawing.Sizesize

ToObject(Drawing.Rectangle)

View Source
Declaration
public static Dictionary<string, object> ToObject(Drawing.Rectangle rect)
Returns

Dictionary<System.String,System.Object>

Parameters
TypeName
System.Drawing.Rectanglerect

ToObject(RECT)

View Source
Declaration
public static Dictionary<string, object> ToObject(RECT rect)
Returns

Dictionary<System.String,System.Object>

Parameters
TypeName
RECTrect

ToObject(MonitorInfo)

View Source
Declaration
public static Dictionary<string, object> ToObject(MonitorInfo mi)
Returns

Dictionary<System.String,System.Object>

Parameters
TypeName
ServiceStack.Desktop.MonitorInfomi

Open(String)

View Source
Declaration
public static bool Open(string cmd)
Returns

System.Boolean

Parameters
TypeName
System.Stringcmd

Start(String)

View Source
Declaration
public static Process Start(string url)
Returns

Process

Parameters
TypeName
System.Stringurl

ExpandEnvVars(String)

View Source
Declaration
public static string ExpandEnvVars(string path)
Returns

System.String

Parameters
TypeName
System.Stringpath

OpenFile(IntPtr, Dictionary<String, Object>)

View Source
Declaration
public static DialogResult OpenFile(this IntPtr hWnd, Dictionary<string, object> options)
Returns

ServiceStack.Desktop.DialogResult

Parameters
TypeName
IntPtrhWnd
Dictionary<System.String,System.Object>options

OpenFolder(IntPtr, Dictionary<String, Object>)

View Source
Declaration
public static DialogResult OpenFolder(this IntPtr hWnd, Dictionary<string, object> options)
Returns

ServiceStack.Desktop.DialogResult

Parameters
TypeName
IntPtrhWnd
Dictionary<System.String,System.Object>options

CenterToScreen(IntPtr, Boolean)

View Source
Declaration
public static void CenterToScreen(this IntPtr hWnd, bool useWorkArea = true)
Parameters
TypeName
IntPtrhWnd
System.BooleanuseWorkArea

SetSize(IntPtr, Int32, Int32)

View Source
Declaration
public static bool SetSize(this IntPtr hWnd, int width, int height)
Returns

System.Boolean

Parameters
TypeName
IntPtrhWnd
System.Int32width
System.Int32height

SetPosition(IntPtr, Int32, Int32)

View Source
Declaration
public static bool SetPosition(this IntPtr hWnd, int x, int y)
Returns

System.Boolean

Parameters
TypeName
IntPtrhWnd
System.Int32x
System.Int32y

SetPosition(IntPtr, Int32, Int32, Int32, Int32)

View Source
Declaration
public static bool SetPosition(this IntPtr hWnd, int x, int y, int width, int height)
Returns

System.Boolean

Parameters
TypeName
IntPtrhWnd
System.Int32x
System.Int32y
System.Int32width
System.Int32height

SetPosition(IntPtr, Int32, Int32, Int32, Int32, User32.SetWindowPosFlags)

View Source
Declaration
public static bool SetPosition(this IntPtr hWnd, int x, int y, int width, int height, User32.SetWindowPosFlags flags)
Returns

System.Boolean

Parameters
TypeName
IntPtrhWnd
System.Int32x
System.Int32y
System.Int32width
System.Int32height
User32.SetWindowPosFlagsflags

SetPosition(IntPtr, ref RECT)

View Source
Declaration
public static bool SetPosition(this IntPtr hWnd, ref RECT rect)
Returns

System.Boolean

Parameters
TypeName
IntPtrhWnd
RECTrect

SetPosition(IntPtr, RECT)

View Source
Declaration
public static bool SetPosition(this IntPtr hWnd, RECT rect)
Returns

System.Boolean

Parameters
TypeName
IntPtrhWnd
RECTrect

SetPosition(IntPtr, RECT, User32.SetWindowPosFlags)

View Source
Declaration
public static bool SetPosition(this IntPtr hWnd, RECT rect, User32.SetWindowPosFlags flags)
Returns

System.Boolean

Parameters
TypeName
IntPtrhWnd
RECTrect
User32.SetWindowPosFlagsflags

SetPosition(IntPtr, ref RECT, User32.SetWindowPosFlags)

View Source
Declaration
public static bool SetPosition(this IntPtr hWnd, ref RECT rect, User32.SetWindowPosFlags flags)
Returns

System.Boolean

Parameters
TypeName
IntPtrhWnd
RECTrect
User32.SetWindowPosFlagsflags

RedrawFrame(IntPtr)

View Source
Declaration
public static void RedrawFrame(this IntPtr hWnd)
Parameters
TypeName
IntPtrhWnd

GetScalingFactor(User32.SafeDCHandle)

View Source
Declaration
public static float GetScalingFactor(this User32.SafeDCHandle hdc)
Returns

System.Single

Parameters
TypeName
User32.SafeDCHandlehdc

GetScreenResolution()

View Source
Declaration
public static Drawing.Size GetScreenResolution()
Returns

System.Drawing.Size

SetKioskMode(IntPtr)

View Source
Declaration
public static MonitorInfo? SetKioskMode(this IntPtr hWnd)
Returns

System.Nullable<ServiceStack.Desktop.MonitorInfo>

Parameters
TypeName
IntPtrhWnd

SetWindowFullScreen(IntPtr)

View Source
Declaration
public static void SetWindowFullScreen(this IntPtr hWnd)
Parameters
TypeName
IntPtrhWnd

ResizeWindow(IntPtr, Int32, Int32)

View Source
Declaration
public static void ResizeWindow(this IntPtr hWnd, int width, int height)
Parameters
TypeName
IntPtrhWnd
System.Int32width
System.Int32height

GetClientRect(IntPtr)

View Source
Declaration
public static RECT GetClientRect(this IntPtr hWnd)
Returns

RECT

Parameters
TypeName
IntPtrhWnd

GetClientSize(IntPtr)

View Source
Declaration
public static Drawing.Size GetClientSize(this IntPtr hWnd)
Returns

System.Drawing.Size

Parameters
TypeName
IntPtrhWnd

GetWindowSize(IntPtr)

View Source
Declaration
public static Drawing.Size GetWindowSize(this IntPtr hWnd)
Returns

System.Drawing.Size

Parameters
TypeName
IntPtrhWnd

GetPrimaryMonitorInfo(IntPtr, out MonitorInfo)

View Source
Declaration
public static bool GetPrimaryMonitorInfo(this IntPtr hWnd, out MonitorInfo monitorInfo)
Returns

System.Boolean

Parameters
TypeName
IntPtrhWnd
ServiceStack.Desktop.MonitorInfomonitorInfo

GetNearestMonitorInfo(IntPtr, out MonitorInfo)

View Source
Declaration
public static bool GetNearestMonitorInfo(this IntPtr hWnd, out MonitorInfo monitorInfo)
Returns

System.Boolean

Parameters
TypeName
IntPtrhWnd
ServiceStack.Desktop.MonitorInfomonitorInfo

ShowScrollBar(IntPtr, Boolean)

View Source
Declaration
public static void ShowScrollBar(this IntPtr hWnd, bool show)
Parameters
TypeName
IntPtrhWnd
System.Booleanshow

SetText(IntPtr, String)

View Source
Declaration
public static bool SetText(this IntPtr hWnd, string text)
Returns

System.Boolean

Parameters
TypeName
IntPtrhWnd
System.Stringtext

GetText(IntPtr)

View Source
Declaration
public static string GetText(this IntPtr hWnd)
Returns

System.String

Parameters
TypeName
IntPtrhWnd

TryOpenClipboard()

View Source
Declaration
public static void TryOpenClipboard()

GetClipboardAsString()

View Source
Declaration
public static string GetClipboardAsString()
Returns

System.String

SetStringInClipboard(String)

View Source
Declaration
public static bool SetStringInClipboard(string text)
Returns

System.Boolean

Parameters
TypeName
System.Stringtext

ApplyTransparency(IntPtr, Byte)

View Source
Declaration
public static void ApplyTransparency(IntPtr hWnd, byte transparency)
Parameters
TypeName
IntPtrhWnd
System.Bytetransparency

MessageBox(Int32, String, String, UInt32)

Declaration
public static extern int MessageBox(int hWnd, string text, string caption, uint type)
Returns

System.Int32

Parameters
TypeName
System.Int32hWnd
System.Stringtext
System.Stringcaption
System.UInt32type

GetWindowText(IntPtr, StringBuilder, Int32)

Declaration
public static extern int GetWindowText(IntPtr hWnd, StringBuilder lpString, int nMaxCount)
Returns

System.Int32

Parameters
TypeName
IntPtrhWnd
StringBuilderlpString
System.Int32nMaxCount

IsWindowEnabled(IntPtr)

Declaration
public static extern bool IsWindowEnabled(this IntPtr hWnd)
Returns

System.Boolean

Parameters
TypeName
IntPtrhWnd

GetOpenFileName(OpenFileName)

Declaration
public static extern bool GetOpenFileName(OpenFileName ofn)
Returns

System.Boolean

Parameters
TypeName
ServiceStack.Desktop.OpenFileNameofn

IsClipboardFormatAvailable(UInt32)

Declaration
public static extern bool IsClipboardFormatAvailable(uint format)
Returns

System.Boolean

Parameters
TypeName
System.UInt32format

SetFocus(IntPtr)

Declaration
public static extern IntPtr SetFocus(this IntPtr hWnd)
Returns

IntPtr

Parameters
TypeName
IntPtrhWnd

GetClipboardData(UInt32)

Declaration
public static extern IntPtr GetClipboardData(uint uFormat)
Returns

IntPtr

Parameters
TypeName
System.UInt32uFormat

SetClipboardData(UInt32, IntPtr)

Declaration
public static extern IntPtr SetClipboardData(uint uFormat, IntPtr data)
Returns

IntPtr

Parameters
TypeName
System.UInt32uFormat
IntPtrdata

GlobalSize(IntPtr)

Declaration
public static extern int GlobalSize(IntPtr hMem)
Returns

System.Int32

Parameters
TypeName
IntPtrhMem

MonitorFromWindow(IntPtr, User32.MonitorOptions)

Declaration
public static extern IntPtr MonitorFromWindow(this IntPtr hWnd, User32.MonitorOptions dwFlags)
Returns

IntPtr

Parameters
TypeName
IntPtrhWnd
User32.MonitorOptionsdwFlags

GetMonitorInfo(IntPtr, ref MonitorInfo)

Declaration
public static extern bool GetMonitorInfo(IntPtr hMonitor, ref MonitorInfo mi)
Returns

System.Boolean

Parameters
TypeName
IntPtrhMonitor
ServiceStack.Desktop.MonitorInfomi

GetWindowLongPtr(IntPtr, Int32)

View Source
Declaration
public static IntPtr GetWindowLongPtr(IntPtr hWnd, int nIndex)
Returns

IntPtr

Parameters
TypeName
IntPtrhWnd
System.Int32nIndex

GetWindowLongPtr32(IntPtr, Int32)

Declaration
public static extern IntPtr GetWindowLongPtr32(IntPtr hWnd, int nIndex)
Returns

IntPtr

Parameters
TypeName
IntPtrhWnd
System.Int32nIndex

GetWindowLongPtr64(IntPtr, Int32)

Declaration
public static extern IntPtr GetWindowLongPtr64(IntPtr hWnd, int nIndex)
Returns

IntPtr

Parameters
TypeName
IntPtrhWnd
System.Int32nIndex

SetWindowLongPtr(IntPtr, Int32, IntPtr)

View Source
Declaration
public static IntPtr SetWindowLongPtr(IntPtr hWnd, int nIndex, IntPtr dwNewLong)
Returns

IntPtr

Parameters
TypeName
IntPtrhWnd
System.Int32nIndex
IntPtrdwNewLong

SetWindowLong32(IntPtr, Int32, Int32)

Declaration
public static extern int SetWindowLong32(IntPtr hWnd, int nIndex, int dwNewLong)
Returns

System.Int32

Parameters
TypeName
IntPtrhWnd
System.Int32nIndex
System.Int32dwNewLong

SetWindowLongPtr64(IntPtr, Int32, IntPtr)

Declaration
public static extern IntPtr SetWindowLongPtr64(IntPtr hWnd, int nIndex, IntPtr dwNewLong)
Returns

IntPtr

Parameters
TypeName
IntPtrhWnd
System.Int32nIndex
IntPtrdwNewLong

GetWindowLongA(IntPtr, Int32)

Declaration
public static extern int GetWindowLongA(IntPtr hWnd, int nIndex)
Returns

System.Int32

Parameters
TypeName
IntPtrhWnd
System.Int32nIndex

SetWindowLongA(IntPtr, Int32, Int32)

Declaration
public static extern int SetWindowLongA(IntPtr hWnd, int nIndex, int dwNewLong)
Returns

System.Int32

Parameters
TypeName
IntPtrhWnd
System.Int32nIndex
System.Int32dwNewLong

SetLayeredWindowAttributes(IntPtr, UInt32, Byte, UInt32)

Declaration
public static extern bool SetLayeredWindowAttributes(IntPtr hWnd, uint crKey, byte bAlpha, uint dwFlags)
Returns

System.Boolean

Parameters
TypeName
IntPtrhWnd
System.UInt32crKey
System.BytebAlpha
System.UInt32dwFlags

MoveWindow(IntPtr, Int32, Int32, Int32, Int32, Boolean)

Declaration
public static extern bool MoveWindow(this IntPtr hWnd, int X, int Y, int nWidth, int nHeight, bool bRepaint)
Returns

System.Boolean

Parameters
TypeName
IntPtrhWnd
System.Int32X
System.Int32Y
System.Int32nWidth
System.Int32nHeight
System.BooleanbRepaint

GetClientRect(IntPtr, out RECT)

Declaration
public static extern bool GetClientRect(this IntPtr hWnd, out RECT lpRect)
Returns

System.Boolean

Parameters
TypeName
IntPtrhWnd
RECTlpRect

ShowScrollBar(IntPtr, Int32, Boolean)

Declaration
public static extern bool ShowScrollBar(this IntPtr hWnd, int wBar, bool bShow)
Returns

System.Boolean

Parameters
TypeName
IntPtrhWnd
System.Int32wBar
System.BooleanbShow

SendMessage(IntPtr, Int32, Int32, String)

Declaration
public static extern IntPtr SendMessage(IntPtr hWnd, int msg, int wParam, string lParam)
Returns

IntPtr

Parameters
TypeName
IntPtrhWnd
System.Int32msg
System.Int32wParam
System.StringlParam

SendMessage(IntPtr, Int32, Int32, Int32)

Declaration
public static extern IntPtr SendMessage(IntPtr hWnd, int msg, int wParam, int lParam)
Returns

IntPtr

Parameters
TypeName
IntPtrhWnd
System.Int32msg
System.Int32wParam
System.Int32lParam

SHBrowseForFolder(BROWSEINFO)

Declaration
public static extern IntPtr SHBrowseForFolder(BROWSEINFO lpbi)
Returns

IntPtr

Parameters
TypeName
ServiceStack.Desktop.BROWSEINFOlpbi

SHGetPathFromIDListLongPath(IntPtr, ref IntPtr)

View Source
Declaration
public static bool SHGetPathFromIDListLongPath(IntPtr pidl, ref IntPtr pszPath)
Returns

System.Boolean

Parameters
TypeName
IntPtrpidl
IntPtrpszPath