示例#1
0
        public static Boolean SendMessage(String msg, String windowName)
        {
            IntPtr WINDOW_HANDLER = Win32API.FindWindow(null, windowName);

            if (WINDOW_HANDLER == IntPtr.Zero)
            {
                return(false);
            }
            else
            {
                COPYDATASTRUCT cds;
                cds.dwData = (IntPtr)100;
                cds.lpData = msg;
                cds.cbData = Encoding.Unicode.GetBytes(msg).Length + 1;
                Win32API.SendMessage(WINDOW_HANDLER, Win32API.WM_COPYDATA, IntPtr.Zero, ref cds);
            }
            return(true);
        }
示例#2
0
 private static Boolean SendMessageToSecuruStikForm(String msg)
 {
     return(Win32API.SendMessage(msg, MainFormText));
 }