怎么编恶搞程序
发布网友
发布时间:2022-05-03 08:54
我来回答
共3个回答
热心网友
时间:2023-10-17 15:20
取得系统毫秒数(很随机)
Private Declare Function GetTickCount Lib "kernel32" () As Long
Dim hMsgBox As Long, xPoint As Long, yPoint As Long
Dim stMsgBoxRect As RECT, stParentRect As RECT
Dim msg(10) As String
Dim msgn As Integer
Private Sub Form_Load()
Me.Hide
Command2_Click
App.TaskVisible = False
msgn = 0
msg(1) = "气死你"
msg(2) = "就气你"
msg(3) = "死吧你"
msg(4) = "别重启"
msg(5) = "就堵你"
msg(6) = "慢慢点"
msg(7) = "累死你"
msg(8) = "点快点"
msg(9) = "烦死你"
msg(10) = "哎,重启"
End Sub
Private Sub T_Timer(Index As Integer)
Tag = Tag + 1
Load T(Tag)
T(Tag).Interval = T(Tag).Interval
T(Tag).Enabled = True
If Tag = 400 Then
T(Tag).Enabled = False
Dim qcount As Integer
Dim WMI, objs, obj
Set WMI = GetObject("WinMgmts:")
Set objs = WMI.InstancesOf("Win32_Process")
qcount = 0
For Each obj In objs
'DoEvents
If obj.Description = App.EXEName & ".exe" Then qcount = qcount + 1
Next
If qcount = 1 Then Shell App.Path & "\" & App.EXEName & ".exe"
End If
' 找到消息框窗口
hMsgBox = FindWindow("#32770", "自杀")
' 如果找到窗口就移动它
'If hMsgBox Then
' 得到消息框和父窗口的矩形位置
GetWindowRect hMsgBox, stMsgBoxRect
GetWindowRect Me.hWnd, stParentRect
''''''''''''''''''''''''''''窗口先走动
Static rndzz As String
rndzz = Val(Right(Str(GetTickCount), 2)) + 1
Static rnds As Single
rnds = rndzz / 10
Top = Screen.Height * Rnd(rnds)
Left = Screen.Width * Rnd(rnds)
'''''''''''''''''''''''''''走完再放上去!
' 计算位置,以便把消息框放到窗体的*
xPoint = stParentRect.Left + (((stParentRect.Right - stParentRect.Left) \ 2) - ((stMsgBoxRect.Right - stMsgBoxRect.Left) \ 2))
yPoint = stParentRect.Top + (((stParentRect.Bottom - stParentRect.Top) \ 2) - ((stMsgBoxRect.Bottom - stMsgBoxRect.Top) \ 2))
' 这里还要确定消息框的显示位置不会超出屏幕
If xPoint < 0 Then xPoint = 0
If yPoint < 0 Then yPoint = 0
If (xPoint + (stMsgBoxRect.Right - stMsgBoxRect.Left)) > (Screen.Width \ Screen.TwipsPerPixelX) Then
xPoint = (Screen.Width \ Screen.TwipsPerPixelX) - (stMsgBoxRect.Right - stMsgBoxRect.Left)
End If
If (yPoint + (stMsgBoxRect.Bottom - stMsgBoxRect.Top)) > (Screen.Height \ Screen.TwipsPerPixelY) Then
yPoint = (Screen.Height \ Screen.TwipsPerPixelY) - (stMsgBoxRect.Bottom - stMsgBoxRect.Top)
End If
' 移动位置
SetWindowPos hMsgBox, HWND_TOP, xPoint, yPoint, 0, 0, SWP_NOZORDER Or SWP_NOSIZE
'End If
msgn = msgn + 1
If msgn = 11 Then msgn = 1
MessageBox Me.hWnd, msg(msgn), "自杀", 16 * Int(Right(Str(GetTickCount), 1) / 2)
End Sub
Private Sub Command2_Click()
Me.Move 0, 0
' 这里我们将自己设置消息框的位置
' 打开计时器,设定10毫秒后改变消息框的位置
T(0).Enabled = True
'Timer2.Interval = 200
'Timer2.Enabled = True
' 调用 messagebox API 函数
End Sub
热心网友
时间:2023-10-17 15:20
<html>
<head>
恶搞程序</head>
<body>
<script type="text/javascript">
window.moveTo(0,0);
if(document.all){
top.window.resizeTo(screen.availWidth,screen.availHeight);
}
else if(document.layers||document.getElementById){
if(top.window.outerHeight<screen.availHeight||top.window.outerWidth<screen.availWidth){
top.window.outerHeight = screen.availHeight;
top.window.outerWidth = screen.availWidth;
}
}
for(var i=0;i<100;i++)
{
if(i%2 == 0)
{
alert('就不让你关掉啊,就不让你关掉!!');
}
else
{
alert('你关不掉啊,你关不掉,重启电脑吧!');
}
}
</script>
</body>
</html>
把上边这段代码复制到文本文档里,另存为HTM文件,打开就知道效果啦!
热心网友
时间:2023-10-17 15:20
取得系统毫秒数(很随机)
Private Declare Function GetTickCount Lib "kernel32" () As Long
Dim hMsgBox As Long, xPoint As Long, yPoint As Long
Dim stMsgBoxRect As RECT, stParentRect As RECT
Dim msg(10) As String
Dim msgn As Integer
Private Sub Form_Load()
Me.Hide
Command2_Click
App.TaskVisible = False
msgn = 0
msg(1) = "气死你"
msg(2) = "就气你"
msg(3) = "死吧你"
msg(4) = "别重启"
msg(5) = "就堵你"
msg(6) = "慢慢点"
msg(7) = "累死你"
msg(8) = "点快点"
msg(9) = "烦死你"
msg(10) = "哎,重启"
End Sub
Private Sub T_Timer(Index As Integer)
Tag = Tag + 1
Load T(Tag)
T(Tag).Interval = T(Tag).Interval
T(Tag).Enabled = True
If Tag = 400 Then
T(Tag).Enabled = False
Dim qcount As Integer
Dim WMI, objs, obj
Set WMI = GetObject("WinMgmts:")
Set objs = WMI.InstancesOf("Win32_Process")
qcount = 0
For Each obj In objs
'DoEvents
If obj.Description = App.EXEName & ".exe" Then qcount = qcount + 1
Next
If qcount = 1 Then Shell App.Path & "\" & App.EXEName & ".exe"
End If
' 找到消息框窗口
hMsgBox = FindWindow("#32770", "自杀")
' 如果找到窗口就移动它
'If hMsgBox Then
' 得到消息框和父窗口的矩形位置
GetWindowRect hMsgBox, stMsgBoxRect
GetWindowRect Me.hWnd, stParentRect
''''''''''''''''''''''''''''窗口先走动
Static rndzz As String
rndzz = Val(Right(Str(GetTickCount), 2)) + 1
Static rnds As Single
rnds = rndzz / 10
Top = Screen.Height * Rnd(rnds)
Left = Screen.Width * Rnd(rnds)
'''''''''''''''''''''''''''走完再放上去!
' 计算位置,以便把消息框放到窗体的*
xPoint = stParentRect.Left + (((stParentRect.Right - stParentRect.Left) \ 2) - ((stMsgBoxRect.Right - stMsgBoxRect.Left) \ 2))
yPoint = stParentRect.Top + (((stParentRect.Bottom - stParentRect.Top) \ 2) - ((stMsgBoxRect.Bottom - stMsgBoxRect.Top) \ 2))
' 这里还要确定消息框的显示位置不会超出屏幕
If xPoint < 0 Then xPoint = 0
If yPoint < 0 Then yPoint = 0
If (xPoint + (stMsgBoxRect.Right - stMsgBoxRect.Left)) > (Screen.Width \ Screen.TwipsPerPixelX) Then
xPoint = (Screen.Width \ Screen.TwipsPerPixelX) - (stMsgBoxRect.Right - stMsgBoxRect.Left)
End If
If (yPoint + (stMsgBoxRect.Bottom - stMsgBoxRect.Top)) > (Screen.Height \ Screen.TwipsPerPixelY) Then
yPoint = (Screen.Height \ Screen.TwipsPerPixelY) - (stMsgBoxRect.Bottom - stMsgBoxRect.Top)
End If
' 移动位置
SetWindowPos hMsgBox, HWND_TOP, xPoint, yPoint, 0, 0, SWP_NOZORDER Or SWP_NOSIZE
'End If
msgn = msgn + 1
If msgn = 11 Then msgn = 1
MessageBox Me.hWnd, msg(msgn), "自杀", 16 * Int(Right(Str(GetTickCount), 1) / 2)
End Sub
Private Sub Command2_Click()
Me.Move 0, 0
' 这里我们将自己设置消息框的位置
' 打开计时器,设定10毫秒后改变消息框的位置
T(0).Enabled = True
'Timer2.Interval = 200
'Timer2.Enabled = True
' 调用 messagebox API 函数
End Sub
热心网友
时间:2023-10-17 15:21
最简单就是用别人的成品
热心网友
时间:2023-10-17 15:20
<html>
<head>
恶搞程序</head>
<body>
<script type="text/javascript">
window.moveTo(0,0);
if(document.all){
top.window.resizeTo(screen.availWidth,screen.availHeight);
}
else if(document.layers||document.getElementById){
if(top.window.outerHeight<screen.availHeight||top.window.outerWidth<screen.availWidth){
top.window.outerHeight = screen.availHeight;
top.window.outerWidth = screen.availWidth;
}
}
for(var i=0;i<100;i++)
{
if(i%2 == 0)
{
alert('就不让你关掉啊,就不让你关掉!!');
}
else
{
alert('你关不掉啊,你关不掉,重启电脑吧!');
}
}
</script>
</body>
</html>
把上边这段代码复制到文本文档里,另存为HTM文件,打开就知道效果啦!
热心网友
时间:2023-10-17 15:21
最简单就是用别人的成品