?
Solved

How to hide Win95/NT task bar from VB?

Posted on 1998-12-01
3
Medium Priority
?
174 Views
Last Modified: 2010-05-03
Task bar is in the way.  Is there a way in VB5 to tell it to hide the taskbar?  Even turning Autohide on/off should work as we could then wait a second and it would autohide itself.  My print technique uses the screen for rendering and the task bar is landing in my printouts like a thumb over the 35mm lens.  UGH!
0
Comment
Question by:rayford
[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
3 Comments
 
LVL 8

Accepted Solution

by:
MikeP090797 earned 150 total points
ID: 1447639
Dim hFw as long
hfW = FindWindow("Shell_TrayWnd", vbNULLString)
ShowWindow hFw, SW_HIDE

0
 
LVL 14

Expert Comment

by:waty
ID: 1447640
Here is another quite same way :

Private Const SWP_HIDEWINDOW = &H80
Private Const SWP_SHOWWINDOW = &H40

Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long

Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cY As Long, ByVal wFlags As Long) As Long

Public Sub HideTaskBar()
   ' #VBIDEUtils#************************************************************
   ' * Programmer Name  : Waty Thierry
   ' * Web Site         : www.geocities.com/ResearchTriangle/6311/
   ' * E-Mail           : waty.thierry@usa.net
   ' * Date             : 2/12/98
   ' * Time             : 11:44
   ' * Module Name      : TaskBar_Module
   ' * Module Filename  : taskbar.bas
   ' * Procedure Name   : HideTaskBar
   ' * Parameters       :
   ' **********************************************************************
   ' * Comments         : Hide the taskbar

   ' *
   ' *
   ' **********************************************************************

   Dim nTaskBarhWnd        As Long

   nTaskBarhWnd = FindWindow("Shell_traywnd", "")
   If nTaskBarhWnd <> 0 Then Call SetWindowPos(nTaskBarhWnd, 0, 0, 0, 0, 0, SWP_HIDEWINDOW)
   
End Sub

0
 
LVL 1

Author Comment

by:rayford
ID: 1447641
The first example worked great but I had to load the ShowWindow call from the windows API which looks like:

Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long

I tried adding Option explicit and so on but the second example still dies often all over the place with not liking the AS LONG on the DIM statement and also kicking out the Private Const lines as invalid also at least in my VB5.  Hey certainly there are no wrong guesses just better ones and other ones and all comments are genuinely appreciated!!

While we are telling people how to make the thing they like disappear I guess we had better also tell them to do this to turn it back on:

SHOWWINDOW hFw, 1
to turn the thing back ON too  :)   Thanks a bunch gang!

-Rayford
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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
Course of the Month8 days, 22 hours left to enroll

765 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