By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,382 Members | 1,971 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,382 IT Pros & Developers. It's quick & easy.

Hiding the taskbar completely

lotus18
100+
P: 866
Hello World

I have an API here that shows and hides the windows taskbar. My question is ... how can I completely hide the taskbar without a space below? Like setting it to Auto-hide the taskbar on the taskbar properties? When I run this program it seems like the taskbar's opacity=0 or invisible but still it has a little space below. Do you get what I mean?

I want to show how is it really looks like but I don't know how to insert an image here.

Expand|Select|Wrap|Line Numbers
  1. Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
  2. 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
  3. Public Const SWP_HIDEWINDOW = &H80
  4. Public Const SWP_SHOWWINDOW = &H40
  5.  
  6.  
  7. Public Sub ShowTaskBar()
  8.     Dim adTask As Long
  9.     adTask = FindWindow("Shell_traywnd", vbNullString)
  10.     SetWindowPos rtn, 0, 0, 0, 0, 0, SWP_SHOWWINDOW
  11. End Sub
  12.  
  13.  
  14. Public Sub HideTaskBar()
  15.     Dim adTask As Long
  16.     adTask = FindWindow("Shell_traywnd", vbNullString)
  17.     SetWindowPos rtn, 0, 0, 0, 0, 0, SWP_HIDEWINDOW
  18. End Sub
  19.  
  20.  
Nov 20 '07 #1
Share this Question
Share on Google+
6 Replies


debasisdas
Expert 5K+
P: 8,127
Is that code working for you ?
Nov 20 '07 #2

lotus18
100+
P: 866
Is that code working for you ?
Hi Debasisdas

Yes, it is working for me. Can you give me a solution to my problem?
Nov 20 '07 #3

lotus18
100+
P: 866
Hello!!!

Is anyone can give me a solution on how to solve this???
Nov 20 '07 #4

AHMEDYO
100+
P: 112
HI..

First your code is working good and all is ok but you post it with error with Setwindowspos call with the Hwnd Variable. it must be "adTask" not "rtn"

Second, i was test it and no space apperar or anything like that ,i see that taskbar is fully hidden!!!

Best Regards
Nov 20 '07 #5

lotus18
100+
P: 866
HI..

First your code is working good and all is ok but you post it with error with Setwindowspos call with the Hwnd Variable. it must be "adTask" not "rtn"

Second, i was test it and no space apperar or anything like that ,i see that taskbar is fully hidden!!!

Best Regards
OK. Sorry for that line. I did not double check it before posting. really there's no space below?
Nov 20 '07 #6

AHMEDYO
100+
P: 112
yes, and you know i think that if you make it like auto hide taskbar it will be with small line at bottom to help user to show it again. i think you are in the right way just test it again

Best regards
Nov 20 '07 #7

Post your reply

Sign in to post your reply or Sign up for a free account.