DevTips.NET Forums Home   Search   Login   Register   Member List  
Ontwikkeltalen in .NET  > VB.NET  > Windows Explorer in a VB.net panel  
 
Display using:  
Previous Thread :: Next Thread 
 Author Thread: Windows Explorer in a VB.net panel
Newander is not online. Last active: 10/25/2008 2:11:00 AM Newander
Joined: 24 Oct 2008
Total Posts: 1
 
Windows Explorer in a VB.net panel
Posted: 24 Oct 2008 07:29 PM
Hi guys,

I'm having a hard time getting this code to work, here's the code, I'm trying to open an instance of explorer.exe in a vb.net panel.

Imports System.Runtime.InteropServices



Public Class Form1


Private Const WM_SYSCOMMAND As Integer = 274

Private Const SC_MAXIMIZE As Integer = 61488

Declare Auto Function SetParent Lib "user32.dll" (ByVal hWndChild As IntPtr, ByVal hWndNewParent As IntPtr) As Integer

Declare Auto Function SendMessage Lib "user32.dll" (ByVal hWnd As IntPtr, ByVal Msg As Integer, ByVal wParam As Integer, ByVal lParam As Integer) As Integer



Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

Dim proc As Process

proc = Process.Start("explorer.exe", "/n,::{645FF040-5081-101B-9F08-00AA002F954E}")

proc.WaitForInputIdle()

SetParent(proc.MainWindowHandle, Me.Panel1.Handle)

SendMessage(proc.MainWindowHandle, WM_SYSCOMMAND, SC_MAXIMIZE, 0)

End Sub



End Class


This is the error I'm getting.

Process has exited, so the requested information is not available.


Thanks for the help!

Newander
Previous Thread :: Next Thread 
Page 1 of 1
 
DevTips.NET Forums  > Ontwikkeltalen in .NET  > VB.NET  > Windows Explorer in a VB.net panel