PDA

Click to See Complete Forum and Search --> : Brower for Folder (it's an API ting)


coox
Nov 14th, 1999, 09:52 PM
I'm using the Browser for folder API function. Is it possible to control where on the screen the blasted thing appears?

Code as follows:

Option Explicit
Public Type BrowseInfo
hwndOwner As Long
pIDLRoot As Long
pszDisplayName As Long
lpszTitle As Long
ulFlags As Long
lpfnCallback As Long
lParam As Long
iImage As Long
End Type

Public Const BIF_RETURNONLYFSDIRS = 1
Public Const MAX_PATH = 260

Public Declare Sub CoTaskMemFree Lib "ole32.dll" (ByVal hMem As Long)
Public Declare Function lstrcat Lib "kernel32" Alias "lstrcatA" (ByVal lpString1 As String, ByVal lpString2 As String) As Long
Public Declare Function SHBrowseForFolder Lib "shell32" (lpbi As BrowseInfo) As Long
Public Declare Function SHGetPathFromIDList Lib "shell32" (ByVal pidList As Long, ByVal lpBuffer As String) As Long

Private Sub cmdSaveTo_Click()
Dim OldFolder, SaveFolder As String
Dim hWnd As Long

SaveFolder = BrowseForFolder(hWnd, "Please select a folder.")
MsgBox SaveFolder
If SaveFolder = "" Then Exit Sub
'Set ControlTipText and system variable
cmdSaveTo.ControlTipText = strResFolder
cmbQuarter.SetFocus
End Sub

Oh, and my blasted controltiptext isn't displaying either (yes, it's me what uses VBA in Excel 97, fool that I am) - any bright ideas?