Exemplo n.º 1
0
 /// <summary>
 /// Sends the Windows API message.
 /// </summary>
 /// <param name="receiverHandle">The receiver handle.</param>
 /// <param name="message">The message.</param>
 /// <param name="param">The parameter.</param>
 /// <param name="data">The data.</param>
 public static void SendMessage(IntPtr receiverHandle, uint message, IntPtr param, ref CopyDataStruct data)
 {
     IntPtr result;
     if (SendMessageTimeout(receiverHandle, message, param, ref data,
                            SendMessageTimeoutFlags.Normal, 100, out result).ToInt32() == 0)
     {
         throw new WinApiException("SendMessageTimeout", string.Empty);
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Sends the Skype command using Windows API.
 /// </summary>
 /// <param name="command">The command.</param>
 private void sendSkypeCommand(string command)
 {
     var data = new CopyDataStruct { Id = "1", Size = command.Length + 1, Data = command };
     try
     {
         WinApiWrapper.SendMessage(
             _skypeWindowHandle, WinApiConstants.WM_COPYDATA, _windowHandleSource.Handle, ref data);
     }
     catch (WinApiException)
     {
     }
 }
Exemplo n.º 3
0
        /// <summary>
        /// Sends the Windows API message.
        /// </summary>
        /// <param name="receiverHandle">The receiver handle.</param>
        /// <param name="message">The message.</param>
        /// <param name="param">The parameter.</param>
        /// <param name="data">The data.</param>
        public static void SendMessage(IntPtr receiverHandle, uint message, IntPtr param, ref CopyDataStruct data)
        {
            IntPtr result;

            if (SendMessageTimeout(receiverHandle, message, param, ref data,
                                   SendMessageTimeoutFlags.Normal, 100, out result).ToInt32() == 0)
            {
                throw new WinApiException("SendMessageTimeout", string.Empty);
            }
        }
Exemplo n.º 4
0
 private static extern IntPtr SendMessageTimeout(
     IntPtr windowHandle,
     uint message,
     IntPtr wParam,
     ref CopyDataStruct lParam,
     SendMessageTimeoutFlags flags,
     uint timeout,
     out IntPtr result);