Solved

Change taskbar properties (eg. set autohide) in VB.NET

Posted on 2003-10-31
6
1,715 Views
Last Modified: 2012-08-14
Using vb.net, how can I set properties of the windows taskbar?  
For simplicity sake, I have a form with a single button on it....
I'd like the button to show the taskbar status of autohide, not autohide
As the button clicked, I'd like to toggle the state back and forth.
I can't find what I need in the framework.
thanks
0
Comment
Question by:jctiii
  • 3
  • 2
6 Comments
 
LVL 48

Expert Comment

by:Mikal613
ID: 9659275
You cant But you can get if it in autohide or the coordiantes with the api SHAppBarMessage .
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 9660086
With the SHAppBarMessage function, and ABM_GETSTATE and ABM_SETSTATE, you can get/set the state of the AutoHide and AlwaysOnTop properties of the taskbar.
0
 

Author Comment

by:jctiii
ID: 9660429
I've read about  the SHAppBarMessage function...   How do I use this function in vb.net?
 
0
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
LVL 96

Accepted Solution

by:
Bob Learned earned 500 total points
ID: 9660540
  Public Structure RECT
      Public Left As Integer
      Public Top As Integer
      Public Right As Integer
      Public Bottom As Integer
   End Structure

   Public Structure APPBARDATA
      Public cbSize As Integer
      Public hwnd As Integer
      Public uCallbackMessage As Integer
      Public uEdge As Integer
      Public rc As RECT
      Public lParam As Integer      'message specific
   End Structure 'APPBARDATA'

   Private Const ABM_GETSTATE As Integer = &H4
   Private Const ABS_ALWAYSONTOP As Integer = &H2

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

   Private Function AutoHide() As Boolean

      Dim appBar As APPBARDATA
      Dim state As Integer

      appBar.cbSize = Len(appBar)

      state = SHAppBarMessage(ABM_GETSTATE, appBar)

      Return (state <> ABS_ALWAYSONTOP)

   End Function
0
 

Author Comment

by:jctiii
ID: 9670501
Ok... you gave me enough to get the state but not how to set the state.  Nevertheless, you did provide enough for one (even if not 'learned') to figure it out....
Thanks.
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 9670509
The opposite side is ABM_SETSTATE.
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question