Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2009-04-02
5
Medium Priority
?
710 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 1000 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 86

Assisted Solution

by:Mike Tomlinson
Mike Tomlinson earned 1000 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

916 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