You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I am programming a VSTO add-in for Microsoft Word and I have problems with "OnTextInput" and "OnTextComposition" callbacks. I just need to intercept what the user is writing inside the body of the Word document, but I can't get the callbacks working. Maybe it could be a problem of initialization, related to the window handle. I've tried to obtain the HWND in many ways:
Hi, I am programming a VSTO add-in for Microsoft Word and I have problems with "OnTextInput" and "OnTextComposition" callbacks. I just need to intercept what the user is writing inside the body of the Word document, but I can't get the callbacks working. Maybe it could be a problem of initialization, related to the window handle. I've tried to obtain the HWND in many ways:
InputMethod.Initialize(Process.GetCurrentProcess().MainWindowHandle, true);
InputMethod.Initialize((IntPtr)Application.ActiveWindow.Hwnd, true);
InputMethod.Initialize((IntPtr)Application.Windows[0].Hwnd, true);
InputMethod.Initialize(GetFocus(), true);
None of these is working. What am I doing wrong?
The text was updated successfully, but these errors were encountered: