home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form frmMain
- BackColor = &H00000000&
- BorderStyle = 0 'None
- Caption = "Screen Tester"
- ClientHeight = 7200
- ClientLeft = 915
- ClientTop = 2790
- ClientWidth = 9600
- Height = 7605
- Icon = FRMMAIN.FRX:0000
- KeyPreview = -1 'True
- Left = 855
- LinkTopic = "Form1"
- MaxButton = 0 'False
- ScaleHeight = 7200
- ScaleWidth = 9600
- Top = 2445
- Width = 9720
- Option Explicit
- Sub Form_KeyDown (KeyCode As Integer, Shift As Integer)
- ' Move form around by keyboard -- Exit program on ALT-F4
- Select Case KeyCode
- Case KEY_HOME
- Me.Top = 0
- Me.Left = 0
- Case KEY_LEFT, KEY_UP, KEY_RIGHT, KEY_DOWN
- MoveForm Me
- Case KEY_F4
- If Shift = ALT_MASK Then
- ExitProgram
- End If
- Case Else
- '
- ' Do Nothing
- '
- End Select
- End Sub
- Sub Form_Load ()
- SetUpForm Me, "Main"
- End Sub
- Sub Form_MouseDown (Button As Integer, Shift As Integer, X As Single, Y As Single)
- Dim uPoint As POINTAPI
- Dim uConvert As ConvertPOINTAPI
- Dim r As Integer
- If Button = KEY_LBUTTON Then
- '
- ' Move Window on Left Mouse Down
- '
- ' Further information on this method is available in the following
- ' Microsoft Knowledge Base article.
- '
- ' How to Move a Form that Has No Titlebar or Caption
- ' Article ID: Q114593
- '
- Call GetCursorPos(uPoint)
- LSet uConvert = uPoint
- '
- ' Send LButtonUp to finish the impending LButtonDown.
- ' This line of code will invoke the Form_MouseUp() event,
- ' so be careful what code you place in that event
- '
- r = SendmessageByNum(Me.hWnd, WM_LBUTTONUP, 0, uConvert.xy)
- '
- ' Now tell the form someone is clicking the window caption
- '
- r = SendmessageByNum(Me.hWnd, WM_SYSCOMMAND, MOUSE_MOVE, uConvert.xy)
- '
- ' Save position for .INI file after move is completed
- '
- SaveScreenPosition
- ElseIf Button = KEY_RBUTTON Then
- '
- ' Popup menu on Right Mouse Down
- '
- frmUtility.PopupMenu frmUtility.mnuPopup
- End If
- End Sub
- Sub Form_QueryUnload (Cancel As Integer, UnloadMode As Integer)
- ' Insure clean exit when unload is generated from outside of the program
- If UnloadMode <> 1 Then
- ExitProgram
- End If
- End Sub
-