Solved

Run Exe program within another Exe (window) program in vb6

Posted on 2009-04-02
5
684 Views
Last Modified: 2013-12-03
Hello!
      I need to run an application (exe) within another application. To be more specific, i think a saw a long time ago a vb6 project that could launch another application, and run that application prisoner in it's own window..... That application couldn't be dragged outside the launching application window.
    I think that might be an API function... or something.
   Do yoy have any informations?
   
   Thank you!
0
Comment
Question by:Cristi_E
5 Comments
 
LVL 11

Expert Comment

by:bmatumbura
ID: 24048694
0
 
LVL 7

Accepted Solution

by:
cmrobertson earned 250 total points
ID: 24048743
0
 
LVL 4

Author Comment

by:Cristi_E
ID: 24049471
     It seems that SetParent API function is the only way in vb6.
     What about VB.Net?    What options do i have?
0
 
LVL 7

Expert Comment

by:cmrobertson
ID: 24050056
this link shows you how to use the process.start and communicate with it, so you are able to wait for the started process to complete before moving on
http://visualbasic.about.com/od/usingvbnet/a/prstrt.htm
0
 
LVL 85

Assisted Solution

by:Mike Tomlinson
Mike Tomlinson earned 250 total points
ID: 24050060
It would be the same in VB.Net...but you would change the API declaration so it has the correct data types.

VB6 Declaration:

    Private Declare Function SetParent Lib "user32" Alias "SetParent" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long

VB.Net Declarations:

    Private Declare Function SetParent Lib "user32" Alias "SetParent" (ByVal hWndChild As IntPtr, ByVal hWndNewParent As IntPtr) As Integer
    ' or
    Private Declare Function SetParent Lib "user32" Alias "SetParent" (ByVal hWndChild As Integer, ByVal hWndNewParent As Integer) As Integer
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question