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 2 5436
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
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 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
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...
|
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...
|
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
|
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...
|
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 =...
|
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...
|
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...
|
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...
|
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...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |