Solved

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

Posted on 2003-10-31
6
1,692 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

747 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

11 Experts available now in Live!

Get 1:1 Help Now