Search
Module:
Directory

   Desktop Functions:

   Smart Device Functions:


Show Recent Changes
Subscribe (RSS)
Misc. Pages
Comments
FAQ
Helpful Tools
Playground
Suggested Reading
Website TODO List
Support Forum
Download Visual Studio Add-In

Terms of Use
Privacy Policy

Search Results for "WM" in [All]

winspool

.

    Public wMonth As Short

.

    Public wMinute As Short

.

    Public wMilliseconds As Short

.

    pinvokeResult = SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, IntPtr.Zero,

.

        pinvokeResult = SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, IntPtr.Zero,

.

Turns out that there are some clever and powerful tools in Visual Studio 2005 and 2008 for working with the Management Classes (although couldn’t find it in the “Standard Edition” installed on this machine, definitely exists in my laptop’s Visual Studio). You can use Server Explorer to navigate a treeview to your management class (in this example, the Printers node), right-click on it and select “Generate Managed Class”. This will automagically create a strongly-typed C#.Net class representing the object model of the WMI Printers Class, with all its properties and methods.

advapi32

.

        SE_WMIGUID_OBJECT,

.

NxTwMp I'm glad you always expect me on your site.

.

    SHTDN_REASON_MINOR_WMI          = 0x00000015,

.

    SHTDN_REASON_MINOR_WMI = &H15UI

.

    SHTDN_REASON_MINOR_WMI          = 0x00000015,

.

    SHTDN_REASON_MINOR_WMI = &H15UI

.

    public int dwMinLen;

.

    public int dwMaxLen;

.

        UInt32 dwMinBytes = 0;

.

        if (!ReadEventLog(hEventLog, EVT_READ_FLAGS.EVENTLOG_SEQUENTIAL_READ | EVT_READ_FLAGS.EVENTLOG_BACKWARDS_READ, dwRecordNumber, pBuff, dwBytesToRead, out dwBytesRead, out dwMinBytes))

.

            pBuff = Marshal.ReAllocHGlobal(pBuff, (IntPtr)Convert.ToInt32(dwMinBytes));

.

            dwBytesToRead = dwMinBytes;

.

            if (!ReadEventLog(hEventLog, EVT_READ_FLAGS.EVENTLOG_SEQUENTIAL_READ | EVT_READ_FLAGS.EVENTLOG_BACKWARDS_READ, dwRecordNumber, pBuff, dwBytesToRead, out dwBytesRead, out dwMinBytes))

.

    SE_WMIGUID_OBJECT,S E_REGISTRY_WOW64_32KEY

.

        SE_WMIGUID_OBJECT,

shell32

.

    public int dwMajorVersion;

.

    public int dwMinorVersion;

.

    Dim ddwMajorVersion As Integer

.

    Dim dwMinorVersion As Integer

.

    public int dwMajorVersion;

.

    public int dwMinorVersion;

.

    Dim ddwMajorVersion As Integer

.

    Dim dwMinorVersion As Integer

.

    THUMBBUTTONMASK   dwMask;

.

static extern IntPtr SHAppBarMessage(uint dwMessage,

.

  Shared Function SHAppBarMessage(ByVal dwMessage As Integer, ByRef pData As APPBARDATA) As Integer

.

    Shared Function SHAppBarMessage(ByVal dwMessage As Integer, ByRef pData As APPBARDATA) As Integer

.

    Private Shared Function RegisterWindowMessage(ByVal msg As String) As Integer

.

    uCallbackMessage = RegisterWindowMessage("AppBarMessage")

.

        public const int WM_USER = 0x400;

.

        public const int BFFM_SETSTATUSTEXTA = WM_USER + 100;

.

        public const int BFFM_ENABLEOK = WM_USER + 101;

.

        public const int BFFM_SETSELECTIONA = WM_USER + 102;

.

        public const int BFFM_SETSELECTIONW = WM_USER + 103;

.

        public const int BFFM_SETSTATUSTEXTW = WM_USER + 104;

.

        public const int BFFM_SETOKTEXT = WM_USER + 105; // Unicode only

.

        public const int BFFM_SETEXPANDED = WM_USER + 106; // Unicode only

.

            uint wMsg,

.

            uint wMsg,

.

        SW_SHOWMINIMIZED = 2,

.

        SW_SHOWMAXIMIZED = 3,

.

        SW_SHOWMINNOACTIVE = 7,

.

static extern bool Shell_NotifyIcon(uint dwMessage,

.

Shared Function Shell_NotifyIcon(dwMessage as UInteger, ByRef pnid as NOTIFYICONDATA) as Boolean

.

Returns TRUE if successful, or FALSE otherwise. If dwMessage is set to NIM_SETVERSION, the function returns TRUE if the version was successfully changed, or FALSE if the requested version is not supported

.

On Vista and better, you also have the Win32_Volume WMI classes. See http://msdn.microsoft.com/en-us/library/aa390432(VS.85).aspx

.

public static extern void SHGetSetSettings(ref SHELLSTATE lpss, SSF dwMask, bool bSet);

.

<DllImport("shell32.dll")> Shared Sub SHGetSetSettings(ByRef lpss As SHELLSTATE, ByVal dwMask As SSF, ByVal bSet As Boolean)

.

    public THUMBBUTTONMASK dwMask;

dnsapi

.

        public ushort wMode;

.

        public uint dwMappingFlag;

.

        public uint dwMappingFlag;

.

        public ushort wMode;

.

        public uint dwMappingFlag;

.

        public uint dwMappingFlag;

wininet

.

     public int dwMajorVersion;

.

     public int dwMinorVersion;

gdiplus

.

    /// Use the EmfToWmfBits function in the GDI+ specification to convert a

.

static extern IntPtr GdipEmfToWmfBits(HandleRef hEmf, uint uBufferSize,

.

    byte[] bBuffer, int iMappingMode, EmfToWmfBitsFlags flags);

.

private declare function GdipEmfToWmfBits lib "gdiplus.dll"(ByVal hEmf as IntPtr, _

.

    ByVal flags as EmfToWmfBitsFlags) as UInteger

.
Documentation
[GdipEmfToWmfBits] on MSDN

user32

.
Summary
Places the given window in the system-maintained clipboard format listener list. The window will then receive a WM_CLIPBOARDUPDATE message when the clipboard contents have changed.
.

private const int WM_CLIPBOARDUPDATE = 0x031D;

.

    if (m.Msg == WM_CLIPBOARDUPDATE)

.

An application sends the WM_MDIICONARRANGE message to the multiple-document interface (MDI) client window to prompt the client window to arrange its minimized MDI child windows.

.

static extern IntPtr CallNextHookEx(IntPtr hhk, int nCode, WM wParam, [In]KBDLLHOOKSTRUCT lParam);

.

static extern IntPtr CallNextHookEx(IntPtr hhk, int nCode, WM wParam, [In]MSLLHOOKSTRUCT lParam);

.

ChangeWindowMessageFilter is a function in the Microsoft Windows operating system that changes the way that a window processes certain types of messages. It is typically used to prevent certain types of messages from being sent to a window, or to modify the behavior of the window in response to a message.

.

For example, a program may use ChangeWindowMessageFilter to block mouse events from being sent to a window, or to modify the way that the window responds to keyboard input.

.

ChangeWindowMessageFilter is typically called from within the window procedure for a window, and is passed a message identifier and a message parameter.

.

The ChangeWindowMessageFilter function is available on Windows Vista and later versions of the operating system.

.

It replaces the pageChangeWindowMessageFilter function, which was available on earlier versions of Windows.

.

static extern TODO ChangeWindowMessageFilter(USER32)(TODO);

.

Declare Function ChangeWindowMessageFilter(USER32) Lib "user32.dll" (TODO) As TODO

.
Documentation
ChangeWindowMessageFilter(USER32)@msdn on MSDN
.

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

.

    public enum ChangeWindowMessageFilterExAction : uint

.

    Private Enum ChangeWindowMessageFilterExAction As UInteger

.

    Private Enum ChangeWindowMessageFilterFlags As UInteger

.

ChangeWindowMessageFilterEx(Handle,_message,ChangeWindowMessageFilterExAction.Allow, IntPtr.Zero);

.

        ChangeWindowMessageFilterEx(Handle,_message,ChangeWindowMessageFilterExAction.Allow, ref filterStatus);

.
Documentation
[ChangeWindowMessageFilterEx] on MSDN
.

Windows allows only one caret per message queue. To add a caret to a control, handle the WM_SETFOCUS message, or the GotFocus event, or override OnGotFocus if you're writing a custom control, and call CreateCaret from the message or event handler. You should also handle WM_KILLFOCUS, LostFocus or OnLostFocus and call DestroyCaret. You will also need to call ShowCaret to make the caret visible, and SetCaretPos to set its position.

.

    public const uint WM_DRAWITEM = 0x002b;

.

    public const uint WM_MEASUREITEM = 0x002c;

.

    ///<Summary>Sends a WM_NCCALCSIZE message to the window, even if the window's size is not being changed. If this flag is not specified, WM_NCCALCSIZE is sent only when the window's size is being changed.</Summary>

.

    ///<Summary>Prevents the window from receiving the WM_WINDOWPOSCHANGING message.</Summary>

.

    '''<Summary>Sends a WM_NCCALCSIZE message to the window, even if the window's size is not being changed. If this flag is not specified, WM_NCCALCSIZE is sent only when the window's size is being changed.</Summary>

.

    '''<Summary>Prevents the window from receiving the WM_WINDOWPOSCHANGING message.</Summary>

.
Summary
.

static extern bool DrawMenuBar(IntPtr hWnd);

.

    static extern bool DrawMenuBar(IntPtr hWnd);

.

              DrawMenuBar(frm.Handle);

.
Documentation
[DrawMenuBar] on MSDN
.

            private const UInt32 WM_CLOSE = 0x0010;

.

                            // Try closing application by sending WM_CLOSE to all child windows in all threads.

.

                PostMessage(hWnd, WM_CLOSE, IntPtr.Zero, IntPtr.Zero);

.

       Private Const WM_CLOSE As UInt32 = &H10

.

           ' Try closing application by sending WM_CLOSE to all child windows in all threads.

.

         PostMessage(hWnd, WM_CLOSE, IntPtr.Zero, IntPtr.Zero)

.

    static extern bool DrawMenuBar(IntPtr hWnd);

.

              DrawMenuBar(frm.Handle);

.

Sendmessage(hwndMain, WM_COMMAND, intMID,  0) 'Click the MenuItem!

.

static extern int GetMessage(out MSG lpMsg, IntPtr hWnd, uint wMsgFilterMin,

.

   uint wMsgFilterMax);

.

     ByVal wMsgFilterMin As UInteger, _

.

     ByVal wMsgFilterMax As UInteger) As <MarshalAs(UnmanagedType.Bool)> Boolean

.

     UINT wMsgFilterMin, // first message

.

     UINT wMsgFilterMax  // last message

.

wMsgFilterMin

.

wMsgFilterMax

.

If the function retrieves a message other than WM_QUIT, the return value is nonzero.

.

If the function retrieves the WM_QUIT message, the return value is zero.

.

The GetMessage function only retrieves messages associated with the window identified by the hWnd parameter or any of its children as specified by the IsChild function, and within the range of message values given by the wMsgFilterMin and wMsgFilterMax parameters. If hWnd is NULL, GetMessage retrieves messages for any window that belongs to the calling thread and thread messages posted to the calling thread via PostThreadMessage. GetMessage does not retrieve messages for windows that belong to other threads nor for threads other than the calling thread. Thread messages, posted by the PostThreadmessage function, have a message hWnd value of NULL. If wMsgFilterMin and wMsgFilterMax are both zero, GetMessage returns all available messages (that is, no range filtering is performed).

.

The WM_KEYFIRST and WM_KEYLAST constants can be used as filter values to retrieve all messages related to keyboard input; the WM_MOUSEFIRST and WM_MOUSELAST constants can be used to retrieve all mouse messages. If the wMsgFilterMin and wMsgFilterMax parameters are both zero, the GetMessage function returns all available messages (that is, without performing any filtering).

.

GetMessage does not remove WM_PAINT messages from the queue. The messages remain in the queue until processed.

.

        if (m.Msg == (int)WindowMessages.RawInput)  // WindowMessages.RawInput = 0x00FF (WM_INPUT)

.

        var deviceHandle = ti.hSource; // a handle obtained from WM_TOUCH message.

.

Sendmessage(hwndMain, WM_COMMAND, intMID,  0) 'Click the MenuItem!

.

    static extern bool DrawMenuBar(IntPtr hWnd);

.

              DrawMenuBar(frm.Handle);

.

    static extern bool DrawMenuBar(IntPtr hWnd);

.

        DrawMenuBar(handle);

.
Summary
.

static extern uint GetWindowModuleFileName(IntPtr hwnd,

.

  Private Shared Function GetWindowModuleFileName(hwnd As IntPtr, _

.

GetWindowModuleFileName(hwnd, fileName, 2000);

.
Documentation
[GetWindowModuleFileName] on MSDN
.

Please note that this does NOT work properly with Windows Vista Aero (this includes Windows 10), and reports faulty values. This is largely due to Aero incorporating additional invisible borders which are used to "resize" the window using the cursor. In this instance, the developer should look into using DwmGetWindowAttribute (dwmapi.dll) with DWMWA_EXTENDED_FRAME_BOUNDS.

.

///     WM_GETTEXTLENGTH message to be sent to the specified window or control.<br />Under certain conditions, the

.

///     <br />To obtain the exact length of the text, use the WM_GETTEXT, LB_GETTEXT, or CB_GETLBTEXT messages, or the

.
Summary
Copies the text of the specified window's title bar (if it has one) into a buffer. If the specified window is a control, the text of the control is copied. However, GetWindowText cannot retrieve the text of a control in another application, If the target window is owned by the current process, GetWindowText causes a WM_GETTEXT message to be sent to the specified window or control.
.

To retrieve the text of a control in another process, send a WM_GETTEXT message directly instead of calling GetWindowText.

.

To retrieve the text of a possibly unresponsive control in the same process, use SendMessageTimeout with a WM_GETTEXT message instead.

.

///     If the target window is owned by the current process, GetWindowText causes a WM_GETTEXT message to be sent to the

.

///     text of a control in another process, send a WM_GETTEXT message directly instead of calling GetWindowText.<br />For

.

But, if you need to get text from a control in another process, GetWindowText() won't work. Use WM_GETTEXT instead.

.

    int length = (int)SendMessage(hwnd, WM_GETTEXTLENGTH, IntPtr.Zero, IntPtr.Zero);

.

    SendMessage(hwnd, WM_GETTEXT, (IntPtr)sb.Capacity, sb);

.

    <MarshalAs(UnmanagedType.U4)> ByVal dwMilliseconds as Int32, _

.

     Byval prmdwMiliseconds as Long _

.

dwMilliseconds

.

Messagebox wont time out if dwMilliseconds is 0

.

   uint dwMilliseconds, uint dwWakeMask, uint dwFlags);

.

                ByVal dwMilliseconds As Integer, _

.

        int dwMilliseconds,

.

   uint dwMilliseconds, uint dwWakeMask, uint dwFlags);

.

                ByVal dwMilliseconds As Integer, _

.

static extern bool PeekMessage(out NativeMessage lpMsg, HandleRef hWnd, uint wMsgFilterMin,

.

   uint wMsgFilterMax, uint wRemoveMsg);

.

Based off of Tom Miller's blog. Modified to comply with VS.Net 2005 static code analysis (i.e. proper MarshalAs attributes) and eliminate the refrence to WindowMessage.

.

public const uint WM_KEYDOWN = 0x100;

.

PostMessage(hWnd,  WM_KEYDOWN, VkKeyScan('h'), 0);

.

PostMessage(hWnd,  WM_KEYDOWN, VkKeyScan('e'), 0);

.

PostMessage(hWnd,  WM_KEYDOWN, VkKeyScan('l'), 0);

.

PostMessage(hWnd,  WM_KEYDOWN, VkKeyScan('l'), 0);

.

PostMessage(hWnd,  WM_KEYDOWN, VkKeyScan('o'), 0);

.

MSDN recommends using PostQuitMessage over PostMessage when you want to send WM_QUIT http://msdn.microsoft.com/en-us/library/ms632641%28v=vs.85%29.aspx

.

    /// A handle to the window that will receive WM_HOTKEY messages generated by the

.

    /// hot key. If this parameter is NULL, WM_HOTKEY messages are posted to the

.

    /// uVirtKey parameter in order to generate the WM_HOTKEY message. The fsModifiers

.

    /// a WM_HOTKEY message.

.

    const int WM_HOTKEY = 0x0312;

.

    /// A handle to the window that will receive WM_HOTKEY messages generated by the

.

        if (m.Msg == WM_HOTKEY

.

        // Raise the HotKeyPressed event if it is an WM_HOTKEY message.

.

    public const int WM_HOTKEY = 0x312;

.

        if (msg == WM_HOTKEY && wParam.ToInt32() == HotkeyID)

.
Summary
Enables your app to receive the WM_POWERBROADCAST window message, which notifies applications about power management events
.

       private const int WM_POWERBROADCAST = 0x0218;

.

        if (msg == WM_POWERBROADCAST && wParam.ToInt32() == PBT_POWERSETTINGCHANGE)

.

  TWF_WANTPALM = 0x00000002 //Setting this flag disables palm rejection which reduces delays for getting WM_TOUCH messages.

.
Summary
.

///     The <see cref="RegisterWindowMessage" /> function is typically used to register messages for communicating between

.

///     <see cref="RegisterWindowMessage" /> when more than one application must process the same message.For sending

.

///     private messages within a window class, an application can use any integer in the range WM_USER through 0x7FFF.

.

/// static extern uint RegisterWindowMessage(string lpString);

.

///      queryCancelAutoPlay = RegisterWindowMessage("QueryCancelAutoPlay");

.

static extern uint RegisterWindowMessage(string lpString);

.

Private Shared Function RegisterWindowMessage( _

.

class method RegisterWindowMessage(lpString: String): UInt32; external;

.

Declare Function RegisterWindowMessage Lib "user32.dll" (ByVal lpString As String) As Integer

.

    DllImport("user32.dll", EntryPoint = "RegisterWindowMessageW", SetLastError = true)]

.

    private static extern int RegisterWindowMessage(string lpString);

.

Declare Function RegisterWindowMessage Lib "user32.dll" Alias "RegisterWindowMessageW" (ByVal lpString As long) As Integer

.

    lngWindowMsg = RegisterWindowMessage(StrPtr(strMessageToRegister))

.

If you use RegisterWindowMessage("QueryCancelAutoPlay") it will NOT work, put the "QueryCancelAutoPlay" in a variable or constant and use that one.

.

    MessageID = RegisterWindowMessage("QueryCancelAutoPlay")

.

lMsg = Win32.RegisterWindowMessage("WM_HTML_GETOBJECT");

.

static extern uint RegisterWindowMessage(string lpString);

.

        queryCancelAutoPlay = RegisterWindowMessage("QueryCancelAutoPlay");

.
Documentation
[RegisterWindowMessage] on MSDN
.

    Public Const WM_NCLBUTTONDOWN As Integer = &HA1

.

        SendMessage(Handle, WM_NCLBUTTONDOWN, HT_CAPTION, 0)

.

private const int WM_SYSCOMMAND = 0x112;

.

   SendMessage(ctrl.Handle, WM_SYSCOMMAND, MOUSE_MOVE, ref nul);

.
Summary
Removes the given window from the system-maintained clipboard format listener list. The window will then no longer receive a WM_CLIPBOARDUPDATE message when the clipboard contents have changed.
.

private const int WM_CLIPBOARDUPDATE = 0x031D;

.

    if (m.Msg == WM_CLIPBOARDUPDATE)

.

    static extern bool DrawMenuBar(IntPtr hWnd);

.

              DrawMenuBar(frm.Handle);

Cut off search results after 60. Please refine your search.


 
Access PInvoke.net directly from VS: