A
A
astrotrain2015-11-05 15:03:19
C++ / C#
astrotrain, 2015-11-05 15:03:19

Why doesn't WM_SETTEXT work in another application (c#)?

I am writing a program in sisharp, which itself logs into gmail. The problem is that I can't send an email to the field, wm_settext just doesn't work. What are the options? Thank you.

IntPtr hWndIe = NativeMethods.FindWindow("IEFrame", null);
IntPtr hWndtab = NativeMethods.FindWindowEx(hWndIe, IntPtr.Zero, "Frame Tab", null);
IntPtr hWndtabw = NativeMethods.FindWindowEx(hWndtab, IntPtr.Zero, "TabWindowClass", null);
IntPtr hWndshell = NativeMethods.FindWindowEx(hWndtabw, IntPtr.Zero, "Shell DocObject View", null);
IntPtr hWndEdit = NativeMethods.FindWindowEx(hWndshell, IntPtr.Zero, "Internet Explorer_Server", null);

NativeMethods.PostMessage(hWndEdit, WM_KEYDOWN, Keys.Tab, IntPtr.Zero);
NativeMethods.SendMessage(hWndEdit, WM_SETTEXT, 0, "[email protected]");

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question