lohamaui.blogg.se

Xojo getfolderitem
Xojo getfolderitem











xojo getfolderitem

If you alter the startin location of the VB shortcut and launch the IDE from the shortcut then app.path reports the location you have in the startin property. If you double click a VBP then it returns the folder the VBP is in If you start VB from the shortcut and have not modified the startin location then it returns c:\ program files. App.Path is the current working directory. If you are looking for the "current" directory, you could just use CurDir or something.No, Trust me I have been using VB for many years. App.* gives information of the application, since in IDE, the IDE is the application, it will use VB6.EXE. You have it wrong, App.Path is = directory where the application is stored. SpecialFolderPath= Trim$(lpStartupPath) & "\" LpStartupPath = Left$(Trim$(lpStartupPath), InStr(lpStartupPath, Chr(0)) - 1) 'do some trimming and remove any null characters 'again, no error - SHGetPathFromIDList will return a 1 if successful

xojo getfolderitem xojo getfolderitem

HResult = SHGetPathFromIDList(ByVal Pidl, lpStartupPath) 'no error, so extract the path to lpStartupPath 'if there was a problem getting the info, the api returns 0 HResult = SHGetSpecialFolderLocation(0, lngNum, Pidl) Public Function SpecialFolderPath(ByVal lngNum As Long) As String

#Xojo getfolderitem Pc

'The following are not documented but are available as actual constantsĬSIDL_MUSIC = &HD 'Current User\My Documents\My MusicĬSIDL_PICTURES = &H27 'Current User\My Documents\My PicturesĬSIDL_PROGRAMFILES = &H26 'Program Files - folder on pcĬSIDL_COMMON_MUSIC = &H35 'All Users\My Documents\My MusicĬSIDL_COMMON_PICTURES = &H36 'All Users\My Documents\My PicturesĬSIDL_COMMON_VIDEOS = &H37 'All Users\My Documents\My VideosĬSIDL_WINDOWS = &H24 'Windows - folder on pc Private Declare Function SHGetPathFromIDList Lib "shell32" (Pidl As Long, ByVal FolderPath As String) As LongĬSIDL_APPDATA = &H1A 'Current User\Application DataĬSIDL_COMMON_DESKTOPDIRECTORY = &H19 'All Users\DesktopĬSIDL_COMMON_FAVORITES = &H1F 'All Users\FavoritesĬSIDL_COMMON_PROGRAMS = &H17 'All Users\Start Menu\ProgramsĬSIDL_COMMON_STARTMENU = &H16 'All Users\Start MenuĬSIDL_COMMON_STARTUP = &H18 'All Users\Start Menu\Programs\StartupĬSIDL_COOKIES = &H21 'Current User\CookiesĬSIDL_DESKTOP = &H0 'Current User\DesktopĬSIDL_FAVORITES = &H6 'Current User\FavoritesĬSIDL_FONTS = &H14 'Winodows\Fonts - folder on pcĬSIDL_HISTORY = &H22 'Current User\Local Settings\HistoryĬSIDL_INTERNET_CACHE = &H20 'Current User\Local Settings\Temporary Internet FilesĬSIDL_NETHOOD = &H13 'Current User\NetHoodĬSIDL_PERSONAL = &H5 'Current User\My DocumentsĬSIDL_PRINTHOOD = &H1B 'Current User\PrintHoodĬSIDL_PROGRAMS = &H2 'Current User\Start Menu\ProgramsĬSIDL_STARTMENU = &HB 'Current User\Start MenuĬSIDL_STARTUP = &H7 'Current User\Start Menu\Programs\StartUpĬSIDL_TEMPLATES = &H15 'Current User\Templates Code: Private Declare Function SHGetSpecialFolderLocation Lib "shell32" (ByVal hWnd As Long, ByVal nFolder As Long, Pidl As Long) As Long













Xojo getfolderitem