API 系统锁定问题!

gqz 2003-08-22 10:17:14
加精
用VB API 将系统锁定就象按装驱动程序时的效果,还要锁定鼠标移动范围,望分开发表!
...全文
121 12 打赏 收藏 转发到动态 举报
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
myhfit 2003-08-30
  • 打赏
  • 举报
回复
要象网吧里一样的话简单
编个程序
盖住桌面
任务栏就用截屏再把任务栏的图像截下来显示
没发现网吧里的桌面啊,任务栏都是假的阿
还有个办法就是把Explorer这个进程Kill掉(开机之后的第一个不是我的电脑或资源管理器什么的,代表的就是系统)
这样就没桌面了
再读取图标什么的
就是模仿
屏蔽的话最主要的是屏蔽键
所以.....
看到了没有
机房里
都用98的
用SystemParamInfo搞定(屏蔽键)
我2年没用VB了
嘿嘿


Sean918 2003-08-29
  • 打赏
  • 举报
回复
2.锁定鼠标移动范围:
Private Type RECT
left As Long
top As Long
right As Long
bottom As Long
End Type
Private Type POINT
x As Long
y As Long
End Type
Private Declare Sub ClipCursor Lib "user32" (lpRect As Any)
Private Declare Sub GetClientRect Lib "user32" (ByVal hWnd As Long, lpRect As RECT)
Private Declare Sub ClientToScreen Lib "user32" (ByVal hWnd As Long, lpPoint As POINT)
Private Declare Sub OffsetRect Lib "user32" (lpRect As RECT, ByVal x As Long, ByVal y As Long)
Private Sub Form_Load()
Command1.Caption = "Limit Cursor Movement"
Command2.Caption = "Release Limit"
End Sub
Private Sub Command1_Click()
'Limits the Cursor movement to within the form.
Dim client As RECT
Dim upperleft As POINT
'Get information about our wndow
GetClientRect Me.hWnd, client
upperleft.x = client.left
upperleft.y = client.top
'Convert window coördinates to screen coördinates
ClientToScreen Me.hWnd, upperleft
'move our rectangle
OffsetRect client, upperleft.x, upperleft.y
'limit the cursor movement
ClipCursor client
End Sub
Private Sub Command2_Click()
'Releases the cursor limits
ClipCursor ByVal 0&
End Sub
Private Sub Form_Unload(Cancel As Integer)
'Releases the cursor limits
ClipCursor ByVal 0&
End Sub
Sean918 2003-08-29
  • 打赏
  • 举报
回复
1.将系统锁定就象按装驱动程序时的效果:
Option Explicit
Private Declare Function GetShellWindow Lib "user32" () As Long
Private Declare Function TerminateProcess Lib "kernel32" (ByVal hProcess As Long, ByVal uExitCode As Long) As Long
Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long
Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
Private Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hwnd As Long, lpdwProcessId As Long) As Long
Const PROCESS_TERMINATE = 1

Private Sub Command1_Click()
Dim hwnd, dwProcessId As Long, hProcess As Long

hwnd = GetShellWindow

GetWindowThreadProcessId hwnd, dwProcessId

hProcess = OpenProcess(PROCESS_TERMINATE, False, dwProcessId)

TerminateProcess hProcess, 1

CloseHandle hProcess

End Sub

Private Sub Command2_Click()
Shell "explorer.exe"
End Sub
niece 2003-08-29
  • 打赏
  • 举报
回复
我有把你邮箱留下
给你发过去
Kivic 2003-08-26
  • 打赏
  • 举报
回复
Const SPI_SCREENSAVERRUNNING = 97
Private Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, lpvParam As Any, ByVal fuWinIni As Long) As Long

Call SystemParametersInfo(SPI_SCREENSAVERRUNNING, True, pOld, 0)'锁定
Call SystemParametersInfo(SPI_SCREENSAVERRUNNING, False, pOld, 0)'解除
pigpag 2003-08-24
  • 打赏
  • 举报
回复
SetWindowsHook JournalRecord
ChenCCC 2003-08-24
  • 打赏
  • 举报
回复
把开始按纽隐藏掉,快速启动栏关掉,用程序屏蔽桌面
hxy2003 2003-08-23
  • 打赏
  • 举报
回复
锁住鼠标和sleep
gqz 2003-08-23
  • 打赏
  • 举报
回复
我要的锁系统后还能看到桌面的那种,就象网管软件一样的效果!
jlum99 2003-08-23
  • 打赏
  • 举报
回复
找找屏保相关的,会有发现
gqz 2003-08-22
  • 打赏
  • 举报
回复
那锁定系统的呢!
rainstormmaster 2003-08-22
  • 打赏
  • 举报
回复
控制鼠标移动范围用api函数ClipCursor:
【VB声明】
Private Declare Function ClipCursor Lib "user32" Alias "ClipCursor" (lpRect As Any) As Long

【说明】
将指针限制到指定区域。ClipCursorBynum是一个别名,允许我们清除以前设置的指针剪切区域

【返回值】
Long,非零表示成功,零表示失败。会设置GetLastError

【备注】
指针剪切后,按Ctrl+Alt+Del可简单的清除剪切区域

【参数表】
lpRect --------- RECT,指定一个矩形,用像素屏幕坐标系统表示。鼠标指针必须在这个区域内运动。如使用函数的ClipCursorBynum形式,则可将参数设为Long值,用它传递一个0,禁止指针剪切,恢复常规运作状态

1,486

社区成员

发帖
与我相关
我的任务
社区描述
VB API
社区管理员
  • API
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧