\r\n\r\n
Go Back  Xtreme Visual Basic Talk > Visual Basic .NET (2002/2003/2005/2008, including Express editions) > .NET Interface and Graphics > Implement EXE file inside a form


\r\n \r\n
 
 
Thread Tools Display Modes

\r\n\r\n\r\n
There was a post here about the same problem that I have:
\r\nhttp://www.xtremevbtalk.com/showthread.php?t=272163
\r\nHowever, this problem was dealing with VB6 (I am using VB2010) and the code was much different. I tried but still couldn\'t figure out the right way.
\r\n
\r\nNow I am trying to implement an EXE file (a rotating cube exe file) inside a form that can be open by a click. I don\'t want it to pop up a new window but instead inside a control box within a window (e.g a PictureBox control).
\r\n
\r\nI have this code which can implement the notepad inside the form, but it cannot do that for the rotating cube exe file, it would pop up a new window.
\r\n
\r\nDeclare Auto Function SetParent Lib "user32" (ByVal hWndChild As IntPtr, ByVal hWndNewParent As IntPtr) As IntPtr
\r\nDim MyPSI As New ProcessStartInfo("notepad.exe")
\r\nDim MyProcess As Process = Process.Start(MyPSI)
\r\nMyProcess.WaitForInputIdle()
\r\nSetParent(MyProcess.MainWindowHandle, Me.Handle)
\r\n
\r\nI have spent hours and I\'m still stuck on this. Any help would be much appreciate.
\r\nThank you.
\r\n \r\n\r\n
\r\n \r\n\r\n \r\n \r\n\r\n \r\n\r\n \r\n\r\n \r\n\r\n
\r\n \r\n \r\n \r\n \r\n Reply With Quote\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n\r\n \r\n\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n \r\n \r\n \r\n \r\n\r\n\r\n\r\n\r\n'; // next/previous post info pn[1395058] = "1395058,1395058"; pn[0] = ",1395058"; // cached usernames pu[0] = guestphrase; pu[232369] = "khoahdbui"; // -->
Prev Previous Post   Next Post Next
  #1  
Old 07-15-2012, 10:58 PM
khoahdbui khoahdbui is offline
Newcomer
 
Join Date: Jul 2012
Posts: 2
Default Implement EXE file inside a form


There was a post here about the same problem that I have:
http://www.xtremevbtalk.com/showthread.php?t=272163
However, this problem was dealing with VB6 (I am using VB2010) and the code was much different. I tried but still couldn't figure out the right way.

Now I am trying to implement an EXE file (a rotating cube exe file) inside a form that can be open by a click. I don't want it to pop up a new window but instead inside a control box within a window (e.g a PictureBox control).

I have this code which can implement the notepad inside the form, but it cannot do that for the rotating cube exe file, it would pop up a new window.

Declare Auto Function SetParent Lib "user32" (ByVal hWndChild As IntPtr, ByVal hWndNewParent As IntPtr) As IntPtr
Dim MyPSI As New ProcessStartInfo("notepad.exe")
Dim MyProcess As Process = Process.Start(MyPSI)
MyProcess.WaitForInputIdle()
SetParent(MyProcess.MainWindowHandle, Me.Handle)

I have spent hours and I'm still stuck on this. Any help would be much appreciate.
Thank you.
Reply With Quote
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->