Hi,
I know there's numerous other articles on this topic (although I have yet to find an FAQ despite the fact it's a common question). I've got an API to create a windows explorer to search my hard drive when I click on a browse button, unfortunately it doesn't allow me to use the thumbnails view. Any help would be great, I'm using the following code and need the tags to enable thumbnail previewing:
<code>
Private Declare Function GetOpenFileName Lib "comdlg32.dll" Alias "GetOpenFileNameA" (pOpenfilename As OPENFILENAME) As Long
Private Type OPENFILENAME
lStructSize As Long
hWndOwner As Long
hInstance As Long
lpstrFilter As String
lpstrCustomFilter As String
nMaxCustFilter As Long
nFilterIndex As Long
lpstrFile As String
nMaxFile As Long
lpstrFileTitle As String
nMaxFileTitle As Long
lpstrInitialDir As String
lpstrTitle As String
flags As Long
nFileOffset As Integer
nFileExtension As Integer
lpstrDefExt As String
lCustData As Long
lpfnHook As Long
lpTemplateName As String
End Type
Private Sub browsefile_Click()
Dim OFName As OPENFILENAME
OFName.lStructSize = Len(OFName)
'Set the parent window
OFName.hWndOwner = Me.Hwnd
'Set the application's instance
'OFName.hInstance = App.hInstance
'Select a filter
OFName.lpstrFilter = "Jpegs (*.jpg)" + Chr$(0) + "*.jpg" + Chr$(0) + "All Files (*.*)" + Chr$(0) + "*.*" + Chr$(0)
'create a buffer for the file
OFName.lpstrFile = Space$(254)
'set the maximum length of a returned file
OFName.nMaxFile = 255
'Create a buffer for the file title
OFName.lpstrFileTitle = Space$(254)
'Set the maximum length of a returned file title
OFName.nMaxFileTitle = 255
'Set the initial directory
OFName.lpstrInitialDir = "\\Dataserver\"
'Set the title
OFName.lpstrTitle = "Open File"
'No flags
OFName.flags = 0
'Show the 'Open File'-dialog
If GetOpenFileName(OFName) Then
'MsgBox "File to Open: " + Trim$(OFName.lpstrFile)
Me![filenames] = Left(Trim$(OFName.lpstrFile), (Len(Trim$(OFName.lpstrFile)) - 1))
Else
MsgBox "You Have Canceled Your Browsing"
End If
End Sub
</code>
I know there's numerous other articles on this topic (although I have yet to find an FAQ despite the fact it's a common question). I've got an API to create a windows explorer to search my hard drive when I click on a browse button, unfortunately it doesn't allow me to use the thumbnails view. Any help would be great, I'm using the following code and need the tags to enable thumbnail previewing:
<code>
Private Declare Function GetOpenFileName Lib "comdlg32.dll" Alias "GetOpenFileNameA" (pOpenfilename As OPENFILENAME) As Long
Private Type OPENFILENAME
lStructSize As Long
hWndOwner As Long
hInstance As Long
lpstrFilter As String
lpstrCustomFilter As String
nMaxCustFilter As Long
nFilterIndex As Long
lpstrFile As String
nMaxFile As Long
lpstrFileTitle As String
nMaxFileTitle As Long
lpstrInitialDir As String
lpstrTitle As String
flags As Long
nFileOffset As Integer
nFileExtension As Integer
lpstrDefExt As String
lCustData As Long
lpfnHook As Long
lpTemplateName As String
End Type
Private Sub browsefile_Click()
Dim OFName As OPENFILENAME
OFName.lStructSize = Len(OFName)
'Set the parent window
OFName.hWndOwner = Me.Hwnd
'Set the application's instance
'OFName.hInstance = App.hInstance
'Select a filter
OFName.lpstrFilter = "Jpegs (*.jpg)" + Chr$(0) + "*.jpg" + Chr$(0) + "All Files (*.*)" + Chr$(0) + "*.*" + Chr$(0)
'create a buffer for the file
OFName.lpstrFile = Space$(254)
'set the maximum length of a returned file
OFName.nMaxFile = 255
'Create a buffer for the file title
OFName.lpstrFileTitle = Space$(254)
'Set the maximum length of a returned file title
OFName.nMaxFileTitle = 255
'Set the initial directory
OFName.lpstrInitialDir = "\\Dataserver\"
'Set the title
OFName.lpstrTitle = "Open File"
'No flags
OFName.flags = 0
'Show the 'Open File'-dialog
If GetOpenFileName(OFName) Then
'MsgBox "File to Open: " + Trim$(OFName.lpstrFile)
Me![filenames] = Left(Trim$(OFName.lpstrFile), (Len(Trim$(OFName.lpstrFile)) - 1))
Else
MsgBox "You Have Canceled Your Browsing"
End If
End Sub
</code>