I solved the problem by using cursor API's to set the focus to the child window and then using keyboard events to send the data. Bob Hiller Lifts for the Disabled LLC
I solved the problem by using cursor API's to set the focus to the child window and then using keyboard events to send the data. Bob Hiller Lifts for the Disabled LLC
1.SetParent API cannot set focus
I use the SetParent API to run Notepad and other applications in a VB PictureBox. Everything works fine except that I cannot find anyway to set focus to NotePad through code. The only way is by clicking on it. Is it possible to set focus to a program running in a child window? Thanks, Bob Hiller Lifts for the Disabled LLC
2.SetParent Windows API function notworking with VB 6 forms
I have a requirement where I need to embed a VB 6 forms application into .Net forms application. Basically the new .Net application would act as a wrapper application and would control the embedded VB 6 application. I tried to start the VB 6 in a separate process from dot net app and acquired the handle of the handle to the main window of the process. Next I used to use Win32 API function SetParent to set the parent of the VB 6 application window to the dot net application window. But when I run the dot net app, it creates the VB 6 app and window is launched. But the SetParent does not work as the VB 6 app window stays separately outside the dot net app window. I have pasted the code below for better clarity: //Creating VB 6 app process Process p = null; ProcessStartInfo startInfo = new ProcessStartInfo(); startInfo.FileName = this.exeName; startInfo.WindowStyle = ProcessWindowStyle.Normal; p = Process.Start(this.exeName); //Waiting till the VB 6 process finishes its execution p.WaitForInputIdle(); appWin = p.MainWindowHandle; //Change the window attributes of the VB 6 app so that it can become a //child window to another window... long result = GetWindowLongA(appWin, GWL_STYLE); long newResult = result | WS_CHILD | WS_OVERLAPPEDWINDOW; SetWindowLongA(appWin, GWL_STYLE, newResult); //Use SetParent for changing the parent... IntPtr a = SetParent(appWin, this.Handle); //Move the child window within the parent window MoveWindow(appWin, 0, 0, this.Width, this.Height, true); This method works roughly for embedding app window in another dot net application. But do not work for the embedding a VB 6 app window. What am I missing here?
3.API FindWindow and SetParent function in ASP.NET
4.SetParent API doesn't work for non-MDIchild form
I've succesfully implemented the SetParent API in order to show a form on top of a SSTAB control. This works only for the case that the SSTAB control is in a MDIchild form. In case that I set the MDIchild property to False , the form load event hangs at the SetParent call. How can I solve this since I need the main form to be vbmodal which can only be applied to non-MDIchild forms. Oscar
5.Setting the Focus to and return the Focus of a textbox
Hello, In VB.NET 2008, a Do ... Loop, I creates sereral new textboxes. How can I set the focus on one of them. My code is: Do txtTest = new Textbox With txtTest .Name = "Name" .Text = "Text" End With Loop Until ... I want to set the Focus on a particular textbox. On the other hand, when a textbox has the focus, I want to be able to recognise it, so I can give it the focus again at a later time. Can someone help me? Many thanks, Michel
6. ***** PROBLEM SOLVED ***** PROBLEM SOLVED ***** PROBLEM SOLVED *****
Users browsing this forum: No registered users and 49 guest