Shoutbox

VB running exes. - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Skype & Technology (/forumdisplay.php?fid=9)
+---- Forum: Tech Talk (/forumdisplay.php?fid=17)
+----- Thread: VB running exes. (/showthread.php?tid=49187)

VB running exes. by mwe99 on 08-19-2005 at 01:45 PM

Okay Im starting a project in VB.

I already have a .exe file that i want to include in it.

However i made it an OLE object, my question is, is there a way i can run this exe, get data from it and then put it in the VB form?


RE: VB running exes. by matty on 08-20-2005 at 07:30 PM

Why would you want to run a seperate exe? You could just add the forms from the second exe into the first one and call it that way. Or what is the second EXE supposed to do and did you make it?

If you didn't make the second exe what you can do is load it as a resource into your program. (At work right now will post how to do it later)

But the code to run it would be the following.

code:
Dim File() As Byte
Dim x As Long
File() = LoadResData(101, "CUSTOM")
Open App.Path & "\Test.exe" For Binary Write Access As #1
Put #1, , File()
Close #1

'This gets the ProcessID of the program if you need to use it later
x = Shell(App.Path & "\Test.exe")

Use the Windows API to read the text from the window and so on.
RE: VB running exes. by mwe99 on 08-20-2005 at 07:31 PM

i didnt make it, its a game -  tetrix.exe

so when i click a button or make it load auto but using VB