VBGood网站全文搜索 Google

搜索VBGood全站网页(全文搜索)

VB爱好者乐园(VBGood)

 找回密码
 立即注册
搜索
查看: 4125|回复: 3

哪位大侠帮帮忙做一个禁止关机的程序

[复制链接]
 楼主| 发表于 2012-3-17 13:15:37 | 显示全部楼层 |阅读模式
一款网游,梦想世界,开虚拟机或者开5173网页都会自动关机,哪位大侠能帮忙做一款禁止程序自动关机的软件啊,谢谢了

点评

这个游戏就是限制5173,简单游这两个网页,现在又限制虚拟机,都是会自动关机,沙盘的话就会过2秒一检测,开沙盘了游戏就弹出对话框使用不友好软件,关闭游戏  发表于 2012-3-19 11:35
果断流氓,关机要看肿木关的 如果是秒关的话 估计拦不住。是使用out 64h,实现的  发表于 2012-3-18 01:44
游戏保护自身而已吧!防外挂,防破解,个人猜测!  发表于 2012-3-17 23:36
开网页也会自动关机!?!流氓软件……  发表于 2012-3-17 18:05
发表于 2012-3-17 22:25:22 | 显示全部楼层
模块部分
Public Declare Function SetWindowLong Lib "user32" _
Alias "SetWindowLongA" _
(ByVal hwnd As Long, _
ByVal nIndex As Long, _
ByVal dwNewLong As Long) _
As Long

Public Declare Function GetWindowLong Lib "user32" _
Alias "GetWindowLongA" _
(ByVal hwnd As Long, _
ByVal nIndex As Long) _
As Long

Public Declare Function CallWindowProc Lib "user32" _
Alias "CallWindowProcA" _
(ByVal lpPrevWndFunc As Long, _
ByVal hwnd As Long, _
ByVal Msg As Long, _
ByVal wParam As Long, _
ByVal lParam As Long) _
As Long  
Public Const GWL_WNDPROC = (-4)
Public Const WM_QUERYENDSESSION = &H11  

Public preWinProc As Long
Public m_AllowExit As Boolean

Public Function wndproc(ByVal hwnd As Long, ByVal Msg As Long, _
ByVal wParam As Long, ByVal lParam As Long) As Long

If (Msg = WM_QUERYENDSESSION) And (m_AllowExit = False) Then
Else
wndproc = CallWindowProc(preWinProc, hwnd, Msg, wParam, lParam)
End If
End Function

代码部分

Private Sub Form_Load()
Me.Option_Allow.Value = True
m_AllowExit = True
SubClass Me.hwnd
End Sub

Private Sub Form_Unload(Cancel As Integer)
EndSubClass Me.hwnd
End Sub

Private Sub Option_Allow_Click()
m_AllowExit = True
End Sub

Private Sub Option_NoAllow_Click()
m_AllowExit = False
End Sub

Private Sub SubClass(wnd As Long)
Dim ret As Long
'记录Window Procedure的地址
preWinProc = GetWindowLong(wnd, GWL_WNDPROC)
ret = SetWindowLong(wnd, GWL_WNDPROC, AddressOf wndproc)
End Sub

Private Sub EndSubClass(wnd As Long)
Dim ret As Long
ret = SetWindowLong(wnd, GWL_WNDPROC, preWinProc)
End Sub
试试看能不能用
回复 支持 反对

使用道具 举报

 楼主| 发表于 2012-3-19 11:32:50 | 显示全部楼层
呃,楼上大侠我是小白啊,下了个VB6.0但是不会用,你给的代码怎么做成EXE啊

点评

……那你会用什么  发表于 2012-3-19 18:31
回复 支持 反对

使用道具 举报

 楼主| 发表于 2012-3-19 20:53:10 | 显示全部楼层
我目前只会玩游戏但是我有学习的精神,需要引路老师一名
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

文字版|手机版|小黑屋|VBGood  

GMT+8, 2020-6-1 23:34

VB爱好者乐园(VBGood)
快速回复 返回顶部 返回列表