473,761 Members | 2,455 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

embed a VB Standard EXE in a .Net Windows app - in-place activatio

I am having an existing VB 6 standard .EXE application. Now I am developing a
wrapper application in .Net and I want to launch the VB 6 exe app embedded
with
in the .Net App window. That is, the standard EXE application should be
activated in-place within the .Net window and should be confined within the
..Net app window.

Any suggestions on how I go about doing this stuff?

This is a repeat post for the new visitors.
Jul 21 '05 #1
2 1968
A good place to start is probably this codeproject article:

http://www.codeproject.com/cs/miscctrl/AppControl.asp

Note that it doesn't work out of the box with VB6 exes, though. I know
a guy who figured that part out, though, so I'll ask him about it.
Raghavendran Muraleetharan wrote:
I am having an existing VB 6 standard .EXE application. Now I am developing a
wrapper application in .Net and I want to launch the VB 6 exe app embedded
with
in the .Net App window. That is, the standard EXE application should be
activated in-place within the .Net window and should be confined within the
.Net app window.

Any suggestions on how I go about doing this stuff?

This is a repeat post for the new visitors.

Jul 21 '05 #2
Okay, here goes.

To launch a vb6 exe as a child of a winform, you can make the following
changes to the control in the CodeProject article:

Where it grabs the window handle to the child app:
// Start the process
p = System.Diagnost ics.Process.Sta rt(this.exeName );
// Wait for process to be created and enter idle condition
p.WaitForInputI dle();
// Get the main handle
appWin = p.MainWindowHan dle;

Replace the last line with this method call:

// Note, p.MainWindowHan dle points to the hidden VB main application
// window (classname ThunderRT6Main)
// that own's the VB Main form window. We need to find the VB Main Form
// window (classname ThunderRT6FormD C)
appWin = FindMainVBForm( p.MainWindowHan dle);

And, of course, add the method. This finds the window handle to the
real VB6 form instead of the hidden one that is the mainwindowhandl e of
the process.

/// <summary>
/// VB Applications have a hidden top window which own's the window that
/// is the main VB form. The OwnerWindow is a pointer to this hidden
/// window.
/// This window is not the parent of the main VB form (classname
/// ThunderRT6FormD C). So we need to loop through all the windows to
/// find the window that has the OwnerWindow as it's owner.
/// </summary>
/// <param name="OwnerWind ow">Pointer to OwnerWindow (classname
/// ThunderFormRT6M ain</param>
/// <returns></returns>
private IntPtr FindMainVBForm( IntPtr OwnerWindow )
{
IntPtr pCurWindow = GetWindow(Owner Window, GW_HWNDFIRST );
while( pCurWindow != IntPtr.Zero )
{
// Check
if( GetWindow( pCurWindow, GW_OWNER ) == OwnerWindow )
{
break;
}
pCurWindow = GetWindow(pCurW indow, GW_HWNDNEXT );
}
return pCurWindow;
}

Craig Vermeer wrote:
A good place to start is probably this codeproject article:

http://www.codeproject.com/cs/miscctrl/AppControl.asp

Note that it doesn't work out of the box with VB6 exes, though. I know
a guy who figured that part out, though, so I'll ask him about it.
Raghavendran Muraleetharan wrote:
I am having an existing VB 6 standard .EXE application. Now I am
developing a wrapper application in .Net and I want to launch the VB 6
exe app embedded with
in the .Net App window. That is, the standard EXE application should
be activated in-place within the .Net window and should be confined
within the .Net app window.

Any suggestions on how I go about doing this stuff?

This is a repeat post for the new visitors.

Jul 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
4280
by: gsb | last post by:
I'd like to get the offset coordinates, top & left, of an embedded Flash movie. <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.ca b#version=7,0,14,0" id="tabMenu" width="720" height="420"> <param name="movie" value="tabMenu.swf"> <param name="menu" value="false">
11
4498
by: Anna | last post by:
Hi all. I want to embed the EMBED tag in the object tag. I understood that I need to provide a PARAM tag inside the OBJECT whose value will hold the content of EMBED src attribute, but after that I've got confused. For example, what should be put into classid and codebase attributes of the OBJECT now embedding the EMBED tag?
10
6326
by: Anna | last post by:
Hi all. I don't have a very deep understanding of CSS and this question might sound stupid for you. Sorry for that. Can the overflow CSS property be applied to the embed tag? I have an embed tag whose source is big SVG file, whose dimensions are unknown. If it is bigger than the screen, the rest of the SVG is clipped and not shown. I would like to force the embed tag to scroll in that case.
1
3186
by: Frances Del Rio | last post by:
I have this tag to embed a video: <EMBED type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/" SRC="video.wmv" name="Video" width="320" height="312" ShowControls="1" ShowStatusBar="1" invokeURLs="0" autostart="1" enableErrorDialogs="0" ></EMBED> but I need video area bg color to be white, it defaults to black and I
0
1230
by: Peter | last post by:
Hi Windows application embed IE control embed applet <--- this is the way i know that emebd a java app into a windows app, but the disadvantage is slow, because applet take a longer time to load than a normal standalone java app. Is there any way to embed a JFrame/Java standalone application(with interface) into a windows app? thanks
2
3288
by: Annu | last post by:
Hi I need help on <enbed> tag. Following code(No 1) is working properly on windows but on linux code no.2 is not working Code No 1: <EMBED type='application/x-mplayer2' pluginspage='http://microsoft.com/windows/mediaplayer/en/download/' id='mediaPlayer' name='mediaPlayer' displaysize='4' autosize='-1'
13
3163
by: Lloyd Dupont | last post by:
In the good old days I believe people were using the arcane technology which came to be known as COM+ to embed other application's document in their own document. Like a Word with document a Windows Media Player or Excel or Visio document inside, double click on it and *bang* you coud start edit it using Excel/WMP/Visio toolbar. Apparently even OpenOffice could do that.
4
10629
by: yawnmoth | last post by:
I'm currious - how do applet, object, and embed compare to one another? They seem to me to mostly do the same thing, so why would one chose one over another?
2
8087
dream party
by: dream party | last post by:
Inserting a Flash (SWF, FLV) file into HTML web page is already an old and familiar thing to all of us. It is a rather non-flexible thing that just to edit some options in the template. However, I did not understand some parameters totally in the HTML tag. These days when I was surfing the Internet I have found some comprehensive introduction to these two tags. I read it and conclude it with my own words; I think it will be useful to us, so I...
0
9538
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
9909
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9788
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8794
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7342
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6623
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5384
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3889
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3481
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.