Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default 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/


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default 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/


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default 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/





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 70
Default 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/





  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
tools options view window options Joe[_14_] Excel Discussion (Misc queries) 1 November 11th 09 04:08 PM
Taskbar aftamath77 Excel Discussion (Misc queries) 0 November 21st 08 06:47 PM
how do I add more toolbar options to my right click options Rosie Excel Discussion (Misc queries) 1 August 11th 06 04:52 PM
"Show Windows in Taskbar" option from the ToolsOptionsView broke Ben Zapp Excel Discussion (Misc queries) 0 November 9th 05 07:40 PM
Excel 2000: Options-View-Show-Windows in Taskbar resets everytime. Papa John Excel Discussion (Misc queries) 3 February 28th 05 11:59 AM


All times are GMT +1. The time now is 09:26 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"