Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Is the taskbar Visible?

Posted on 1999-07-06
8
Medium Priority
?
461 Views
Last Modified: 2012-06-27
i am using this code to hide the taskbar

hwnd1 = FindWindow("Shell_traywnd", "")
Call SetWindowPos(hwnd1, 0, 0, 0, 0, 0, SWP_HIDEWINDOW)

i want to hide the taskbar while booting the system, the code here works, but windows trigger it back again.
i want to know if it is visible, so i could send the hiding code again, without using a timer to kill it every second.
0
Comment
Question by:pakos
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 1

Expert Comment

by:Jaysin28
ID: 1522275
Create a new project in Visual Basic. Form1 is created by default.


Add the following Constant and Declare statements to the General Declarations section of Form1 (note that the Declare statement must be typed as a single line of code):
Private Declare Function SHAppBarMessage Lib "shell32.dll"
   (ByVal dwMessage As Long, pData As APPBARDATA) As Long
Const ABS_ALWAYSONTOP = &H2
Const ABS_AUTOHIDE = &H1
Const ABM_GETSTATE = &H4

Add a Command Button control to Form1. Command1 is created by default.


Add the following code to the Click event for Command1.
Private Sub Command1_Click()
    Dim IsThere As Integer
   
    IsThere = BarExists()
    If IsThere = 0 Then
        Text1.Text = "TaskBar not in auto-hide or always-on-top mode"
    End If
    If IsThere = ABS_ALWAYSONTOP Then
        Text1.Text = "TaskBar always-on-top"
    End If
    If IsThere = ABS_AUTOHIDE Then
        Text1.Text = "TaskBar in auto-hide"
    End If
End Sub

Create a new function called BarExists. Add the following code to this function.
Function BarExists() As Integer
    Dim Bardata As APPBARDATA
    BarExists = SHAppBarMessage(ABM_GETSTATE, Bardata)
End Function

Add a Text Box control to Form1. Text1 is created by default. Set its MultiLine property to True.


Add a new module to the project. Module1.Bas is created by default.


Add the following TYPE structures to Module1.Bas:
Type RECT
        Left As Long
        Top As Long
        Right As Long
        Bottom As Long
End Type
Type APPBARDATA
        cbSize As Long
        hwnd As Long
        uCallbackMessage As Long
        uEdge As Long
        rc As RECT
        lParam As Long '  message specific
End Type

0
 
LVL 13

Expert Comment

by:Mirkwood
ID: 1522276
Cool
0
 

Author Comment

by:pakos
ID: 1522277
This isn't what i need, by using this code i kill the taskbar, no matter (autohide or always on top), try using my code, and add it to urs it doesn't give me the status of the taskbar.
and here's the code the show the taskbar again :
   
    hwnd1 = FindWindow("Shell_traywnd", "")
    Call SetWindowPos(hwnd1, 0, 0, 0, 0, 0, SWP_SHOWWINDOW)

Try adding my code to yours, and u will get the picture,
and thanx for ur concern

0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 6

Accepted Solution

by:
setiawan earned 800 total points
ID: 1522278
Try this :
  dim ret, hwnd1 as long

  hwnd1 = FindWindow("Shell_traywnd", "")
  ret= IsWindowVisible ( hwnd1 )
  If ret=TRUE then
      Call SetWindowPos(hwnd1, 0, 0, 0, 0, 0,SWP_HIDEWINDOW
  End If
 
 Hope this can solve your problem, cya

ps : to declare IsWindowVisible
     Declare Function IsWindowVisible& Lib "user32" (ByVal hwnd As Long)  
 
 
0
 
LVL 7

Expert Comment

by:jaynee
ID: 1522279
'scuse me guys, but I'd like to comment so's I can see this thread when answer is accepted (I'm collecting code snippets whilst I teach myself some API calls).  Hope you don't mind.
0
 

Author Comment

by:pakos
ID: 1522280
Thanx, u just saved my a.. :)
0
 

Author Comment

by:pakos
ID: 1522281
jaynee, u have a good knowledge in heritage buildings, what a coincidence,
thanx.
0
 
LVL 7

Expert Comment

by:jaynee
ID: 1522282
'sOK, pakos - it all went a bit pear-shaped for a bit there, didn't it?  You can reach me on greebie@hotmail.com for today only, if you need to.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

715 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