PowerBASIC Forums
  PowerBASIC for Windows
  Quick Launch

Post New Topic  Post A Reply
profile | register | preferences | faq | search

UBBFriend: Email This Page to Someone! next newest topic | next oldest topic
Author Topic:   Quick Launch
Pierre Bellisle
Member
posted August 11, 2002 08:06 AM     Click Here to See the Profile for Pierre Bellisle     Edit/Delete Message   Reply w/Quote
"Quick Launch" folder detection...



#Compile Exe
#Dim All
#Register None
#Include "Win32Api.Inc"
'______________________________________________________________________________

Function SpecialFolder(CSIDL As Long) As String
'Many thanks to Semen Matusovski, routine posted February 12, 2001 08:05 AM
Local pidl as DWord
Local TmpAsciiz as Asciiz * %MAX_PATH

If IsFalse(SHGetSpecialFolderLocation(ByVal %HWND_DESKTOP, ByVal CSIDL, ByVal VarPtr(pidl))) Then
SHGetPathFromIDList ByVal pidl, TmpAsciiz
CoTaskMemFree ByVal pidl
Function = TmpAsciiz
End If

End Function
'______________________________________________________________________________

Function PbMain
Local UserName as Asciiz * %UNLEN
Local QuickLaunchFolder as String
Local Retval as Long

CoInitialize byval 0
GetUserName UserName, SizeOf(UserName)

QuickLaunchFolder = SpecialFolder(%CSIDL_APPDATA) & "\Microsoft\Internet Explorer\Quick Launch\"
IF Len(Dir$(QuickLaunchFolder, 16)) then
MsgBox "User: " & Ltrim$(UserName) & $CRLF & QuickLaunchFolder
Else
MsgBox "QuickLaunch not found!"
End If

CoUninitialize

End Function
'______________________________________________________________________________




-- Windows 95 (0, B, C) ----------------------------------------------------------------
For Windows 95-0 and Windows 95B, "Quick Launch" came with ie4
If Windows 95-0 or Windows 95B had his ie updated from ie3 to ie5
then no "Quick Launch" will be installed.

95c (Came with ie4)
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\GrpConv\MapGroups]
"Quick Launch"="C:\\WINDOWS\\Application Data\\Microsoft\\Internet Explorer\\Quick Launch"

-- Windows 98 se ------------------------------------------------------------------------
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\GrpConv\MapGroups]
"Quick Launch"="C:\\WINDOWS\\Application Data\\Microsoft\\Internet Explorer\\Quick Launch"

-- Windows Me -----------------------------------------------------------------------------
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\GrpConv\MapGroups]
"Quick Launch"="C:\\WINDOWS\\Application Data\\Microsoft\\Internet Explorer\\Quick Launch"

-- Windows NT4 sp6, with ie 40 ------------------------------------------------------------
For Windows NT4 "Quick Launch" came with ie4
If Windows NT4 had his ie updated from ie3 to ie5 then no "Quick Launch" will be installed.
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\GrpConv\MapGroups]
"Quick Launch"="C:\\WINNTS\\Profiles\\"UserName"\\Application Data\\Microsoft\\Internet Explorer\\Quick Launch"

Valid for every "UserName"

-- Windows 2000 Pro ------------------------------------------------------------------------
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\GrpConv\MapGroups]
Exist but no "Quick Launch" key...

But can look in folder
C:\Documents and Settings\"UserName"\Application Data\Microsoft\Internet Explorer\Quick Launch

Valid for every "UserName"
Nothing in "All Users"
Nothing in "Default User"

-- Windows XP --------------------------------------------------------------------------------
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\GrpConv\MapGroups]
"Quick Launch"="C:\\Documents and Settings\\"UserName"\\Application Data\\Microsoft\\Internet Explorer\\Quick Launch"

Valid for every "UserName"
Nothing in "All Users"
Nothing in "Default User"
-----------------------------------------------------------------------------------------------

[This message has been edited by Pierre Bellisle (edited October 22, 2004).]

IP: Logged

Walter Schütz
Member
posted June 30, 2006 12:48 PM     Click Here to See the Profile for Walter Schütz     Edit/Delete Message   Reply w/Quote

-- Windows XP --------------------------------------------------------------------------------
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\GrpConv\MapGroups]
"Quick Launch"="C:\\Documents and Settings\\"UserName"\\Application Data\\Microsoft\\Internet Explorer\\Quick Launch"

Valid for every "UserName"
Nothing in "All Users"
Nothing in "Default User"
-----------------------------------------------------------------------------------------------

The above information makes you believe, that the name of the users directory would always be identical to 'UserName'. This is not always correct: if you reinstall a user under WinXP (maybe W2K as well) without cleaning out all stuff, the path might be something like

"Quick Launch"="C:\\Documents and Settings\\"UserName"."Domain"\\Application Data\\Microsoft\\Internet Explorer\\Quick Launch 
or
"Quick Launch"="C:\\Documents and Settings\\"UserName"."Domain".000\\Application Data\\Microsoft\\Internet Explorer\\Quick Launch

The code sample itself is correct and will result in the correct path to the Quick Launch Folder.


------------------
TERRA Datentechnik

[This message has been edited by Walter Schütz (edited June 30, 2006).]

IP: Logged

Fred Buffington
Member
posted June 30, 2006 02:45 PM     Click Here to See the Profile for Fred Buffington     Edit/Delete Message   Reply w/Quote
There could be something else to consider.
The 'windows' folder may not always be called "windows" especially
in win95 and/or win98.

In win95 at one time, i had eventually, after reinstalling windows
more than once, had Windows3 as my 'windows' folder. So you
can't count on windows being the name of the windows folder always.

That makes the api calls more important and I do realize the
registry examples were just that -- examples.

------------------
Client Writeup for the CPA


buff_oasys@yahoo.com

[This message has been edited by Fred Buffington (edited June 30, 2006).]

IP: Logged

Pierre Bellisle
Member
posted June 30, 2006 03:32 PM     Click Here to See the Profile for Pierre Bellisle     Edit/Delete Message   Reply w/Quote
Fred,
yes, the text portion after above code is only there to show difference between OS...

Code will use valid folder found via
SHGetSpecialFolderLocation(%CSIDL_APPDATA) and SHGetPathFromIDList,
so no need to be worry about non conventionnal folder names.

Pierre

[This message has been edited by Pierre Bellisle (edited June 30, 2006).]

IP: Logged

All times are EasternTime (US)

next newest topic | next oldest topic

Administrative Options: Close Topic | Archive/Move | Delete Topic
Post New Topic  Post A Reply
Hop to:

Contact Us | PowerBASIC BASIC Compilers

Copyright © 1999-2007 PowerBASIC, Inc. All Rights Reserved.


Ultimate Bulletin Board 5.45c