Program inside a programs frame (Visual Basic)
Program inside a programs frame (Visual Basic)
I'm currently coding in visual basic, I have a grasp on the language so I would like to stick to this language, but I'm having a small problem. I'm working on a personal app to do simple things like browse the net, view files and folders, but what I can not seem to find a way to do is open another program (in this case "Winamp") inside of my current projects frames. I want it to be bound into the application as if it were part of it. Of course the actualy programs would never be compiled together but I would still like to some how call the app into my project. Any ideas guys?
- floodhound2
- ∑lectronic counselor
- Posts: 2117
- Joined: 03 Sep 2006, 16:00
- 17
- Location: 127.0.0.1
- Contact:
You kind of lost me in the way you wrote this, but i think you want to start up a program while running yours?
if so check this out.
You can obviously change this to locate any program you wish as well as using anything other than command buttons
if so check this out.
Code: Select all
Private Sub Command1_Click()
Shell "C:\WINDOWS\SYSTEM32\taskmgr.exe", vbNormalFocus
End Sub
Private Sub Command2_Click()
Shell "C:\Program Files\
Common files\MicrosoftShared\MSInfo\msinfo32.exe", vbNormalFocus
End Sub
Private Sub Command3_Click()
Shell "explorer.exe", vbNormalFocus
End Sub
₣£ΘΘĐĦΘŮŇĐ
Well yes that, but that I can do, what you suggested will just allow me to execute an external program. What I want to do is have it run inside of my gui. Like you would show someone elses web page inside of an iframe in html. Does that make sense?
\"The OS is detected as NetBSD (it will even run on your toaster).\"
- floodhound2
- ∑lectronic counselor
- Posts: 2117
- Joined: 03 Sep 2006, 16:00
- 17
- Location: 127.0.0.1
- Contact:
Haha E I remember talking with you in the IRC, but ya I like in the middle of no where in VA so very few people are using the line ^_^ tis very nice. As for a hurry not really, its just bothering me that something that sounds so simple (again I have a web design background, ie IFRAMES) can be so complicated. Its I guess the word we be "frustrating" to not know how this can be done.
Also on another note, in this tool I am trying to make I would like their to be a command prompt. Just cmd.exe tied in, doesnt have to show the window, just some way to send it commands that I put in the text box and then be able to see the output in another label. I understand I can use the shell to send it commands, and I've seen the code to tell the cmd to output to a text file and have the program read and display from that, but the command window still flashes after each command and this method of exporting to text seems rather crude. Anyone you guys know to retrieve the text output from the cmd and display it in a label? (to add to this I use the command prompt for cygwin and I enjoy the command line style interface but would like it incorporated into my custom gui.
Also on another note, in this tool I am trying to make I would like their to be a command prompt. Just cmd.exe tied in, doesnt have to show the window, just some way to send it commands that I put in the text box and then be able to see the output in another label. I understand I can use the shell to send it commands, and I've seen the code to tell the cmd to output to a text file and have the program read and display from that, but the command window still flashes after each command and this method of exporting to text seems rather crude. Anyone you guys know to retrieve the text output from the cmd and display it in a label? (to add to this I use the command prompt for cygwin and I enjoy the command line style interface but would like it incorporated into my custom gui.
no this is actually very simple just one api call and a MDI parent formfloodhound2 wrote:What about making your form transparent with the program you want running inside the boundaries of your form?
What you are asking is a bit tough to do, if you are in a hurry and need it done I would require cash.
this vb.net code will open notepad as a MDI child in your forum
Code: Select all
Declare Auto Function SetParent Lib "user32" (ByVal hWndChild As IntPtr, ByVal hWndNewParent As IntPtr) As IntPtr
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim MyPSI As New ProcessStartInfo("notepad.exe")
Dim MyProcess As Process = Process.Start(MyPSI)
System.Threading.Thread.Sleep(100)
SetParent(MyProcess.MainWindowHandle, Me.Handle)
End Sub
here is a sample vb2005 project
http://rapidshare.com/files/94691727/MDI.rar.html
Enjoy