在9X和在2000/XP中有不同吗?如何分别实现,请教了。
--------------用下面这种方法后说“找不到DLL入口点-----------------
Option ExplicitPrivate Declare Function GetCurrentProcessId Lib "kernel32" () As LongPrivate Declare Function GetCurrentProcess Lib "kernel32" () As LongPrivate Declare Function RegisterServiceProcess Lib "kernel32" (ByVal dwProcessID As Long, ByVal dwType As Long) As LongPrivate Const RSP_SIMPLE_SERVICE = 1Private Const RSP_UNREGISTER_SERVICE = 0 Private Sub MakeMeService() Dim pid As Long Dim reserv As Long pid = GetCurrentProcessId() RegisterServiceProcess pid, RSP_SIMPLE_SERVICEEnd Sub Private Sub UnMakeMeService() Dim pid As Long Dim reserv As Long pid = GetCurrentProcessId() RegisterServiceProcess pid, RSP_UNREGISTER_SERVICEEnd Sub Private Sub Command1_Click() Call MakeMeService 'ʹ´°¿ÚÒþ²ØEnd Sub Private Sub Command2_Click() Call UnMakeMeService 'ʹ´°¿ÚÏÔʾEnd Sub
-------------------------------------------
--------------用下面这种方法后说“找不到DLL入口点-----------------
Option ExplicitPrivate Declare Function GetCurrentProcessId Lib "kernel32" () As LongPrivate Declare Function GetCurrentProcess Lib "kernel32" () As LongPrivate Declare Function RegisterServiceProcess Lib "kernel32" (ByVal dwProcessID As Long, ByVal dwType As Long) As LongPrivate Const RSP_SIMPLE_SERVICE = 1Private Const RSP_UNREGISTER_SERVICE = 0 Private Sub MakeMeService() Dim pid As Long Dim reserv As Long pid = GetCurrentProcessId() RegisterServiceProcess pid, RSP_SIMPLE_SERVICEEnd Sub Private Sub UnMakeMeService() Dim pid As Long Dim reserv As Long pid = GetCurrentProcessId() RegisterServiceProcess pid, RSP_UNREGISTER_SERVICEEnd Sub Private Sub Command1_Click() Call MakeMeService 'ʹ´°¿ÚÒþ²ØEnd Sub Private Sub Command2_Click() Call UnMakeMeService 'ʹ´°¿ÚÏÔʾEnd Sub
-------------------------------------------
解决方案 »
- 是真的吗?ADODC 只能支持千余条查询结果???
- ListBox 中添加的数据大于 32767时怎么办 ???
- word操作题实现自动评分时,一题都没做,却可得到12分。请帮我看看错哪儿了,我的时间不多了,要交了。
- VB连接远程数据库后,一直连着,过1,2个小时连接就会断开(但State还是1)
- 如何从如a123ch34jj中得到第一个数值123?
- 请教:鼠标拖拽和搜索的综合问题??
- vb窗体隐藏后重新show
- 那位大虾能帮我写个完整的VB查询程序,具体内容无所谓
- 热烈欢迎大家帮我解决一个问题:制作一个报表!(方法要精简才行!)
- 急需BMP转换为JPG的原代码!!相关资料介绍也需要!
- 请问vb中生成随机数的涵数是什么
- 求救!!!!adodc 删除数据库记录出问题
使用 Findwindow API 查找"关闭程序"对话框或者"任务管理器"的句柄,然后Sendmessage API 发送 WM_CLOSE 消息即可.
把这个过程放在一个计时器过程中,间隔为1即可.这样用户按下Ctrl+Alt+Del后"关闭程序"对话框或者"任务管理器"立刻被关闭.
Sub DisableCtrlAltDelete(bDisbaled as boolean)
dim x as long
x=SystemParametersInfo(97,bDisabled,CStr(1),0)
End Sub
然后在你想禁用这三个键的地方加上一句代码
DisableCtrlAltDelete(true)就可以了
但要记得在程序结束时加上:
DisableCtrlAltDelete(false)
不然就以前做的一个屏保用到了(我把鼠标限制在一个区域中,然后禁用那三个键,嘿~~没密码就只有重启,如果你愿意的话还可以改一下注册表,使程序在98运行时就加载,那样重启后别人也没办法动你的电脑)
HKEY_LOCAL_MACHINE\Software\Microsoft\WindowsNT\CurrentVersion\WinLogon
http://www.8421.org/download.php?id=163
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
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 Const WM_CLOSE = &H10'在窗体上放置一个Timer1,Interval为1
Private Sub Timer1_Timer()
CloseWin
End SubPrivate Sub CloseWin()
Dim ihWnd As Long '定义一个句柄长整变量
ihWnd = FindWindow(vbNullString, "关闭程序") '查找关闭程序对话框
If ihWnd = 0 Then Exit Sub '如果对话框不存在(hwnd为0)则跳过下面的动作
SendMessage ihWnd, WM_CLOSE, &H0, &H0 '关闭对话框
End Sub