473,320 Members | 1,879 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Lock taskbar & Start button

I'm trying to write a program that will lock down the system. I want to
hide the start button and taskbar. I found code using ShowWindow &
FindWindow but they fail to work.

Butttonhwnd = FindWindow("Shell_TrayWnd", "")
Butttonhwnd = FindWindowEx(Butttonhwnd, 0, "Button", Nothing)
ShowWindow(Butttonhwnd, BUT_HIDE)

Anyone have any idea on how to this?

Chris
Nov 21 '05 #1
2 2055
Start a new Windows application & add 3 buttons to it

Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal
lpClassName As String, ByVal lpWindowName As String) As Integer
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

Public Const SWP_HIDEWINDOW = &H80
Public Const SWP_SHOWWINDOW = &H40

Private Sub btnShow_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnShow.Click
ShowTaskBar()
End Sub

Private Sub btnHide_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnHide.Click
HideTaskBar()
End Sub

Public Sub ShowTaskBar()
Dim intReturn As Integer = FindWindow("Shell_traywnd", "")
SetWindowPos(intReturn, 0, 0, 0, 0, 0, SWP_SHOWWINDOW)
End Sub

Public Sub HideTaskBar()
Dim intReturn As Integer = FindWindow("Shell_traywnd", "")
SetWindowPos(intReturn, 0, 0, 0, 0, 0, SWP_HIDEWINDOW)
End Sub

Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnExit.Click
ShowTaskBar()
Application.Exit()
End Sub

Private Sub frmTaskbar_Closing(ByVal sender As Object, ByVal e As
System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
ShowTaskBar()
End Sub

------------------------------

I have called my form 'frmTaskbar'

Button 1 = btnShow
Button 2 = btnHide
Button 3 = Exit

---------------------------------------------

On form closing I have called showtaskbar because I you don't want it
invisible when you close the application.

I hope this helps

Nov 21 '05 #2
Thanks, worked perfect....

Chris

"Crouchie1998" <Cr**********@discussions.microsoft.com> wrote in message
news:82**********************************@microsof t.com...
Start a new Windows application & add 3 buttons to it

Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal
lpClassName As String, ByVal lpWindowName As String) As Integer
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

Public Const SWP_HIDEWINDOW = &H80
Public Const SWP_SHOWWINDOW = &H40

Private Sub btnShow_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnShow.Click
ShowTaskBar()
End Sub

Private Sub btnHide_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnHide.Click
HideTaskBar()
End Sub

Public Sub ShowTaskBar()
Dim intReturn As Integer = FindWindow("Shell_traywnd", "")
SetWindowPos(intReturn, 0, 0, 0, 0, 0, SWP_SHOWWINDOW)
End Sub

Public Sub HideTaskBar()
Dim intReturn As Integer = FindWindow("Shell_traywnd", "")
SetWindowPos(intReturn, 0, 0, 0, 0, 0, SWP_HIDEWINDOW)
End Sub

Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnExit.Click
ShowTaskBar()
Application.Exit()
End Sub

Private Sub frmTaskbar_Closing(ByVal sender As Object, ByVal e As
System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
ShowTaskBar()
End Sub

------------------------------

I have called my form 'frmTaskbar'

Button 1 = btnShow
Button 2 = btnHide
Button 3 = Exit

---------------------------------------------

On form closing I have called showtaskbar because I you don't want it
invisible when you close the application.

I hope this helps

Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: fc | last post by:
hi, i'm having a problem using C#'s lock and windows2000's text to speech (vtext.dll) ... basically it looks like the callback from the TTS is violating C#'s lock, which looks very very...
0
by: Kim Würtz | last post by:
Hi everybody I have a mission critical application, so I don't want the user to be able to start other apps on the PC like internet explorer etc. Therefore I want to hide the start button as...
2
by: news.microsoft.com | last post by:
I'm trying to write a program that will lock down the system. I want to hide the start button and taskbar. I found code using ShowWindow & FindWindow but they fail to work. Butttonhwnd =...
7
by: jjmraz | last post by:
Hi, How can I lock down the desktop stopping end user from getting to desktop when inside my app until they quit app? Also how can I start another app from my app? Thanks, JJ
2
by: JohnProgrammer | last post by:
I know I can fill the screen in VB.NET by starting my window maximized and without a border. My question is; in VB.NET is there a way to enable/disable the taskbar much like doing the "always on...
2
by: hohrin | last post by:
Hopefully someone here will be able to point me in the right direction. In my C# application I have several forms which get a taskbar button when open. These buttons appear correctly with...
6
by: Peted | last post by:
Hi wondering what is the best way to do this Need a user to click a button, that sends 3 or 4 string based commands via a TCP/ip socket link I can connect to the ip device no problems, am...
4
by: Hutch | last post by:
I also un-checked all of the check boxes in the database's Startup options menu. I then added a button to the form so that the user can close the database, and another button so that the form can...
0
by: bz | last post by:
Hi, I need an app to run in kiosk mode, so user will not have access to start menu and taskbar while the app is running I was able to hide / show the taskbar with trhe following code when app...
10
by: Mark Rae [MVP] | last post by:
Hi, This is really just a theoretical question for my own interest, and not for any nefarious purpose... :-) Say we have three applications running - Notepad, Wordpad and Excel - and each...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.