Reputation: 375
I developed an application of controlling other window using WindowsMessage. It works successfully with my sample application, which is build by C#. However, then I tried to configure my controlling application with the legacy window, which is developed by VB6.0. Here I got 2 issues,
1) The following method returns false and textfield was not updated.
IntPtr wParam = IntPtr.Zero;
IntPtr lParam = Marshal.StringToHGlobalAuto(text);
bool retVal = Convert.ToBoolean(SendMessage(handle, WM_SETTEXT, wParam, lParam));
Can anybody help me to figure it out ?
2) When I scanned the sub-controllers in legacy application (using the window messaging),I found some controllers that their class names are ThunderRT6FormDC, ThunderRT6UserControlDC. What are these controllers ?
Upvotes: 1
Views: 2156
Reputation: 64700
2) The ThunderRT6FormDC and ThunderRT6UserControlDC are Visual Basic specific class names: VB sprang from an original project called Thunder and so the name stuck with a lot of the bits and pieces of VB code. Many VB window classes have Thunder in the name, including the 2 you saw.
1) My expectation is that the handle you fetched is not pointing at the right window: are you using Spy++ or a similar tool to look at the VB6 window and determine the proper text window, or are you setting the focus to the text window before sending the WM_SETTEXT message?
Upvotes: 2