Solved

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

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
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…
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…
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…

830 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