Desktop Functions: Smart Device Functions:
|
Search Results for "HWND" in [All]winmm
static extern Int32 mciSendString(string command, StringBuilder buffer, int bufferSize, IntPtr hwndCallback);
Private Shared Function mciSendString(ByVal command As String, ByVal buffer As StringBuilder, ByVal bufferSize As Integer, ByVal hwndCallback As IntPtr) As Integer
Declare Ansi Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal command As String, ByRef buffer As StringBuilder, ByVal bufferSize As Integer, ByVal hWndCallback As IntPtr) As Integer
static extern Int32 mciSendString(string command, string buffer, int bufferSize, IntPtr hwndCallback);
private IntPtr hwndOwner;
// private UInt32 cMultipleItems; //Unioned with hwndOwner /* if _MULTIPLE, the number of items per channel */
get { return this.hwndOwner; }
set { this.hwndOwner = value; }
get { return (UInt32)this.hwndOwner; }
set { this.hwndOwner = (IntPtr)value; }
Dim hWndOwner As IntPtr msi
static extern int MsiSetInternalUI(int dwUILevel, ref IntPtr phWnd);
static extern int MsiSetInternalUI(INSTALLUILEVEL dwUILevel, ref IntPtr phWnd);
Private Function MsiSetInternalUI(dwUILevel As INSTALLUILEVEL, ByRef phWnd As IntPtr) As Integer
IntPtr hwnd = IntPtr.Zero;
MsiUtils.MsiSetInternalUI(MsiUtils.INSTALLUILEVEL.INSTALLUILEVEL_NONE , ref hwnd); user32
static extern bool AddClipboardFormatListener(IntPtr hwnd);
Public Function AddClipboardFormatListener(hWnd As IntPtr) As <MarshalAs(UnmanagedType.Bool)>Boolean
Declare Function AddClipboardFormatListener Lib "user32.dll" (hWnd As Long) As Boolean
static extern bool AnimateWindow(IntPtr hwnd, int time, AnimateWindowFlags flags);
Shared Function AnimateWindow(ByVal hwnd As IntPtr, ByVal time As Integer, ByVal flags As AnimateWindowFlags) As Boolean 7: AppendMenu
Private Shared Function GetSystemMenu(ByVal hWnd As IntPtr, ByVal bRevert As Boolean) As IntPtr
static extern uint ArrangeIconicWindows(IntPtr hWnd); 9: BeginPaint
static extern IntPtr BeginPaint(IntPtr hwnd, out PAINTSTRUCT lpPaint);
Public Shared Function BeginPaint(ByVal hwnd As IntPtr, <Out()> ByRef lpPaint As PAINTSTRUCT) As IntPtr 10: BringWindowToTop
static extern bool BringWindowToTop(IntPtr hWnd);
static extern bool BringWindowToTop(HandleRef hWnd);
Private Shared Function BringWindowToTop(ByVal hwnd As IntPtr) As Boolean
Public Declare Function BringWindowToTop Lib "user32" (ByVal HWnd As IntPtr) As Boolean 11: CallWindowProc
static extern IntPtr CallWindowProc(WndProcDelegate lpPrevWndFunc, IntPtr hWnd, uint Msg, IntPtr wParam, IntPtr lParam);
Private Shared Function CallWindowProc(lpPrevWndFunc As WndProcDelegate, hWnd As IntPtr, Msg As UInteger, wParam As IntPtr, lParam As IntPtr) As IntPtr 12: CascadeWindows
static extern ushort CascadeWindows(IntPtr hwndParent, uint wHow,
static extern bool ChangeClipboardChain(IntPtr hWndRemove, IntPtr hWndNewNext);
static extern DISP_CHANGE ChangeDisplaySettingsEx(string lpszDeviceName, ref DEVMODE lpDevMode, IntPtr hwnd, ChangeDisplaySettingsFlags dwflags, IntPtr lParam);
Private Shared Function ChangeDisplaySettingsEx(ByVal lpszDeviceName As String, ByRef lpDevMode As DEVMODE, ByVal hwnd As IntPtr, ByVal dwflags As UInteger, ByVal lParam As IntPtr) As DISP_CHANGE
public static extern bool ChangeWindowMessageFilterEx(IntPtr hWnd, uint msg, ChangeWindowMessageFilterExAction action,ref CHANGEFILTERSTRUCT changeInfo);
Private Shared Function ChangeWindowMessageFilterEx(hWnd As IntPtr, msg As UInteger, action As ChangeWindowMessageFilterExAction, ByRef changeInfo As CHANGEFILTERSTRUCT) As <MarshalAs(UnmanagedType.Bool)> Boolean
static extern IntPtr ChildWindowFromPointEx(IntPtr hWndParent, Point pt, uint uFlags);
Public Function ChildWindowFromPointEx(ByVal hWndParent As IntPtr, ByVal P As POINTAPI, ByVal uFlags As CWPFlags) As IntPtr
static extern IntPtr ChildWindowFromPointEx(IntPtr hWndParent, Point pt, uint uFlags);
Public Function ChildWindowFromPointEx(ByVal hWndParent As IntPtr, ByVal P As POINTAPI, ByVal uFlags As CWPFlags) As IntPtr 18: ClientToScreen
static extern bool ClientToScreen(IntPtr hWnd, ref Point lpPoint);
Private Shared Function ClientToScreen(ByVal hWnd As IntPtr, ByRef lpPoint As Point) As Boolean
static extern bool ClientToScreen(IntPtr hwnd, ref Point lpPoint); 19: CloseWindow
static extern int CloseWindow (IntPtr hWnd); 20: CreateCaret
static extern bool CreateCaret(IntPtr hWnd, IntPtr hBitmap, int nWidth,
Public Shared Function CreateCaret(ByVal hWnd As IntPtr, ByVal hBitmap As IntPtr, ByVal nWidth As Integer, ByVal nHeight As Integer) As Boolean
Public Shared Function CreateCaret(ByVal hWnd As IntPtr, ByVal hBitmap As IntPtr, ByVal nWidth As Integer, ByVal nHeight As Integer) As Boolean 21: CreateMDIWindow
IntPtr hwndParent, 22: CreateWindowEx
/// <param name="nHeight">Specifies the height, in device units, of the window. For overlapped windows, nHeight is the window's height, in screen coordinates. If the nWidth parameter is set to CW_USEDEFAULT, the system ignores nHeight.</param> <param name="hWndParent">Handle to the parent or owner window of the window being created. To create a child window or an owned window, supply a valid window handle. This parameter is optional for pop-up windows.
/// <para>Windows 2000/XP: To create a message-only window, supply HWND_MESSAGE or a handle to an existing message-only window.</para></param>
IntPtr hWndParent,
''' <param name="nHeight">Specifies the height, in device units, of the window. For overlapped windows, nHeight is the window's height, in screen coordinates. If the nWidth parameter is set to CW_USEDEFAULT, the system ignores nHeight.</param> <param name="hWndParent">Handle to the parent or owner window of the window being created. To create a child window or an owned window, supply a valid window handle. This parameter is optional for pop-up windows.
''' <para>Windows 2000/XP: To create a message-only window, supply HWND_MESSAGE or a handle to an existing message-only window.</para></param>
ByVal hWndParent As IntPtr, _
wndclass.lpfnWndProc = (WndProc)((hWnd, message, wParam, lParam ) => {
hdc = Win32.BeginPaint (hWnd, out ps) ;
Win32.GetClientRect (hWnd, out rect) ;
Win32.EndPaint(hWnd, ref ps);
return Win32.DefWindowProc(hWnd, (WM)message, wParam, lParam);
IntPtr hwnd = Win32.CreateWindowEx(
if( hwnd == IntPtr.Zero )
Win32.ShowWindow(hwnd, ShowWindowCommands.Normal );
Win32.UpdateWindow(hwnd);
///<Summary>Does not activate the window. If this flag is not set, the window is activated and moved to the top of either the topmost or non-topmost group (depending on the setting of the hWndInsertAfter parameter).</Summary>
///<Summary>Retains the current Z order (ignores the hWndInsertAfter parameter).</Summary>
'''<Summary>Does not activate the window. If this flag is not set, the window is activated and moved to the top of either the topmost or non-topmost group (depending on the setting of the hWndInsertAfter parameter).</Summary>
'''<Summary>Retains the current Z order (ignores the hWndInsertAfter parameter).</Summary> 24: DefWindowProc
static extern IntPtr DefWindowProc(IntPtr hWnd, WindowsMessages uMsg, IntPtr wParam, IntPtr lParam);
Public Shared Function DefWindowProc(ByVal hWnd As IntPtr, ByVal uMsg As WindowsMessages, ByVal wParam As IntPtr, ByVal lParam As IntPtr) As IntPtr
public static extern bool DeregisterShellHookWindow(IntPtr hWnd); 26: DestroyWindow
/// <param name="hwnd">Handle to the window to be destroyed.</param>
static extern bool DestroyWindow(IntPtr hwnd);
''' <param name="hwnd">Handle to the window to be destroyed.</param>
Private Shared Function DestroyWindow(hwnd As IntPtr) As <MarshalAs(UnmanagedType.Bool)> Boolean hWnd is the pointer to the window you want to close/destroy. Create a new IntPtr object with the window's handle as a parameter to it's constructor. Make sure the pointers are in decimal, not in hex as spy++ gives them to you.
static extern bool DestroyWindow(IntPtr hWnd); 27: DragDetect
static extern bool DragDetect(IntPtr hwnd, POINT pt);
public static bool DragDetect(IntPtr hWnd, Point pt) {
static extern bool DrawAnimatedRects(IntPtr hwnd, int idAni,
static extern bool DrawAnimatedRects(System.IntPtr hwnd, int idAni,
static extern System.IntPtr FindWindowEx(System.IntPtr hwndParent, System.IntPtr hwndChildAfter,
static extern bool GetWindowRect(System.IntPtr hWnd, out RECT lpRect);
System.IntPtr hWnd =
if (hWnd != System.IntPtr.Zero)
GetWindowRect(hWnd, out to);
bool DrawAnimatedRects(int hwnd, int idAni, RECT^ lprcFrom, RECT^ lprcTo);
int FindWindowEx(int hwndParent, int hwndChildAfter,
bool GetWindowRect(int hWnd, RECT^ lpRect);
int hWnd=FindWindowEx(FindWindow("Shell_TrayWnd", nullptr), 0, "TrayNotifyWnd", nullptr);
if (hWnd != 0) {
GetWindowRect(hWnd, to); 29: DrawMenuBar
static extern bool DrawMenuBar(IntPtr hWnd);
static extern IntPtr GetSystemMenu(IntPtr hWnd, bool bRevert);
static extern bool DrawMenuBar(IntPtr hWnd); 30: EnableMenuItem
Private Shared Function GetSystemMenu(ByVal hWnd As IntPtr, ByVal bRevert As Boolean) As IntPtr 31: EnableScrollBar
static extern bool EnableScrollBar(IntPtr hWnd, uint wSBflags, uint wArrows);
Private Shared Function EnableScrollBar(ByVal hWnd As IntPtr, <MarshalAs(UnmanagedType.U4)>wSBflags As SBFlags, <MarshalAs(UnmanagedType.U4)>wArrows As SBArrows) As <MarshalAs(UnmanagedType.Bool)>Boolean
(ByVal hWnd As Long, _
static extern bool EnableScrollBar(IntPtr hWnd, uint wSBflags, uint wArrows); 32: EnableWindow
static extern bool EnableWindow(IntPtr hWnd, bool bEnable);
Private Shared Function EnableWindow(ByVal hWnd As IntPtr, ByVal bEnable As Boolean) As Boolean
static extern bool EnableWindow(IntPtr hWnd, bool bEnable); 33: EndDialog
IntPtr hwnd = FindWindowByCaption((IntPtr)null, "Untitled - Notepad");
if (null != hwnd)
EndDialog(hwnd, result); 34: EndPaint
static extern bool EndPaint(IntPtr hWnd, [In] ref PAINTSTRUCT lpPaint);
Public Shared Function EndPaint(ByVal hwnd As IntPtr, <[In]()> ByRef lpPaint As PAINTSTRUCT) As IntPtr 35: EndTask
static extern bool EndTask(IntPtr hWnd, bool fShutDown, bool fForce);
Private Shared Function EndTask(hWnd As IntPtr, fShutDown As Boolean, fForce As Boolean) As Boolean
public static extern bool EndTask(IntPtr hWnd, bool fShutDown,bool fForce);
Public Shared Function EndTask(hWnd As IntPtr, fShutDown As Boolean, fForce As Boolean) As Boolean 36: EnumChildWindows
public delegate bool EnumWindowsProc(IntPtr hwnd, IntPtr lParam);
public static extern bool EnumChildWindows(IntPtr hwndParent, EnumWindowsProc lpEnumFunc, IntPtr lParam);
Private Shared Function EnumChildWindows(ByVal hWndParent As System.IntPtr, ByVal lpEnumFunc As EnumWindowsProc, ByVal lParam As Integer) As Boolean
/// <param name="hWnd">Window handle</param>
public delegate bool EnumWindowProc(IntPtr hWnd, IntPtr parameter);
static extern bool OpenClipboard(IntPtr hWndNewOwner);
private delegate bool EnumDesktopWindowsDelegate(IntPtr hWnd, int lParam);
/// <param name="hWnd"></param>
public delegate bool EnumDelegate(IntPtr hWnd, int lParam);
/// <param name="hWnd"></param>
public static extern bool IsWindowVisible(IntPtr hWnd);
/// <param name="hWnd"></param>
public static extern int GetWindowText(IntPtr hWnd, StringBuilder lpWindowText, int nMaxCount);
user32.EnumDelegate filter = delegate(IntPtr hWnd, int lParam)
int nLength = user32.GetWindowText(hWnd, strbTitle, strbTitle.Capacity + 1);
if (user32.IsWindowVisible(hWnd) && string.IsNullOrEmpty(strTitle) == false) 39: EnumProps
static extern int EnumPropsEx(IntPtr hWnd, EnumPropsExDelegate lpEnumFunc,
static extern int EnumPropsEx(IntPtr hWnd, EnumPropsExDelegate lpEnumFunc, IntPtr lParam);
private delegate int EnumPropsExDelegate(IntPtr hwnd, IntPtr lpszString, IntPtr hData, IntPtr dwData);
IntPtr hWnd = new IntPtr(XXXXXX); //Enter handle value here. use UI Spy/Inspect to get it
var i = EnumPropsEx(hWnd, enumPropsExDel, new IntPtr());
public static int PropEnumProcEx(IntPtr hwnd, IntPtr lpszString, IntPtr hData, IntPtr dwData) 40: EnumPropsEx
static extern int EnumPropsEx(IntPtr hWnd, EnumPropsExDelegate lpEnumFunc,
static extern int EnumPropsEx(IntPtr hWnd, EnumPropsExDelegate lpEnumFunc, IntPtr lParam);
private delegate int EnumPropsExDelegate(IntPtr hwnd, IntPtr lpszString, long hData, long dwData);
IntPtr hWnd = new IntPtr(XXXXXX); //Enter handle value here. use UI Spy/Inspect to get it
var i = EnumPropsEx(hWnd, enumPropsExDel, new IntPtr());
public static int PropEnumProcEx(IntPtr hwnd, IntPtr lpszString, long hData, long dwData) delegate bool EnumThreadDelegate(IntPtr Hwnd, IntPtr lParam); Delegate Function EnumThreadDelegate(Hwnd As IntPtr, lParam As IntPtr) As Boolean public delegate bool EnumThreadDelegate (IntPtr hwnd, IntPtr lParam);
public delegate bool EnumThreadDelegate (IntPtr hWnd, IntPtr lParam);
static extern bool PostMessage(IntPtr hWnd, uint Msg, IntPtr wParam, IntPtr lParam);
static bool EnumThreadCallback(IntPtr hWnd, IntPtr lParam)
PostMessage(hWnd, WM_CLOSE, IntPtr.Zero, IntPtr.Zero);
Delegate Function EnumThreadDelegate(hWnd As IntPtr, lParam As IntPtr) As Boolean
Shared Function PostMessage(hWnd As IntPtr, Msg As UInteger, wParam As IntPtr, lParam As IntPtr) As<MarshalAs(UnmanagedType.Bool)> Boolean
Shared Function EnumThreadCallback(hWnd As IntPtr, lParam As IntPtr) As Boolean
PostMessage(hWnd, WM_CLOSE, IntPtr.Zero, IntPtr.Zero) 43: FindWindow
static extern IntPtr FindWindowEx(IntPtr hwndParent, IntPtr hwndChildAfter, string lpszClass, string lpszWindow); 44: FindWindowEx
static extern IntPtr FindWindowEx(IntPtr hwndParent, IntPtr hwndChildAfter, string lpszClass, string lpszWindow); 45: FlashWindow
public IntPtr hwnd;
/// <param name="hWnd">The handle to the window to flash</param>
public static bool FlashWindowEx(IntPtr hWnd)
fInfo.hwnd = hWnd;
/// <param name="hWnd">The handle to the window to flash</param>
IntPtr hWnd = frm.Handle;
fInfo.hwnd = hWnd;
Public hwnd As Long
.hwnd = frm.Handle 46: FlashWindowEx
public IntPtr hwnd;
/// <param name="hWnd">The handle to the window to flash</param>
public static bool FlashWindowEx(IntPtr hWnd)
fInfo.hwnd = hWnd;
/// <param name="hWnd">The handle to the window to flash</param>
IntPtr hWnd = frm.Handle;
fInfo.hwnd = hWnd;
Public hwnd As Long
.hwnd = frm.Handle 47: GetActiveWindow Can be used to find the active window Hwnd for GetWindowText 48: GetAltTabInfo
static extern bool GetAltTabInfo(IntPtr hwnd, int iItem, out ALTTABINFO pati,
ByVal hwnd As IntPtr, _ 49: GetAncestor
/// <param name="hwnd">A handle to the window whose ancestor is to be retrieved.
static extern IntPtr GetAncestor(IntPtr hwnd, GetAncestorFlags flags);
Private Shared Function GetAncestor(ByVal hwnd As IntPtr, ByVal gaFlags As GetAncestor_Flags) As IntPtr 50: GetClassLong
public static IntPtr GetClassLongPtr(HandleRef hWnd, int nIndex)
return GetClassLongPtr64(hWnd, nIndex);
return new IntPtr(GetClassLongPtr32(hWnd, nIndex));
public static extern uint GetClassLongPtr32(HandleRef hWnd, int nIndex);
public static extern IntPtr GetClassLongPtr64(HandleRef hWnd, int nIndex);
Public Shared Function GetClassLongPtr(ByVal hWnd As HandleRef, ByVal nIndex As Integer) As IntPtr
Return GetClassLongPtr64(hWnd, nIndex)
Return New IntPtr(GetClassLongPtr32(hWnd, nIndex))
Public Shared Function GetClassLongPtr32(ByVal hWnd As HandleRef, <MarshalAs(UnmanagedType.I4)>nIndex As ClassLongFlags) As UInteger
Public Shared Function GetClassLongPtr64(ByVal hWnd As HandleRef, <MarshalAs(UnmanagedType.I4)>nIndex As ClassLongFlags) As IntPtr
(ByVal hWnd As Long, _ 51: GetClassLongPtr
public static IntPtr GetClassLongPtr(HandleRef hWnd, int nIndex)
return GetClassLongPtr64(hWnd, nIndex);
return new IntPtr(GetClassLongPtr32(hWnd, nIndex));
public static extern uint GetClassLongPtr32(HandleRef hWnd, int nIndex);
public static extern IntPtr GetClassLongPtr64(HandleRef hWnd, int nIndex);
Public Shared Function GetClassLongPtr(ByVal hWnd As HandleRef, ByVal nIndex As Integer) As IntPtr
Return GetClassLongPtr64(hWnd, nIndex)
Return New IntPtr(GetClassLongPtr32(hWnd, nIndex))
Public Shared Function GetClassLongPtr32(ByVal hWnd As HandleRef, ByVal nIndex As Integer) As UInteger
Public Shared Function GetClassLongPtr64(ByVal hWnd As HandleRef, ByVal nIndex As Integer) As IntPtr 52: GetClassName
static extern int GetClassName(IntPtr hWnd, StringBuilder lpClassName,int nMaxCount);
Private Shared Function GetClassName(ByVal hWnd As System.IntPtr, _
Public Declare Auto Function GetClassName Lib "User32.dll" (ByVal hwnd As IntPtr, _
(ByVal hWnd As Long, _
private static bool isIEServerWindow(IntPtr hWnd)
nRet = GetClassName(hWnd, ClassName, ClassName.Capacity); 53: GetClientRect
static extern bool GetClientRect(IntPtr hWnd, out RECT lpRect);
Private Shared Function GetClientRect(ByVal hWnd As System.IntPtr, _
public static RECT GetClientRect(IntPtr hWnd)
GetClientRect(hWnd, out result);
static extern bool OpenClipboard(IntPtr hWndNewOwner); 55: GetComboBoxInfo
public static extern bool GetComboBoxInfo(IntPtr hWnd, ref COMBOBOXINFO pcbi);
Public Shared Function GetComboBoxInfo(ByVal hWnd As IntPtr, ByRef pcbi As COMBOBOXINFO) As Boolean
public IntPtr hwndCombo;
public IntPtr hwndEdit;
public IntPtr hwndList;
Public hwndCombo As IntPtr
Public hwndEdit As IntPtr
Public hwndList As IntPtr
if(cbi.hwndEdit == IntPtr.Zero) { 56: GetDC
static extern IntPtr GetDCEx(IntPtr hWnd, IntPtr hrgnClip, DeviceContextValues flags);
Private Shared Function GetDCEx(ByVal hWnd As IntPtr, ByVal hrgnClip As IntPtr, ByVal DeviceContextValues As DeviceContextValues) As IntPtr
Private Declare Function Lib "user32.dll" GetDCEx(ByVal hWnd As IntPtr, ByVal hrgnClip As IntPtr, ByVal DeviceContextValues As DeviceContextValues) As IntPtr
<param name="hWnd"> An invalid value for the hWnd parameter will cause the function to fail. 57: GetDCEx
static extern IntPtr GetDCEx(IntPtr hWnd, IntPtr hrgnClip, DeviceContextValues flags);
Private Shared Function GetDCEx(ByVal hWnd As IntPtr, ByVal hrgnClip As IntPtr, ByVal DeviceContextValues As Integer) As IntPtr
Private Declare Function Lib "user32.dll" GetDCEx(ByVal hWnd As IntPtr, ByVal hrgnClip As IntPtr, ByVal DeviceContextValues As Integer) As IntPtr
/// below the window identified by hWnd.</summary>
/// above the window identified by hWnd.</summary>
/// set to the upper-left corner of the window identified by hWnd.</summary>
<param name="hWnd"> An invalid value for the hWnd parameter will cause the function to fail. 58: GetDlgCtrlID
static extern int GetDlgCtrlID(IntPtr hwndCtl);
Public Shared Function GetDlgCtrlID(ByVal hWndCtl As IntPtr) As Integer
/// C++ ( Type: Type: HWND )<br /> The return value is a handle to the foreground window. The foreground window 60: GetGUIThreadInfo
public IntPtr hwndActive;
public IntPtr hwndFocus;
public IntPtr hwndCapture;
public IntPtr hwndMenuOwner;
public IntPtr hwndMoveSize;
public IntPtr hwndCaret;
public int hwndActive;
public int hwndFocus;
public int hwndCapture;
public int hwndMenuOwner;
public int hwndMoveSize;
public int hwndCaret;
int hWnd = 0;
hWnd = guiThreadInfo.hwndActive;
return hWnd;
public IntPtr hwndActive;
public IntPtr hwndFocus;
public IntPtr hwndCapture;
public IntPtr hwndMenuOwner;
public IntPtr hwndMoveSize;
public IntPtr hwndCaret;
return info.hwndFocus; Cut off search results after 60. Please refine your search. |