|
-
Feb 18th, 2001, 12:20 PM
#1
Thread Starter
Junior Member
1. How can I hide the clock from win98 taskbar?
2. How can I disable the win98 boot keys? (on startup F8 displays... Runin' in Safe mode........ Command prompt only)
3. How can i Close an application from my program?
4. How can my program display a message (performing an action like 3.) when another app is runing and it is minimized in the taskbar?
I have another problems
4.1.) how can I disable the windowkey+e(for example, which opens the Windows Explorer)?
4.2) How can I hide the icons on desktop or all the desktop content?
4.3) How can I restrict a user to right in the internet explorer address bar c:\ or a path on a local drive?
i want the user to write only "www."
4.4)How can I disable the users to restrict the access to some dirs on the local drives??? or restrict the user to write or delete on the drives???
THANK YOU VERY MUCH
Last edited by alexandru; Feb 20th, 2001 at 12:01 PM.
This is little' oh me mister don't give a ... still won't bleed
EmInEm
-
Feb 18th, 2001, 01:01 PM
#2
to close a program:
Code:
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Declare Function DestroyWindow Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Private Const WM_CLOSE = &H10
Private Sub Command1_Click()
Dim hApp As Long
'Find Calculator
hApp = FindWindowEx(0, 0, "SciCalc", "Calculator")
'Close it if it's found
If hApp <> 0 Then
SendMessage hApp, WM_CLOSE, 0, 0
DestroyWindow hApp
End If
End Sub
-
Feb 18th, 2001, 01:04 PM
#3
To do an action when a program is minimized
Code:
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Private Declare Function IsIconic Lib "user32" (ByVal hwnd As Long) As Long
Private Sub Command1_Click()
Dim hApp As Long
hApp = FindWindowEx(0, 0, "SciCalc", "Calculator")
If hApp <> 0 Then If IsIconic(hApp) Then MsgBox "It's minimized"
End Sub
-
Feb 18th, 2001, 01:10 PM
#4
To hide the clock
Code:
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Private Sub Command1_Click()
Dim hClock As Long
hClock = FindWindowEx(FindWindowEx(FindWindowEx(0, 0, "Shell_TrayWnd", vbNullString), 0, "TrayNotifyWnd", vbullstring), 0, "TrayClockWClass", vbNullString)
If hClock <> 0 Then ShowWindow hClock, 1
End Sub
And no, you cannot disable the bootkeys using VB.
There! your 4 questions answered!
-
Feb 19th, 2001, 04:20 AM
#5
Yes you can, just not directly. There is a flag in the msdos.sys hidden file that determines if this works or not. Im not sure, but i think its the bootmulti one. Use a program that disables it then look at this file. You will see the flag. The last program i saw do this was Tweak UI. You might already have it. It would be the work of a marginal programmer to change the values in this file.
Keep in mind that it is still possible to enter safe mode. If they reset the computer in the middle of boot-up, they will enter safe mode next time.
ps the key has been moved to the ctrl key in win me.
I'll get exact details on the flag, and post it later.
Last edited by Lord Orwell; Feb 19th, 2001 at 04:31 AM.
-
Feb 19th, 2001, 04:50 AM
#6
Ok, here is how you can disable the keys.
Add the following line (or modify it)
BootDelay=0
This will give the user 0 seconds to press a key, such as f8
In case the computer wants to automatically boot into safe mode, you put this flag:
BootMenuDefault=1
Chooses the "Normal Boot-up" option.
You should use the .ini api calls to prevent errors due to unicode.
(edited to correct spelling $8^D)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|