Solved

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

Posted on 2003-10-31
6
1,712 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

Suggested Solutions

Title # Comments Views Activity
Iterate two lists and remove inactive 11 49
VB.net/WinForms: adjust Screen Resolution 6 42
C# application error "Parameter Is Not Valid". 3 79
Tool Box 2 35
In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

896 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now