C# Class OnlineVideos.Helpers.ProcessHelper

Set window states of processes using win32
Datei anzeigen Open project: offbyoneBB/mp-onlinevideos2

Public Methods

Method Description
GetLparamToAppCommand ( IntPtr lParam ) : int

Taken from MediaPortal Core to help translate a wndproc message to AppCommand The value returned here will be a MediaPortal.AppCommands value (MediaPortal-1/mediaportal/RemotePlugins/AppCommands.cs)

HIWORD ( int val ) : int

Taken from MediaPortal Core to help translate a wndproc message to AppCommand

PreventMonitorPowerdown ( ) : void

Prevent screen savers from activating

ReadStringFromMessage ( Message message ) : string

Get the string from the WndProc message

RestoreWindow ( IntPtr mainWindowHandle ) : void

Restore a window and make it top most - can't do this by process name if the window is hidden

SendKeyToProcess ( IntPtr mainWindowHandle, System key ) : void

Send the specified key to the process

SendKeyToProcess ( string mainWindowTitle, System key ) : void

Send the specified key to the process

SendStringToApplication ( int windowHandle, string stringToSend ) : void

Send a string to the specified window

SetForeground ( IntPtr mainWindowHandle ) : void

Set the window to foreground - can't do this by process name if the window is hidden

SetForeground ( string mainWindowTitle ) : void

Set the window to foreground - by name

SetWindowState ( string processName, WINDOW_STATE state ) : IntPtr

Set the window state of the named process

Private Methods

Method Description
FindWindowByCaption ( IntPtr ZeroOnly, string lpWindowName ) : IntPtr
PostMessage ( IntPtr hWnd, int Msg, System wParam, int lParam ) : bool
SendMessage ( int hWnd, int wMsg, IntPtr wParam, IntPtr lParam ) : bool
SetActiveWindow ( IntPtr hWnd ) : bool
SetForegroundWindow ( IntPtr hWnd ) : bool
SetThreadExecutionState ( EXECUTION_STATE flags ) : EXECUTION_STATE
SetWindowPos ( IntPtr hWnd, int hWndInsertAfter, int x, int y, int cx, int cy, UInt32 uFlags ) : int
SetWindowState ( IntPtr mainWindowHandle, WINDOW_STATE state ) : void

Set the window state by the window handle

ShowWindow ( IntPtr hWnd, WINDOW_STATE state ) : bool

Method Details

GetLparamToAppCommand() public static method

Taken from MediaPortal Core to help translate a wndproc message to AppCommand The value returned here will be a MediaPortal.AppCommands value (MediaPortal-1/mediaportal/RemotePlugins/AppCommands.cs)
public static GetLparamToAppCommand ( IntPtr lParam ) : int
lParam System.IntPtr
return int

HIWORD() public static method

Taken from MediaPortal Core to help translate a wndproc message to AppCommand
public static HIWORD ( int val ) : int
val int
return int

PreventMonitorPowerdown() public static method

Prevent screen savers from activating
public static PreventMonitorPowerdown ( ) : void
return void

ReadStringFromMessage() public static method

Get the string from the WndProc message
public static ReadStringFromMessage ( Message message ) : string
message System.Windows.Forms.Message
return string

RestoreWindow() public static method

Restore a window and make it top most - can't do this by process name if the window is hidden
public static RestoreWindow ( IntPtr mainWindowHandle ) : void
mainWindowHandle System.IntPtr
return void

SendKeyToProcess() public static method

Send the specified key to the process
public static SendKeyToProcess ( IntPtr mainWindowHandle, System key ) : void
mainWindowHandle System.IntPtr
key System
return void

SendKeyToProcess() public static method

Send the specified key to the process
public static SendKeyToProcess ( string mainWindowTitle, System key ) : void
mainWindowTitle string
key System
return void

SendStringToApplication() public static method

Send a string to the specified window
public static SendStringToApplication ( int windowHandle, string stringToSend ) : void
windowHandle int
stringToSend string
return void

SetForeground() public static method

Set the window to foreground - can't do this by process name if the window is hidden
public static SetForeground ( IntPtr mainWindowHandle ) : void
mainWindowHandle System.IntPtr
return void

SetForeground() public static method

Set the window to foreground - by name
public static SetForeground ( string mainWindowTitle ) : void
mainWindowTitle string
return void

SetWindowState() public static method

Set the window state of the named process
public static SetWindowState ( string processName, WINDOW_STATE state ) : IntPtr
processName string
state WINDOW_STATE
return System.IntPtr