Histacom/windows 95/windows98messagebox.vb

158 lines
6.3 KiB
VB.net
Raw Permalink Normal View History

2015-03-01 05:50:24 -05:00
Public Class windows98messagebox
Dim chosenx As Integer
Dim choseny As Integer
Dim desktopx As Integer
Dim desktopy As Integer
Dim yran As New Random
Dim xran As New Random
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Me.Close()
End Sub
Private Sub windows98messagebox_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Me.Hide()
Label1.Hide()
Label2.Hide()
desktopy = Windows2000.desktopicons.Size.Height
desktopx = Windows2000.desktopicons.Size.Width
Timer1.Start()
Timer2.Start()
Timer3.Start()
look.Start()
If My.Resources.windows_98_error_sound.CanRead Then
Dim bStr(My.Resources.windows_98_error_sound.Length) As Byte
My.Resources.windows_98_error_sound.Read(bStr, 0, My.Resources.windows_98_error_sound.Length)
My.Computer.Audio.Play(bStr, AudioPlayMode.Background)
End If
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
choseny = yran.Next(1, desktopy)
End Sub
Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
chosenx = xran.Next(1, desktopx)
End Sub
Private Sub Timer3_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer3.Tick
Me.Show()
Label1.Text = chosenx
Label2.Text = choseny
Me.Location = New Point(Label1.Text, Label2.Text)
Timer3.Stop()
End Sub
Dim moveable As Boolean = True
Dim mexlocation, meylocation As Integer
Dim mewidth, meheight As Integer
Dim maximize As Boolean
Private Sub programtopbar_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles programtopbar.MouseDown
2015-03-07 14:48:26 -05:00
If moveable Then
2015-03-01 05:50:24 -05:00
If e.Button = MouseButtons.Left Then
programtopbar.Capture = False
Const WM_NCLBUTTONDOWN As Integer = &HA1S
Const HTCAPTION As Integer = 2
Dim msg As Message = _
Message.Create(Me.Handle, WM_NCLBUTTONDOWN, _
New IntPtr(HTCAPTION), IntPtr.Zero)
Me.DefWndProc(msg)
End If
End If
End Sub
Private Sub closebutton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles closebutton.Click
Me.Close()
End Sub
Private Sub pullside_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles pullside.Tick
Me.Width = Cursor.Position.X - Me.Location.X
End Sub
Private Sub pullbottom_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles pullbottom.Tick
Me.Height = Cursor.Position.Y - Me.Location.Y
End Sub
Private Sub pullbs_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles pullbs.Tick
Me.Width = Cursor.Position.X - Me.Location.X
Me.Height = Cursor.Position.Y - Me.Location.Y
End Sub
Private Sub Rightpull_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles right.MouseDown
pullside.Start()
End Sub
Private Sub rightpull_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles right.MouseUp
pullside.Stop()
End Sub
Private Sub bottompull_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles bottom.MouseDown
pullbottom.Start()
End Sub
Private Sub buttompull_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles bottom.MouseUp
pullbottom.Stop()
End Sub
Private Sub bspull_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles bottomrightcorner.MouseDown
pullbs.Start()
End Sub
Private Sub bspull_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles bottomrightcorner.MouseUp
pullbs.Stop()
End Sub
Private Sub maximizebutton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles maximizebutton.Click
2015-03-07 14:48:26 -05:00
If Not maximize Then
2015-03-01 05:50:24 -05:00
meylocation = Windows98.desktopicons.Height - Me.Height
mexlocation = Windows98.desktopicons.Width - Me.Width
mewidth = Me.Width
meheight = Me.Height
toprightcorner.Hide()
topleftcorner.Hide()
bottomrightcorner.Hide()
bottomleftcorner.Hide()
left.Hide()
top.Hide()
bottom.Hide()
right.Hide()
Dim w, h As Integer
w = Windows98.desktopicons.Width
h = Windows98.desktopicons.Height
Me.Location = New Point(0, 0)
Me.Size = New Size(w, h)
moveable = False
maximizebutton.Image = My.Resources.unmaximizebutton
maximize = True
Else
toprightcorner.Show()
topleftcorner.Show()
bottomrightcorner.Show()
bottomleftcorner.Show()
left.Show()
top.Show()
bottom.Show()
right.Show()
Me.Location = New Point(mexlocation, meylocation)
Me.Size = New Size(mewidth, meheight)
moveable = True
maximizebutton.Image = My.Resources.Maximize
maximize = False
End If
End Sub
Private Sub look_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles look.Tick
Me.programtopbar.BackColor = Windows98.exampleprogramtopbar.BackColor
Me.programtopbar.BackgroundImage = Windows98.exampleprogramtopbar.BackgroundImage
Me.programname.BackColor = Windows98.exampleprogramtext.BackColor
End Sub
Private Sub minimizebutton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles minimizebutton.Click
Me.Hide()
End Sub
Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Me.Close()
End Sub
End Class