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
Download Visual Studio Add-In

Search Results for "send" in [All]

winhttp

.

/// <param name="lpcwszUrl">A pointer to a null-terminated Unicode string that contains the URL of the HTTP request that the application is preparing to send.</param>

.

static extern bool WinHttpSendRequest(

.

Declare Function WinHttpSendRequest Lib "winhttp.dll" (ByVal hRequest As IntPtr, ByVal pwszHeaders As String, ByVal dwHeadersLength As Integer, ByVal lpOptional As Byte(), ByVal dwOptionalLength As Integer, ByVal dwTotalLength As Integer, ByVal dwContext As IntPtr) As Boolean

.
Documentation
[WinHttpSendRequest] on MSDN
.

            int dwSendTimeout,

.

Declare Function WinHttpSetTimeouts Lib "winhttp.dll" (ByVal hInternet As IntPtr, ByVal dwResolveTimeout As Integer, ByVal dwConnectTimeout As Integer, ByVal dwSendTimeout As Integer, ByVal dwReceiveTimeout As Integer) As Boolean

netapi32

.
Summary
This function sends a buffer of information to a registered message alias.
.

static extern int NetMessageBufferSend(

.

    ''' The NetMessageBufferSend function sends a buffer of information to a registered message alias.

.

    ''' Windows NT:  No special group membership is required to execute the NetMessageBufferSend function on a LAN Manager or a Windows NT system.

.

    ''' Admin, Accounts, Print, or Server Operator group membership is required to successfully execute NetMessageBufferSend on a remote server.

.

    Public Declare Function NetMessageBufferSend Lib "netapi32.dll" _

.

The Alerter service must be running for NetMessageBufferSend to function.

.

This is a simple console program which lets you send messages (quite similar to the NET SEND command...).

.
Usage
sendnetmsg.exe srcName dstName message
.

public class SendNetMsg

.

    public static extern int NetMessageBufferSend(

.

        Console.WriteLine ("sendnetmsg.exe srcName dstName msg");

.

        int retVal = NetMessageBufferSend (null, argv[1], argv[0], argv[2], argv[2].Length * 2);    

.
Documentation
[NetMessageBufferSend] on MSDN
.

        private static extern int NetMessageBufferSend(

.

        public static int NetMessageSend(string serverName,string messageName,string fromName,string strMsgBuffer, int iMsgBufferLen)

.

            return NetMessageBufferSend(serverName,messageName,fromName,strMsgBuffer,iMsgBufferLen*2);

.

private void button1_Click(object sender, System.EventArgs e)

.

            ' Note: By Sending Null were looking at current machine

imm32

.

private void button1_Click(object sender, System.EventArgs e)

user32

.

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.

.
Summary
.

    private void button1_Click(object sender, System.EventArgs e) {

.

    Private Sub TextBox1_GotFocus(sender As Object, e As EventArgs) Handles TextBox1.GotFocus

.

    ///<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>

.

    SWP_NOSENDCHANGING = 0x0400,

.

    '''<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>

.

    SWP_NOSENDCHANGING = &H0400

.

    SWP_NOSENDCHANGING As Integer = &H0400

.

/// <para>The DestroyWindow function destroys the specified window. The function sends WM_DESTROY and WM_NCDESTROY messages to the window to deactivate it and remove the keyboard focus from it. The function also destroys the window's menu, flushes the thread message queue, destroys timers, removes clipboard ownership, and breaks the clipboard viewer chain (if the window is at the top of the viewer chain).</para>

.

''' <para>The DestroyWindow function destroys the specified window. The function sends WM_DESTROY and WM_NCDESTROY messages to the window to deactivate it and remove the keyboard focus from it. The function also destroys the window's menu, flushes the thread message queue, destroys timers, removes clipboard ownership, and breaks the clipboard viewer chain (if the window is at the top of the viewer chain).</para>

.

btnCloseWindow_Click(object sender, EventArgs e)

.

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

.

     private void label1_Click(object sender, EventArgs e)

.

    Private Sub label1_Click(sender As Object, e As EventArgs)

.

     private void button1_Click(object sender, EventArgs e)

.

     private void button2_Click(object sender, EventArgs e)

.

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

.

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

.

    private void timer1_Tick(object sender, EventArgs e)

.

     Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick

.

Private Sub Button1_Click(ByVal sender As System.Object, _

.

     private void button1_Click(object sender, EventArgs e)

.

     private void button2_Click(object sender, EventArgs e)

.

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

.

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

.

        QS_SENDMESSAGE =    0x0040,

.

        QS_ALLINPUT = (QS_INPUT | QS_POSTMESSAGE | QS_TIMER | QS_PAINT | QS_HOTKEY | QS_SENDMESSAGE)

.

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

.

     private void Form1_Load(object sender,EventArgs e)

.

    private void Form1_Load(object sender, EventArgs e)

.

    Private Sub Form1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Click

.

private void button1_Click(object sender, System.EventArgs e)

.

Private Sub tb_GotFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles tb.GotFocus

.
Summary
.

static extern InSendMessageExFlags InSendMessageEx(IntPtr lpReserved);

.

InSendMessageExFlags

.
Documentation
[InSendMessageEx] on MSDN
.

    private void button1_Click(object sender, EventArgs e)

.

// Sends ENTER button press event in focused window

.

     private void timer1_Tick(System.Object sender, System.EventArgs e)

.

' Sends ENTER button press event in focused window

.

     Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick

.

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

.

Alternative Managed API: System.Windows.Forms.SendKeys

.

    private void Compare(object sender, string expected, string actual)

.

        Button ClickedButton = (Button)sender;

.

    private void buttonNumericAccept_Click(object sender, EventArgs e)

.

        // Send Appropriate Key Presses

.

        Compare(sender, expected, NumericTextbox.Text);        

.

    private void Surface_MouseEnter(object sender, EventArgs e)

.

    Private Sub Form_Closed(ByVal sender As System.Object, ByVal e As FormClosedEventArgs) Handles MyBase.FormClosed

.

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

.

    private void Surface_MouseEnter(object sender, EventArgs e)

.

    Private Sub Form_Closed(ByVal sender As System.Object, ByVal e As FormClosedEventArgs) Handles MyBase.FormClosed

.

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

.

private void button1_Click(object sender, EventArgs e)

.

FYI, Microsoft tells us for "Windows NT/2000/XP: This function has been superseded. Use SendInput instead."

.

     private void timer1_Tick(System.Object sender, System.EventArgs e)

.

     Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick

.

    Private Sub cmdClick_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmdClick.Click

.

    Private Sub picClicker_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles picClicker.Click

.

    Private Sub picClicker_MouseDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles picClicker.MouseDown

.

    Private Sub picClicker_MouseUp(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles picClicker.MouseUp

.

Thus I have resigned myself to unmanaged code for now. I will post the SendInput version shortly as mouse_event has been deprecated by Bill in favor of SendInput.

.

    Private Sub ResizeMe_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles ResizeMe.MouseMove

.

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

.

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick

.

private void Paint(object sender, PaintEventArgs e)

.

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

.
Summary
Registers a device to send its raw input data.
.

///     when sending or posting messages.

.

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

.

Win32.SendMessageTimeout(windowHandle, lMsg, IntPtr.Zero, IntPtr.Zero, SendMessageTimeoutFlags.SMTO_ABORT_IF_HUNG, 1000, out lRes);

.

    Private Shared Function SendMessage(ByVal hWnd As IntPtr,

.

    Private Sub Form1_MouseDown(sender As Object, e As MouseEventArgs) Handles Me.MouseDown

.

        SendMessage(Handle, WM_NCLBUTTONDOWN, HT_CAPTION, 0)

.

private static extern int SendMessage(IntPtr hWnd, int msg , int wParam , ref int lParam);

.

private void control_MouseDown(object sender, MouseEventArgs e)

.

   Control ctrl = sender as Control;

.

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

.

  private static extern UInt32 SendMessage(

.

  lResult = SendMessage(  // returns LRESULT in lResult

.

    private static extern uint SendMessage(

.

    private static extern uint SendMessage(

.

        return (int)SendMessage(this._handle, SB_GETPARTS, 0, 0);

.

        uint length = (uint)SendMessage(this._handle, SB_GETTEXTLENGTH, index, 0);

.

            StatusBar.SendMessage(this._handle, SB_GETTEXT, (IntPtr)index, allocated);

.

/// If SW_INVALIDATE, don't send WM_ERASEBACKGROUND.

.

unsafe private void hScrollBar1_Scroll( object sender, ScrollEventArgs e )

.
Summary
.

static extern IntPtr SendDlgItemMessage(IntPtr hDlg, int nIDDlgItem, uint Msg,

.

Private Shared Function SendDlgItemMessage(ByVal hDlg As IntPtr, _

.

Private Declare Function SendDlgItemMessage Lib "user32" (ByVal hDlg As IntPtr, _

.

        SendDlgItemMessage(theDialogBoxHandle, theNoButtonItemId, theClickMessage, wParam, lParam)

.
Documentation
[SendDlgItemMessage] on MSDN
.
Summary
.

The SendInput function synthesizes keystrokes, mouse motions, and button clicks to the currently active window

.

   internal static extern uint SendInput (uint nInputs,

.

Friend Shared Function SendInput(<[In]()> ByVal nInput As UInt32,

.

Private Declare Function SendInput Lib "user32.dll" (ByVal cInputs As Integer, ByRef pInputs As INPUT, ByVal cbSize As Integer) As Integer

.

   Api.user32.SendInput((uint)pInputs.Length, pInputs, StructLib.INPUT.Size);

.

   Start-Sleep 2 ; [Testing.Windows3]::SendInput($_inputArray.count, $_inputArray, [Runtime.InteropServices.marshal]::SizeOf($_inputArray[0]))

.
Documentation
[SendInput] on MSDN
.
Summary
.

public static extern IntPtr SendMessageTimeout(

.

    SendMessageTimeoutFlags fuFlags,

.

public static extern IntPtr SendMessageTimeout(

.

    SendMessageTimeoutFlags flags,

.

[DllImport("user32.dll", EntryPoint = "SendMessageTimeout", SetLastError=true, CharSet=CharSet.Auto)]

.

public static extern uint SendMessageTimeoutText(

.

    SendMessageTimeoutFlags flags,

.

[DllImport("user32.dll", EntryPoint = "SendMessageTimeout", CharSet = CharSet.Auto)]

.

public static extern int SendMessageTimeout(

.

SendMessageTimeoutFlags

.

Public Sub SendMessageTimeout(ByVal windowHandle As IntPtr,ByVal Msg As Integer,ByVal wParam As IntPtr,ByVal lParam As IntPtr,ByVal flags As SendMessageTimeoutFlags,ByVal timeout As Integer,ByRef result As IntPtr)

.

Public Shared Function SendMessageTimeout(ByVal windowHandle As IntPtr, ByVal Msg As Integer, ByVal wParam As IntPtr, ByVal lParam As IntPtr, ByVal flags As SendMessageTimeoutFlags, ByVal timeout As Integer, ByRef result As IntPtr) As IntPtr

.

Win32.SendMessageTimeout(windowHandle, lMsg, IntPtr.Zero, IntPtr.Zero, SendMessageTimeoutFlags.SMTO_ABORT_IF_HUNG, 1000, out lRes);

.

    int result = SendMessageTimeout(hwnd, WM_GETTEXTLENGTH, 0, 0, 0X2C, 5, out length); //0X2C = SMTO_ABORTIFHUNG | SMTO_BLOCK | SMTO_NOTIMEOUTIFNOTHUNG | SMTO_ERRORONEXIT

.
Documentation
[SendMessageTimeout] on MSDN
.
Summary
.

static extern bool SendMessageCallback(IntPtr hWnd, uint Msg, UIntPtr wParam,

.

    IntPtr lParam, SendMessageDelegate lpCallBack, UIntPtr dwData);

.

C# signature for the SendMessageDelegate:

.

delegate void SendMessageDelegate(IntPtr hWnd, uint uMsg, UIntPtr dwData, IntPtr lResult);

.
Documentation
[SendMessageCallback] on MSDN
.
Summary
.

public static extern IntPtr SendMessageTimeout(

.

    SendMessageTimeoutFlags fuFlags,

.

public static extern IntPtr SendMessageTimeout(

.

    SendMessageTimeoutFlags flags,

.

[DllImport("user32.dll", EntryPoint = "SendMessageTimeout", SetLastError=true, CharSet=CharSet.Auto)]

.

public static extern uint SendMessageTimeoutText(

.

    SendMessageTimeoutFlags flags,

.

SendMessageTimeoutFlags

.

Public Sub SendMessageTimeout(ByVal windowHandle As IntPtr,ByVal Msg As Integer,ByVal wParam As IntPtr,ByVal lParam As IntPtr,ByVal flags As SendMessageTimeoutFlags,ByVal timeout As Integer,ByRef result As IntPtr)

.

Public Shared Function SendMessageTimeout(ByVal windowHandle As IntPtr, ByVal Msg As Integer, ByVal wParam As IntPtr, ByVal lParam As IntPtr, ByVal flags As SendMessageTimeoutFlags, ByVal timeout As Integer, ByRef result As IntPtr) As IntPtr

.

Win32.SendMessageTimeout(windowHandle, lMsg, IntPtr.Zero, IntPtr.Zero, SendMessageTimeoutFlags.SMTO_ABORT_IF_HUNG, 1000, out lRes);

.
Documentation
[SendMessageTimeout] on MSDN
.
Summary
.

static extern bool SendNotifyMessage(IntPtr hWnd, uint Msg, UIntPtr wParam,

.

Public Function SendNotifyMessage( _

.

Public Declare Function SendNotifyMessage Lib "user32.dll" Alias "SendMessageA" ( _

.
Documentation
[SendNotifyMessage] on MSDN
.

    static extern int SendMessage(IntPtr hWnd, int Msg, IntPtr wParam, IntPtr lParam);

.

            SendMessage(hWndNextWindow, m.Msg, m.WParam, m.LParam);

.

            SendMessage(hWndNextWindow, m.Msg, m.WParam, m.LParam);

.

I've got problems with SendKeys method, doesn't work. So this API function is a good alternative.

.

    Private Sub cmdNumLock_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmdNumLock.Click

.

    Private Sub cmdCapsLock_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdCapsLock.Click

.

.NET 1.1: SendKeys method (System.Windows.Forms)

.

.NET 2.0: My.Computer.Keyboard.SendKeys

.

    private void button4_Click(object sender, EventArgs e)

.

    static extern IntPtr SendMessage(IntPtr hWnd, UInt32 Msg, int wParam, int lParam);

.

    SendMessage(proc.MainWindowHandle, WM_SYSCOMMAND, SC_MAXIMIZE, 0);

.

     private void button1_Click(object sender, EventArgs e)

.

     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

.

    ///         Applies new frame styles set using the SetWindowLong function. Sends a WM_NCCALCSIZE message

.

    ///         <term>SWP_NOSENDCHANGING (0x0400)</term>

.

   NOSENDCHANGING = 0x0400,

.

        ///     Applies new frame styles set using the SetWindowLong function. 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.

.

        SWP_NOSENDCHANGING = 0x0400,

.

private void Form1_Load(object sender, System.EventArgs e)

.

///         Installs a hook procedure that monitors messages before the system sends them to the

.

///     text of a control in another process, send the WM_SETTEXT message directly instead of calling

.

///     <see cref="!:https://msdn.microsoft.com/en-us/library/windows/desktop/ms644928%28v=vs.85%29.aspx#sending">

.

///     Sending a

.
Note
This SetWindowText will set text to the controls(textbox for example) in the same process. If they exist in other processes, use SendMessage instead... - jp
.

        private void Form1_Load(object sender, System.EventArgs e)

.

    private void button1_Click(object sender, EventArgs e)

.

    private void button2_Click(object sender, EventArgs e)

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


 
Access PInvoke.net directly from VS: