Solved

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

Posted on 2009-04-02
5
682 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

910 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now