ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   API for TaskBar options (https://www.excelbanter.com/excel-programming/304317-api-taskbar-options.html)

adam99[_6_]

API for TaskBar options
 
Hi All,

Can someone help me with the Windows task bar. I am trying to turn of
"Keep task bar on top" option. I have found an API that gets the stat
of the taskbar but I cannot seem to set it.
Declare Function SHAppBarMessage Lib "shell32.dll" _
(ByVal dwMessage As Long, pData As APPBARDATA) As Long

Does anyone know how to set this property?
The only information I have found that it can only be set for Window
2000 which in my case would be fine.
I need to turn this option off before I change the resolution o
computers running Windows 2000 as it causes the whole taskbar to b
placed in the middle of the screen.

Thanks,
Adam

--
Message posted from http://www.ExcelForum.com


keepITcool

API for TaskBar options
 

http://vbnet.mvps.org/index.html?cod...barmessage.htm

keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


adam99 wrote:

Hi All,

Can someone help me with the Windows task bar. I am trying to turn off
"Keep task bar on top" option. I have found an API that gets the state
of the taskbar but I cannot seem to set it.
Declare Function SHAppBarMessage Lib "shell32.dll" _
(ByVal dwMessage As Long, pData As APPBARDATA) As Long

Does anyone know how to set this property?
The only information I have found that it can only be set for Windows
2000 which in my case would be fine.
I need to turn this option off before I change the resolution of
computers running Windows 2000 as it causes the whole taskbar to be
placed in the middle of the screen.

Thanks,
Adam.


---
Message posted from http://www.ExcelForum.com/



keepITcool

API for TaskBar options
 
Adam..

ApiViewer and ApiGuide do not mention the ABM_SETSTATE constant
nevertheless it works.. in WINDOWS XP only

http://msdn.microsoft.com/library/de...l=/library/en-
us/shellcc/platform/shell/reference/messages/abm_setstate.asp


Although toggling thru the settings is quite useless it DOES demonstrate
how to set the options AutoHide and AlwaysOnTop <vbg


Option Explicit

Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Private Type APPBARDATA
cbSize As Long
hwnd As Long
uCallbackMessage As Long
uEdge As Long
rc As RECT
lParam As Long
End Type


Const ABS_AUTOHIDE As Long = &H1
Const ABS_ALWAYSONTOP As Long = &H2
Const ABM_GETSTATE As Long = &H4
Const ABM_GETTASKBARPOS As Long = &H5
Const ABM_SETSTATE As Long = &HA


Private Declare Function SHAppBarMessage Lib "shell32.dll" (ByVal
dwMessage As Long, pData As APPBARDATA) As Long


Sub TaskBarToggle()
' keepITcool excel.programming 17-jul-2004
Dim BarData As APPBARDATA, Ret As Long

'Prep buffer
BarData.cbSize = Len(BarData)

'Fill structure
Call SHAppBarMessage(ABM_GETTASKBARPOS, BarData)
'get state
Ret = SHAppBarMessage(ABM_GETSTATE, BarData)
Debug.Print "Befo", (Ret And ABS_AUTOHIDE), _
(Ret And ABS_ALWAYSONTOP)
'set lParam
BarData.lParam = Ret Mod 3 + 1
'notify system
Ret = SHAppBarMessage(ABM_SETSTATE, BarData)
'read back
Ret = SHAppBarMessage(ABM_GETSTATE, BarData)
Debug.Print "After :", (Ret And ABS_AUTOHIDE), _
(Ret And ABS_ALWAYSONTOP)
Debug.Print
End Sub




keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool





adam99 wrote:

Hi All,

Can someone help me with the Windows task bar. I am trying to turn off
"Keep task bar on top" option. I have found an API that gets the state
of the taskbar but I cannot seem to set it.
Declare Function SHAppBarMessage Lib "shell32.dll" _
(ByVal dwMessage As Long, pData As APPBARDATA) As Long

Does anyone know how to set this property?
The only information I have found that it can only be set for Windows
2000 which in my case would be fine.
I need to turn this option off before I change the resolution of
computers running Windows 2000 as it causes the whole taskbar to be
placed in the middle of the screen.

Thanks,
Adam.


---
Message posted from http://www.ExcelForum.com/



adam99[_7_]

API for TaskBar options
 
Thanks for replying keepITcool,

I will definately check the code out. I am hoping it will work wit
Windows 2000 as this is the operating system I am having problem
with.

Have you seen anything on the problem I described with changing th
resolution on Windows 2000 have you?

Cheers,
Adam.:

--
Message posted from http://www.ExcelForum.com


keepITcool

API for TaskBar options
 
just read it...

personally I wouldn't be too pleased with an application that's changing
my display settings. (unless ofcourse it's utility where I expect it to
work on my monitor config.)

Imagine how you could crash my multimonitor configuration?
that's why even if I did have some useful input...
I will not even think about it :)


keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


adam99 wrote:

Thanks for replying keepITcool,

I will definately check the code out. I am hoping it will work with
Windows 2000 as this is the operating system I am having problems
with.

Have you seen anything on the problem I described with changing the
resolution on Windows 2000 have you?

Cheers,
Adam.:)


---
Message posted from http://www.ExcelForum.com/




Jon Peltier[_8_]

API for TaskBar options
 
That's why I ignored this post at first. I hate when a program tries to
mess with my system settings. The programmer has to figure out how to
deal with the current settings without changing them.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______

keepITcool wrote:

just read it...

personally I wouldn't be too pleased with an application that's changing
my display settings. (unless ofcourse it's utility where I expect it to
work on my monitor config.)

Imagine how you could crash my multimonitor configuration?
that's why even if I did have some useful input...
I will not even think about it :)


keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


adam99 wrote:


Thanks for replying keepITcool,

I will definately check the code out. I am hoping it will work with
Windows 2000 as this is the operating system I am having problems
with.

Have you seen anything on the problem I described with changing the
resolution on Windows 2000 have you?

Cheers,
Adam.:)


---
Message posted from http://www.ExcelForum.com/






adam99[_8_]

API for TaskBar options
 
Jon Peltier & keepITcool, thanks for the input I will try another tac
without changing the resolution.

Cheers,
Adam. :

--
Message posted from http://www.ExcelForum.com



All times are GMT +1. The time now is 10:32 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com