I'd like to know if there is a VB code that will open a folder the way you use theses ShellExec Commands...BUT the folder ipes up to specific View Settings namely Extra Large all the time. I tried saving it but the settings eventually go to something else. Also some folders I want the icons to be in List View and others in Extra Large view... Can you also make the window that opens up have a specific Groupby setting all the time?
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" ( _ ByVal hwnd As Long, _ ByVal lpOperation As String, _ ByVal lpFile As String, _ ByVal lpParameters As String, _ ByVal lpDirectory As String, _ ByVal nShowCmd As Long) As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" ( _ ByVal lpClassName As String, _ ByVal lpWindowName As String) As Long
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" ( _ ByVal hWnd1 As Long, _ ByVal hWnd2 As Long, _ ByVal lpsz1 As String, _ ByVal lpsz2 As String) As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" ( _ ByVal hwnd As Long, _ ByVal wMsg As Long, _ ByVal wParam As Long, _ lParam As Any) As Long
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Private Const SW_SHOWNORMAL As Long = 1 Private Const WM_COMMAND = &H111
Private Sub Command1_Click() OpenFolder "C:\", viewREPORT End Sub
Private Sub OpenFolder(ByVal sFolderPath As String, Optional ByVal eView As FolderView = viewDEFAULT) Dim N As Long, lhWnd As Long, lPrevhWnd As Long If Len(Dir(sFolderPath, vbDirectory)) = 0 Then Exit Sub
If you are a Visitor, go ahead and post your reply as a
new comment, and we'll move it here for you
once it's approved. Be sure to use the same name and email address.