By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,392 Members | 1,561 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,392 IT Pros & Developers. It's quick & easy.

how to retrieve 'quick launch toolbar' folderpath help!

P: n/a
Dear reader,

In an attempt to obtain the path to the quick-launch-folder in order to
create a shortcut to my application-updates during installation , I thought
to:

1- check if quick launch is used by the user
2- check if a link to my application is there
3- if so, obtain the path (ANY PATH) to the quick-launch-folder from
existing button(s)
4- create a .lnk file in that folder to my own application

At this moment I am able to obtain the WindowNumber of the ToolbarWindow32
and the number of present buttons by apiSendMessage(QuickLaunchID,
TB_BUTTONCOUNT, 0, 0)

However when retrieving the buttoninfo with apiSendMessage(QuickLaunchID,
TB_GETBUTTON, i, TTBBUTTON), a message that explorer will terminate due to
an illegal operation appears. All buttoninfo-values are 0 or null, while 4
items exist in the QLbar.

However very interesting all this, I'm asking myself if I'm not hopelessly
lost on the wrong road !

Isn't there an API 'GetQuickLaunchPath' or so !?!

HELP please !

Dutchy


Public Declare Function apiSendMessage Lib "user32" Alias "SendMessageA"
(ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As
Any) As Long

Public Const WM_USER = &H400
Private Const TB_GETBUTTON = (WM_USER + 23)
Private Const TB_BUTTONCOUNT = (WM_USER + 24)

Type RECT
x1 As Long
y1 As Long
x2 As Long
y2 As Long
End Type

Private Type ButtonInfo
Key As String
Description As String
ToolTipText As String
Type As ButtonTypes
Pressed As Boolean
Deleted As Boolean
Enabled As Boolean
Visible As Boolean
Transparent As Boolean
PicID As Integer
Order As Integer
Location As RECT
End Type

Public Enum ButtonTypes
bt_Default = 0
bt_Check = 1
bt_Seperator = 2
End Enum

Public Sub Test()
Dim TTBBUTTON As ButtonInfo

SysteemBalkID = FindWindow("Shell_Traywnd", vbNullString)
TaakBalkID = FindWindowEx(SysteemBalkID, 0, "ReBarWindow32",
vbNullString)
QuickLaunchID = FindWindowEx(TaakBalkID, 0, "ToolbarWindow32",
vbNullString)

If QuickLaunchID <> 0 Then
numButtons = apiSendMessage(QuickLaunchID, TB_BUTTONCOUNT, 0, 0)
'>>>>>> works OK
Debug.Print "Number of buttons: ", numButtons
For i = 0 To numButtons
Loos = apiSendMessage(QuickLaunchID, TB_GETBUTTON, i, TTBBUTTON)
'>>>> raises explorer crash
With TTBBUTTON
Nummer = .Key
Hidden = .Visible
Debug.Print .Description; .ToolTipText; .Type; .Pressed;
..Deleted; '>>> all values are 0 or null
Debug.Print .Enabled; .Transparent; .PicID; .Order
' x = .Location
End With

''''' isHidden = apiSendMessage(hToolbar, TTBBUTTON, TB_GETBUTTON, 0) <>
0
Debug.Print "Button # " & i & " has ID " & Nummer & " and is " &
Hidden
Next
End If
End Sub

Nov 12 '05 #1
Share this Question
Share on Google+
8 Replies


P: n/a
Perhaps using one of the registry APIs to find the value for...

HKEY_CURRENT_USER\Software\Microsoft\Windows\Curre ntVersion\Current\GrpConv\
MapGroups

value name = Quick Launch
Mike Storr
www.veraccess.com

"Dutchy" <bl*@bla.bla> wrote in message news:c0**********@reader11.wxs.nl...
Dear reader,

In an attempt to obtain the path to the quick-launch-folder in order to
create a shortcut to my application-updates during installation , I thought to:

1- check if quick launch is used by the user
2- check if a link to my application is there
3- if so, obtain the path (ANY PATH) to the quick-launch-folder from
existing button(s)
4- create a .lnk file in that folder to my own application

At this moment I am able to obtain the WindowNumber of the ToolbarWindow32
and the number of present buttons by apiSendMessage(QuickLaunchID,
TB_BUTTONCOUNT, 0, 0)

However when retrieving the buttoninfo with apiSendMessage(QuickLaunchID,
TB_GETBUTTON, i, TTBBUTTON), a message that explorer will terminate due to an illegal operation appears. All buttoninfo-values are 0 or null, while 4
items exist in the QLbar.

However very interesting all this, I'm asking myself if I'm not hopelessly
lost on the wrong road !

Isn't there an API 'GetQuickLaunchPath' or so !?!

HELP please !

Dutchy


Public Declare Function apiSendMessage Lib "user32" Alias "SendMessageA"
(ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As
Any) As Long

Public Const WM_USER = &H400
Private Const TB_GETBUTTON = (WM_USER + 23)
Private Const TB_BUTTONCOUNT = (WM_USER + 24)

Type RECT
x1 As Long
y1 As Long
x2 As Long
y2 As Long
End Type

Private Type ButtonInfo
Key As String
Description As String
ToolTipText As String
Type As ButtonTypes
Pressed As Boolean
Deleted As Boolean
Enabled As Boolean
Visible As Boolean
Transparent As Boolean
PicID As Integer
Order As Integer
Location As RECT
End Type

Public Enum ButtonTypes
bt_Default = 0
bt_Check = 1
bt_Seperator = 2
End Enum

Public Sub Test()
Dim TTBBUTTON As ButtonInfo

SysteemBalkID = FindWindow("Shell_Traywnd", vbNullString)
TaakBalkID = FindWindowEx(SysteemBalkID, 0, "ReBarWindow32",
vbNullString)
QuickLaunchID = FindWindowEx(TaakBalkID, 0, "ToolbarWindow32",
vbNullString)

If QuickLaunchID <> 0 Then
numButtons = apiSendMessage(QuickLaunchID, TB_BUTTONCOUNT, 0, 0)
'>>>>>> works OK
Debug.Print "Number of buttons: ", numButtons
For i = 0 To numButtons
Loos = apiSendMessage(QuickLaunchID, TB_GETBUTTON, i, TTBBUTTON)
'>>>> raises explorer crash
With TTBBUTTON
Nummer = .Key
Hidden = .Visible
Debug.Print .Description; .ToolTipText; .Type; .Pressed;
.Deleted; '>>> all values are 0 or null
Debug.Print .Enabled; .Transparent; .PicID; .Order
' x = .Location
End With

''''' isHidden = apiSendMessage(hToolbar, TTBBUTTON, TB_GETBUTTON, 0) <> 0
Debug.Print "Button # " & i & " has ID " & Nummer & " and is " &
Hidden
Next
End If
End Sub

Nov 12 '05 #2

P: n/a
Hi Mike,

I saw that too, but that are default Microsoft values. I have several
foldernames changed/tweaked on my PC in custom names, like desktopstuff,
entertainment and sytemstuff , but all the standard names for
group-conversion are still mentioned in that registry entry. So however in
most cases it can be used, it will not be right 100% and may provide names
for folders that don't exist (any more). Specially the QuickLaunch folder
will vary on networks, sometimes referring to --\-\-\username\-\-\--
folderpaths.

Thanks anyway for your help.

--
Dutchy
Mike Storr <no****@somewhere.con> schreef in berichtnieuws
EZ******************@news20.bellglobal.com...
Perhaps using one of the registry APIs to find the value for...

HKEY_CURRENT_USER\Software\Microsoft\Windows\Curre ntVersion\Current\GrpConv\ MapGroups

value name = Quick Launch
Mike Storr
www.veraccess.com

"Dutchy" <bl*@bla.bla> wrote in message news:c0**********@reader11.wxs.nl...
Dear reader,

In an attempt to obtain the path to the quick-launch-folder in order to
create a shortcut to my application-updates during installation , I

thought
to:

1- check if quick launch is used by the user
2- check if a link to my application is there
3- if so, obtain the path (ANY PATH) to the quick-launch-folder from
existing button(s)
4- create a .lnk file in that folder to my own application

At this moment I am able to obtain the WindowNumber of the ToolbarWindow32 and the number of present buttons by apiSendMessage(QuickLaunchID,
TB_BUTTONCOUNT, 0, 0)

However when retrieving the buttoninfo with apiSendMessage(QuickLaunchID, TB_GETBUTTON, i, TTBBUTTON), a message that explorer will terminate due

to
an illegal operation appears. All buttoninfo-values are 0 or null, while 4 items exist in the QLbar.

However very interesting all this, I'm asking myself if I'm not hopelessly lost on the wrong road !

Isn't there an API 'GetQuickLaunchPath' or so !?!

HELP please !

Dutchy


Public Declare Function apiSendMessage Lib "user32" Alias "SendMessageA"
(ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As
Any) As Long

Public Const WM_USER = &H400
Private Const TB_GETBUTTON = (WM_USER + 23)
Private Const TB_BUTTONCOUNT = (WM_USER + 24)

Type RECT
x1 As Long
y1 As Long
x2 As Long
y2 As Long
End Type

Private Type ButtonInfo
Key As String
Description As String
ToolTipText As String
Type As ButtonTypes
Pressed As Boolean
Deleted As Boolean
Enabled As Boolean
Visible As Boolean
Transparent As Boolean
PicID As Integer
Order As Integer
Location As RECT
End Type

Public Enum ButtonTypes
bt_Default = 0
bt_Check = 1
bt_Seperator = 2
End Enum

Public Sub Test()
Dim TTBBUTTON As ButtonInfo

SysteemBalkID = FindWindow("Shell_Traywnd", vbNullString)
TaakBalkID = FindWindowEx(SysteemBalkID, 0, "ReBarWindow32",
vbNullString)
QuickLaunchID = FindWindowEx(TaakBalkID, 0, "ToolbarWindow32",
vbNullString)

If QuickLaunchID <> 0 Then
numButtons = apiSendMessage(QuickLaunchID, TB_BUTTONCOUNT, 0, 0)
'>>>>>> works OK
Debug.Print "Number of buttons: ", numButtons
For i = 0 To numButtons
Loos = apiSendMessage(QuickLaunchID, TB_GETBUTTON, i, TTBBUTTON) '>>>> raises explorer crash
With TTBBUTTON
Nummer = .Key
Hidden = .Visible
Debug.Print .Description; .ToolTipText; .Type; .Pressed;
.Deleted; '>>> all values are 0 or null
Debug.Print .Enabled; .Transparent; .PicID; .Order
' x = .Location
End With

''''' isHidden = apiSendMessage(hToolbar, TTBBUTTON, TB_GETBUTTON,

0) <>
0
Debug.Print "Button # " & i & " has ID " & Nummer & " and is " &
Hidden
Next
End If
End Sub


Nov 12 '05 #3

P: n/a
It seems that Access is better than your opensourcestuff ?! Why else
bothering us ?

--
Dutchy
starwars <no****@tatooine.homelinux.net> schreef in berichtnieuws
ed******************************@tat...omelinu x.net...
Pretty much all the source table that does type then run on those and
doesn't say of the data itself, this system that will be used to enter
quickly may be noted evaluated left to Open a sequence of the Employees
report; to re think your rules, for more detail in memory, and has
always to fail to the only process of thing that launches the Access to
programmatically control the import table involved and Resume the
specified database, software development and have to have the write
code is To call Access applications or values this particular errors
your import and then you write a focus on communicating on the this:
kind of data Access sometimes I had still being updated DDL.

Dutchy wrote:
Dear reader,

In an attempt to obtain the path to the quick-launch-folder in order to
create a shortcut to my application-updates during installation , I thought to:

1- check if quick launch is used by the user
2- check if a link to my application is there
3- if so, obtain the path (ANY PATH) to the quick-launch-folder from
existing button(s)
4- create a .lnk file in that folder to my own application

At this moment I am able to obtain the WindowNumber of the ToolbarWindow32 and the number of present buttons by apiSendMessage(QuickLaunchID,
TB_BUTTONCOUNT, 0, 0)

However when retrieving the buttoninfo with apiSendMessage(QuickLaunchID, TB_GETBUTTON, i, TTBBUTTON), a message that explorer will terminate due to an illegal operation appears. All buttoninfo-values are 0 or null, while 4 items exist in the QLbar.

However very interesting all this, I'm asking myself if I'm not hopelessly lost on the wrong road !

Isn't there an API 'GetQuickLaunchPath' or so !?!

HELP please !

Dutchy


Public Declare Function apiSendMessage Lib "user32" Alias "SendMessageA"
(ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As
Any) As Long

Public Const WM_USER = &H400
Private Const TB_GETBUTTON = (WM_USER + 23)
Private Const TB_BUTTONCOUNT = (WM_USER + 24)

Type RECT
x1 As Long
y1 As Long
x2 As Long
y2 As Long
End Type

Private Type ButtonInfo
Key As String
Description As String
ToolTipText As String
Type As ButtonTypes
Pressed As Boolean
Deleted As Boolean
Enabled As Boolean
Visible As Boolean
Transparent As Boolean
PicID As Integer
Order As Integer
Location As RECT
End Type

Public Enum ButtonTypes
bt_Default = 0
bt_Check = 1
bt_Seperator = 2
End Enum

Public Sub Test()
Dim TTBBUTTON As ButtonInfo

SysteemBalkID = FindWindow("Shell_Traywnd", vbNullString)
TaakBalkID = FindWindowEx(SysteemBalkID, 0, "ReBarWindow32",
vbNullString)
QuickLaunchID = FindWindowEx(TaakBalkID, 0, "ToolbarWindow32",
vbNullString)

If QuickLaunchID <> 0 Then
numButtons = apiSendMessage(QuickLaunchID, TB_BUTTONCOUNT, 0, 0)
'>>>>>> works OK
Debug.Print "Number of buttons: ", numButtons
For i = 0 To numButtons
Loos = apiSendMessage(QuickLaunchID, TB_GETBUTTON, i, TTBBUTTON) '>>>> raises explorer crash
With TTBBUTTON
Nummer = .Key
Hidden = .Visible
Debug.Print .Description; .ToolTipText; .Type; .Pressed;
.Deleted; '>>> all values are 0 or null
Debug.Print .Enabled; .Transparent; .PicID; .Order
' x = .Location
End With

''''' isHidden = apiSendMessage(hToolbar, TTBBUTTON, TB_GETBUTTON, 0) <> 0
Debug.Print "Button # " & i & " has ID " & Nummer & " and is " &
Hidden
Next
End If
End Sub































Nov 12 '05 #4

P: n/a
Hi Chuck,

Thanks for your suggestion. I will investigate this tonight. Hope it is what
I need, so I can thank you once more :-)

--
Dutchy
Chuck Grimsby <c.*******@worldnet.att.net.invalid> schreef in berichtnieuws
d1********************************@4ax.com...

Mike's close...

The API that you need is "SHGetSpecialFolderLocation". You'll also
need the "SHGetPathFromIDList", and "GetDesktopWindow" APIs to make it
work however.

Search http://www.mvps.org/ for "SHGetSpecialFolderLocation" and
you'll find sample code.
On Thu, 12 Feb 2004 21:46:47 +0100, "Dutchy" <bl*@bla.bla> wrote:
In an attempt to obtain the path to the quick-launch-folder in order to
create a shortcut to my application-updates during installation

--
File Not Found. Should I Fake It?

Nov 12 '05 #5

P: n/a
Hi again. I couldn't wait and looked at it right away. However, I have code
to retrieve most specialfolder-paths ( using wscript-shell-code).
Surprisingly your api-getspecialfolder-code and my wscript-shell-code accept
different numbers for the same folders !? Very confusing. On top of that I
found in the registry another section " HKCU\s\w\cv\Explorer\Shell Folders\
" with partly the same value-names as my wscript-shell-code accepts as
parameter (both string and indexnumber are accepted) but NOT ALL that is
:-((

One questions still remains : what is the magic number for the QuickLaunch
folder to feed your api- or my wscript-shell-code !?

(Google gives ONE entry on "shgetspecialfolder quick launch")

--
Dutchy
Dutchy <bl*@bla.bla> schreef in berichtnieuws
c0**********@reader11.wxs.nl...
Hi Chuck,

Thanks for your suggestion. I will investigate this tonight. Hope it is what I need, so I can thank you once more :-)

--
Dutchy
Chuck Grimsby <c.*******@worldnet.att.net.invalid> schreef in berichtnieuws d1********************************@4ax.com...

Mike's close...

The API that you need is "SHGetSpecialFolderLocation". You'll also
need the "SHGetPathFromIDList", and "GetDesktopWindow" APIs to make it
work however.

Search http://www.mvps.org/ for "SHGetSpecialFolderLocation" and
you'll find sample code.
On Thu, 12 Feb 2004 21:46:47 +0100, "Dutchy" <bl*@bla.bla> wrote:
In an attempt to obtain the path to the quick-launch-folder in order to
create a shortcut to my application-updates during installation

--
File Not Found. Should I Fake It?


Nov 12 '05 #6

P: n/a
Thanks again Chuck, but last question; are you sure this will always provide
the currently used foldername ? I mean, whatever I choose or how the
network-manager installs his software, it will ALWAYS be
"\Microsoft\Internet Explorer\Quick Launch\" in the current
applicationdata-folder in use by the current user ?!

--
Dutchy
Chuck Grimsby <c.*******@worldnet.att.net.invalid> schreef in berichtnieuws
1q********************************@4ax.com...
On Fri, 13 Feb 2004 14:18:20 +0100, "Dutchy" <bl*@bla.bla> wrote:
Hi again. I couldn't wait and looked at it right away. However, I have codeto retrieve most specialfolder-paths ( using wscript-shell-code).
Surprisingly your api-getspecialfolder-code and my wscript-shell-code acceptdifferent numbers for the same folders !? Very confusing. On top of that Ifound in the registry another section " HKCU\s\w\cv\Explorer\Shell Folders\" with partly the same value-names as my wscript-shell-code accepts as
parameter (both string and indexnumber are accepted) but NOT ALL that is
:-((
One questions still remains : what is the magic number for the QuickLaunchfolder to feed your api- or my wscript-shell-code !?
(Google gives ONE entry on "shgetspecialfolder quick launch")


Use CSIDL_APPDATA (&HA). That gets you the "application data" folder
for the user. Append to the result of that: "Microsoft\Internet
Explorer\Quick Launch\" and you're there.

I've no idea why CSIDL_APPDATA would be different between VBS and VBA,
but then I don't do a heck of a lot of VBS programming outside of web
pages.
--
Psychoceramics: The Study Of Crackpots.

Nov 12 '05 #7

P: n/a
Chuck : many thanks again. I'm really convinced now that my
installation-routine is going to perform well for all my collegue-clients
throughout our company-departments by creating a shortcut in the QL-folder
if that is in use.

Remains the hocus-pocus of toolbar32 , windowhandlers and connected
foldernames to windows stuff {:-0)

But that can wait now until the next winter(nights) ......

Until a next time,

--
Dutchy
Chuck Grimsby <c.*******@worldnet.att.net.invalid> schreef in berichtnieuws
iq********************************@4ax.com...

Yes. Believe it or not, that's rather the whole point of the API
call. It returns where the data is set up to be at, regardless of how
the computer is configured. Just like using
SHGetSpecialFolderLocation to get the location of the user's "My
Documents", TEMP, Cookies, or whatever folder. It doesn't matter if
it's on the "C:\" drive, or buried deep on some server somewhere (A
common practice in large companies with roving users).
SHGetSpecialFolderLocation *always* returns the user's setting for the
CSIDL requested.

On Sun, 15 Feb 2004 18:46:47 +0100, "Dutchy" <bl*@bla.bla> wrote:
Thanks again Chuck, but last question; are you sure this will always provide
the currently used foldername ? I mean, whatever I choose or how the
network-manager installs his software, it will ALWAYS be
"\Microsoft\Internet Explorer\Quick Launch\" in the current
applicationdata-folder in use by the current user ?!
Chuck Grimsby <c.*******@worldnet.att.net.invalid> schreef in berichtnieuws1q********************************@4ax.com...
On Fri, 13 Feb 2004 14:18:20 +0100, "Dutchy" <bl*@bla.bla> wrote:
>Hi again. I couldn't wait and looked at it right away. However, I have
>code
>to retrieve most specialfolder-paths ( using wscript-shell-code).
>Surprisingly your api-getspecialfolder-code and my wscript-shell-code
>accept
>different numbers for the same folders !? Very confusing. On top of that >I
>found in the registry another section " HKCU\s\w\cv\Explorer\Shell
>Folders\
>" with partly the same value-names as my wscript-shell-code accepts as
>parameter (both string and indexnumber are accepted) but NOT ALL that is >:-((
>One questions still remains : what is the magic number for the
>QuickLaunch
>folder to feed your api- or my wscript-shell-code !?
>(Google gives ONE entry on "shgetspecialfolder quick launch")

Use CSIDL_APPDATA (&HA). That gets you the "application data" folder
for the user. Append to the result of that: "Microsoft\Internet
Explorer\Quick Launch\" and you're there.
I've no idea why CSIDL_APPDATA would be different between VBS and VBA,
but then I don't do a heck of a lot of VBS programming outside of web
pages.

--
Not All Men Are Fools. Some Of Them Are Bachelors.

Nov 12 '05 #8

P: n/a
Hi again,

See my first post. I was on my way to go by the hwnd of the toolbar32 (wich
I can retrieve from the system) to obtain the path to the
quicklaunch-folder. Since you can rightclick the quicklaunchbar in the
taskbar and choose "open folder" whereafter the QL-folder pops up on your
desktop, I thought it would be something of get hwnd.connectedpath or
something. But there I lost my way. How can you get the path of a
"folder-window" if you have its hwnd ?! Might also be handy for other
windows.

--
Dutchy
Chuck Grimsby <c.*******@worldnet.att.net.invalid> schreef in berichtnieuws
jq********************************@4ax.com...

You're quite welcome.

Toolbar32? Windowhandlers? Connected foldernames? I'm not sure
what you mean by that, but feel free to ask. Someone around here will
(probably) have an answer (although we may send you to another
newsgroup to actually _provide_ the answer, if it's far enough
off-topic! <Grin> )

On Tue, 17 Feb 2004 13:38:14 +0100, "Dutchy" <bl*@bla.bla> wrote:
Chuck : many thanks again. I'm really convinced now that my
installation-routine is going to perform well for all my collegue-clients
throughout our company-departments by creating a shortcut in the QL-folderif that is in use.
Remains the hocus-pocus of toolbar32 , windowhandlers and connected
foldernames to windows stuff {:-0)
But that can wait now until the next winter(nights) ......

--
Do Radioactive Cats Have 18 Half-lives?

Nov 12 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.