Link to home
Start Free TrialLog in
Avatar of hogan9111
hogan9111

asked on

vb.net embedding notepad or any other program to a form

I am using vb.net and I want to have the programs embedded into a form.
In vb6 i use to use

     Dim ret As Long
    ret = FindWindow("Opusapp", vbNullString)
    SetParent ret, form1.hwnd
    form1.Show
 

I tried
 Dim myhandle As IntPtr
        Shell("c:\windows\notepad.exe", AppWinStyle.NormalFocus, True)
        myhandle = FindWindow("Untitled - Notepad", vbNullString)
        Dim form1 As New Form1
        SetParent(myhandle, form1.Handle)
        form1.Show()


it opens notepad but not inside form1

what can I do....
Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

Avatar of hogan9111
hogan9111

ASKER

too confussing, don't know what to do in that forum....
have you tried the code from mcsd2001 that has been accepted as the answer?
yes I didn't know where to copy and paste it. And I tried it but got errors.....

ASKER CERTIFIED SOLUTION
Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ok, but how do u do that with other application, I tried doing it with acrobat reader and nothing happened, just open the application.
you there
I think I deserve some points on that. The question was first asking about Notepad and I did that!
thats impressive