Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

[SOLVED] Hide the windows start button/icon


This topic has been archived. This means that you cannot reply to this topic.
7 replies to this topic

#1 Korlando

Korlando

    CC Regular

  • Member
  • PipPipPip
  • 44 posts

Posted 13 November 2012 - 10:40 AM

I am making a program where it hides the taskbar. It also contains a close button where at the end of the program it shows the taskbar to the user again(it works like a switch on/off)

I took the code from another tutorial but i fixed it to fit to my program. The problem is that while it hides the taskbar(yes! that's working) it doesn't hide the start button

Public Class Form1
    Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Integer, ByVal hWndInsertAfter As Integer, ByVal x As Integer, ByVal y As Integer, ByVal cx As Integer, ByVal cy As Integer, ByVal wFlags As Integer) As Integer
    Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Integer
    Const SWP_HIDEWINDOW = &H80
    Const SWP_SHOWWINDOW = &H40
    Dim taskBar As Integer

Form Load
taskBar = FindWindow("Shell_traywnd", "")
Debug.Write(SetWindowPos(taskBar, 0&, 0&, 0&, 0&, 0&, SWP_HIDEWINDOW))

Close button
Debug.Write(SetWindowPos(taskBar, 0&, 0&, 0&, 0&, 0&, SWP_SHOWWINDOW))
	    End


#2 AceInfinity

AceInfinity

    CC Addict

  • Senior Member
  • PipPipPipPipPip
  • 313 posts

Posted 19 November 2012 - 12:02 AM

You're going to need some more code to hide the start orb, that's all. Don't expect just this one little bit of code to do it all lol. I don't see what the purpose of this thread was; what you're trying to get out of the replies. Are you trying to get help on how to programmatically hide the start orb? Or did you think that the code you have should have done it all and you're wondering why it isn't?

Microsoft MVP (2012) - .NET Programming | ®Crestron DMC-T Certified Programmer
Posted Image


#3 Korlando

Korlando

    CC Regular

  • Member
  • PipPipPip
  • 44 posts

Posted 30 November 2012 - 08:07 AM

You're going to need some more code to hide the start orb, that's all. Don't expect just this one little bit of code to do it all lol. I don't see what the purpose of this thread was; what you're trying to get out of the replies. Are you trying to get help on how to programmatically hide the start orb? Or did you think that the code you have should have done it all and you're wondering why it isn't?

To be honest. I have not idea how to hide the start icon. I have put the code here and my problem hoping that someone will give me a clue or something that will help me. Actually, the main problem was to hide the taskbar with the icon. I have almost my problem, but i stucked here and I need help. All kind of help

#4 manhunt

manhunt

    CC Lurker

  • New Member
  • Pip
  • 3 posts

Posted 25 December 2012 - 03:16 PM

To be honest. I have not idea how to hide the start icon. I have put the code here and my problem hoping that someone will give me a clue or something that will help me. Actually, the main problem was to hide the taskbar with the icon. I have almost my problem, but i stucked here and I need help. All kind of help


I have the solution,
I use this code to hide and show the taskbar and the Start button,
but do not change the code will not work. :biggrin:

Imports System.Runtime.InteropServices
Public Class Form1
<DllImport("user32.dll")>
Private Shared Function FindWindow(className As String, windowText As String) As IntPtr
End Function
<DllImport("user32.dll")>
Private Shared Function ShowWindow(hwnd As IntPtr, command As Integer) As Boolean
End Function
Private Const SW_HIDE As Integer = 0
Private Const SW_SHOW As Integer = 1

Public Function HideStartButton() As Boolean
	 Dim retval = False
	 HideTaskBar()
	 Dim hwndStartButton = FindWindow("Button", "Start")
	 If hwndStartButton <> IntPtr.Zero Then
		 retval = ShowWindow(hwndStartButton, SW_HIDE)
	 End If
	 Return retval
End Function
Public Function HideTaskBar() As Boolean
	 Dim retval = False
	 Dim hwndTaskBar = FindWindow("Shell_TrayWnd", "")
	 If hwndTaskBar <> IntPtr.Zero Then
		 retval = ShowWindow(hwndTaskBar, SW_HIDE)
	 End If
	 Return retval
End Function
Public Function ShowStartButton() As Boolean
	 Dim retval1 = False
	 ShowHideTaskBar()
	 Dim hwndstartbutton = FindWindow("Button", "Start")
	 If hwndstartbutton <> IntPtr.Zero Then
		 retval1 = ShowWindow(hwndstartbutton, SW_SHOW)
	 End If
	 Return retval1
End Function
Public Function ShowHideTaskBar() As Boolean
	 Dim retval2 = False
	 Dim hwndTaskBar = FindWindow("Shell_TrayWnd", "")
	 If hwndTaskBar <> IntPtr.Zero Then
		 retval2 = ShowWindow(hwndTaskBar, SW_SHOW)
	 End If
	 Return retval2
End Function
Private Sub Form1_Load(sender As Object, e As System.EventArgs) Handles Me.Load
	 Button1.Text = "Nascondi"
	 Button2.Text = "Visualizza"
End Sub
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
	 HideTaskBar()
	 HideStartButton()
End Sub
Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click
	 ShowHideTaskBar()
	 ShowStartButton()
End Sub
End Class


#5 AceInfinity

AceInfinity

    CC Addict

  • Senior Member
  • PipPipPipPipPip
  • 313 posts

Posted 26 December 2012 - 07:03 AM

I have the solution,
I use this code to hide and show the taskbar and the Start button,
but do not change the code will not work. :biggrin:

Imports System.Runtime.InteropServices
Public Class Form1
<DllImport("user32.dll")>
Private Shared Function FindWindow(className As String, windowText As String) As IntPtr
End Function
<DllImport("user32.dll")>
Private Shared Function ShowWindow(hwnd As IntPtr, command As Integer) As Boolean
End Function
Private Const SW_HIDE As Integer = 0
Private Const SW_SHOW As Integer = 1

Public Function HideStartButton() As Boolean
     Dim retval = False
     HideTaskBar()
     Dim hwndStartButton = FindWindow("Button", "Start")
     If hwndStartButton <> IntPtr.Zero Then
         retval = ShowWindow(hwndStartButton, SW_HIDE)
     End If
     Return retval
End Function
Public Function HideTaskBar() As Boolean
     Dim retval = False
     Dim hwndTaskBar = FindWindow("Shell_TrayWnd", "")
     If hwndTaskBar <> IntPtr.Zero Then
         retval = ShowWindow(hwndTaskBar, SW_HIDE)
     End If
     Return retval
End Function
Public Function ShowStartButton() As Boolean
     Dim retval1 = False
     ShowHideTaskBar()
     Dim hwndstartbutton = FindWindow("Button", "Start")
     If hwndstartbutton <> IntPtr.Zero Then
         retval1 = ShowWindow(hwndstartbutton, SW_SHOW)
     End If
     Return retval1
End Function
Public Function ShowHideTaskBar() As Boolean
     Dim retval2 = False
     Dim hwndTaskBar = FindWindow("Shell_TrayWnd", "")
     If hwndTaskBar <> IntPtr.Zero Then
         retval2 = ShowWindow(hwndTaskBar, SW_SHOW)
     End If
     Return retval2
End Function
Private Sub Form1_Load(sender As Object, e As System.EventArgs) Handles Me.Load
     Button1.Text = "Nascondi"
     Button2.Text = "Visualizza"
End Sub
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
     HideTaskBar()
     HideStartButton()
End Sub
Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click
     ShowHideTaskBar()
     ShowStartButton()
End Sub
End Class


I can see a few things that he would probably have to change in there, if he wants it to work in his application. Making changes isn't bad if you know what you're doing. And this code will work still if he changed certain things here, I wouldn't say that it won't work if he were to change anything though because that's wrong.

Microsoft MVP (2012) - .NET Programming | ®Crestron DMC-T Certified Programmer
Posted Image


#6 manhunt

manhunt

    CC Lurker

  • New Member
  • Pip
  • 3 posts

Posted 27 December 2012 - 05:25 AM

This code I modified several times, but if you just want to hide the start button the code does not work but if you hide the taskbar and the Start button works, I tested it personally, I am using it to create my own program it works fine, however I hope it is useful and of course the best or if you make changes and you want to share are welcome. :)

#7 Korlando

Korlando

    CC Regular

  • Member
  • PipPipPip
  • 44 posts

Posted 01 January 2013 - 08:00 AM

Manhunt you are the best!!! Honestly.
Ok now, my problem is solved so moderators can put a "solved" on this topic

#8 Orjan

Orjan

    CC Mentor

  • Moderator
  • 2918 posts

Posted 01 January 2013 - 08:26 AM

This topic has been marked as SOLVED. If you have a similar question or topic, you can go back to the subforum and start a new topic to continue discussions.

I'm a System developer at XLENT Consultant Group mainly working with SugarCRM.
Please DO NOT send mail or PM to me with programming questions, post them in the appropriate forum instead, where I and others can answer you.





Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download