[RESOLVED] Starting VB6 Application from C# ????
Hi all,
I have a VB 6.0 application which i am calling from my C# application,
using
Code:
Process startProcess = null;
startProcess = Process.Start("ApplicationPath to start");
this will run the application, next after minimizing the VB 6.0 application I need to display it again, so I used
Code:
ShowWindow(startProcess.MainWindowHandle, SW_SHOWNORMAL);
Here the problem begins that VB6 application do not get displayed back from minimized state.
This code works well if we try it for any other windows application like Notepad.exe, but not with a VB6 exe created with single form without any code.
Need to know about this that why this is not happening in C# to display VB6 application.
Thanks,
Re: Starting VB6 Application from C# ????
Have you used any tools to check the value of the MainWindowHandle and the actual handle of your window? Are they the same or different?
Re: Starting VB6 Application from C# ????
Hi jmcilhinney
I haven't used any tools to check that, but I guessed it is different so I tried a way to get the handle from Process ID and It works.
I suppose that the handle is to be different but the MainWindowHandle work for other applications. Anyway for now my problem is solved.
But I'm confused about why this happens to VB6 exe and not with any other application. Going to check this out later and will get back to you.
Thanks anyway :thumb::thumb:
Re: [RESOLVED] Starting VB6 Application from C# ????
I helped someone with a similar issue a while back.
Look specifically at post 9. The problem seems to be the way windows are created for vb6 applications with the ThunderRT6Main window and the ThunderRT6Form window.
The solution I provided does not guarantee that you will get back the correct window though, as someone posted on my blog