Solved

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

Posted on 2009-04-02
5
678 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 Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

758 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

22 Experts available now in Live!

Get 1:1 Help Now