Version = 17 VersionRequired = 17 Checksum = -76320441 Begin Form RecordSelectors = NotDefault NavigationButtons = NotDefault DefaultView = 0 ScrollBars = 0 PictureAlignment = 2 DatasheetGridlinesBehavior = 3 GridX = 24 GridY = 24 DatasheetFontHeight = 10 ItemSuffix = 21 Left = 576 Top = 360 Right = 7536 Bottom = 3816 DatasheetGridlinesColor = 12632256 OnUnload ="[Event Procedure]" RecSrcDt = Begin 0xc5773b2059a0e140 End Caption ="Capture mouse position" DatasheetFontName ="Arial" OnClick ="[Event Procedure]" OnLoad ="[Event Procedure]" Begin Begin Label BackStyle = 0 End Begin CheckBox SpecialEffect = 2 LabelX = 230 LabelY = -30 End Begin TextBox SpecialEffect = 2 OldBorderStyle = 0 End Begin Section Height = 3708 BackColor = -2147483633 Name ="Detail" OnClick ="[Event Procedure]" Begin Begin TextBox Visible = NotDefault Enabled = NotDefault Locked = NotDefault OverlapFlags = 85 Left = 876 Top = 3252 Name ="Text0" OnClick ="[Event Procedure]" Begin Begin Label OverlapFlags = 85 Left = 312 Top = 3276 Width = 492 Height = 228 Name ="Label1" Caption ="delta:" End End End Begin TextBox Enabled = NotDefault Locked = NotDefault OverlapFlags = 93 Left = 1164 Width = 960 TabIndex = 1 Name ="Text2" OnClick ="[Event Procedure]" Begin Begin Label OverlapFlags = 93 Left = 528 Top = 12 Width = 492 Height = 228 Name ="Label3" Caption ="x:" End End End Begin TextBox Enabled = NotDefault Locked = NotDefault OverlapFlags = 93 Left = 2916 Width = 768 TabIndex = 2 Name ="Text4" OnClick ="[Event Procedure]" Begin Begin Label OverlapFlags = 85 Left = 2400 Width = 492 Height = 228 Name ="Label5" Caption ="y:" End End End Begin TextBox Enabled = NotDefault Locked = NotDefault OverlapFlags = 85 Left = 4716 Width = 684 TabIndex = 3 Name ="Text6" DefaultValue ="0" OnClick ="[Event Procedure]" Begin Begin Label OverlapFlags = 85 Left = 3876 Top = 12 Width = 624 Height = 228 Name ="Label7" Caption ="amount:" End End End Begin CheckBox Enabled = NotDefault Locked = NotDefault OverlapFlags = 85 Left = 5580 Top = 30 TabIndex = 4 Name ="Check8" Begin Begin Label OverlapFlags = 247 Left = 5810 Width = 600 Height = 228 Name ="Label9" Caption ="UP" End End End Begin CheckBox Enabled = NotDefault Locked = NotDefault OverlapFlags = 85 Left = 5580 Top = 342 TabIndex = 5 Name ="Check10" Begin Begin Label OverlapFlags = 247 Left = 5810 Top = 312 Width = 684 Height = 228 Name ="Label11" Caption ="DOWN" End End End Begin Label SpecialEffect = 2 OverlapFlags = 85 Left = 720 Top = 1524 Width = 5532 Height = 1632 FontSize = 10 Name ="Label12" Caption ="This form demonstrates the use of a callback function and the \"addrOf\" functio" "n to capture the position of the mouse at the time the wheel is moved. It also s" "hows UP or DOWN movement and the number of times the wheel was moved (approx). C" "licking on anything should reset the value to 0." OnClick ="[Event Procedure]" End Begin TextBox Enabled = NotDefault Locked = NotDefault OverlapFlags = 93 Left = 1164 Top = 552 Width = 960 TabIndex = 6 Name ="Text13" Begin Begin Label OverlapFlags = 93 Left = 528 Top = 564 Width = 492 Height = 228 Name ="Label14" Caption ="x:" End End End Begin TextBox Enabled = NotDefault Locked = NotDefault OverlapFlags = 85 Left = 2916 Top = 540 Width = 768 TabIndex = 7 Name ="Text15" Begin Begin Label OverlapFlags = 85 Left = 2400 Top = 540 Width = 492 Height = 228 Name ="Label16" Caption ="y:" End End End Begin Label OverlapFlags = 87 TextAlign = 2 Left = 804 Top = 240 Width = 2880 Height = 204 Name ="Label17" Caption ="Screen Coordinates" End Begin Label OverlapFlags = 87 TextAlign = 2 Left = 780 Top = 792 Width = 2892 Height = 204 Name ="Label18" Caption ="Client Coordinates" End Begin TextBox Enabled = NotDefault Locked = NotDefault OverlapFlags = 85 Left = 1800 Top = 1104 Width = 4944 TabIndex = 8 Name ="Text19" Begin Begin Label OverlapFlags = 85 Left = 60 Top = 1104 Width = 1464 Height = 228 Name ="Label20" Caption ="Window description" End End End End End End End CodeBehindForm Option Compare Database Option Explicit Property Let ReSet(flag As Boolean) Me.Text6 = 0 Me.Check10 = False Me.Check8 = False End Property Private Sub Form_Load() IMWheel_Hook End Sub Private Sub Form_Unload(Cancel As Integer) IMWheel_Unhook End Sub Public Sub WheelMoved(ByVal delta As Long, X As Long, Y As Long) 'This is the callback routine that will be called from "IMWheel" 'when the wheel is moved. Call WheelProcessing(delta, X, Y) End Sub Private Sub WheelProcessing(ByVal delta As Long, X As Long, Y As Long) Dim pt, py As POINTAPI Dim foundHwnd As Long Me.Text0 = delta Me.Text2 = X Me.Text4 = Y py.X = X py.Y = Y If delta > 0 Then Me.Text6 = ((delta - (delta - 1)) / 2) + Me.Text6 Me.Check8 = True Me.Check10 = False Else Me.Text6 = Me.Text6 - ((delta - (delta - 1)) / 2) Me.Check8 = False Me.Check10 = True End If 'get client window coordinates ScreenToClient Me.hwnd, py Me.Text13 = py.X Me.Text15 = py.Y 'get handle and description of window under that point in screen coordinates foundHwnd = WindowFromPoint(X, Y) Me.Text19 = GetWindowDesc$(foundHwnd) End Sub Private Sub Label12_Click() Me.ReSet = True End Sub Private Sub Text0_Click() Me.ReSet = True End Sub Private Sub Text2_Click() Me.ReSet = True End Sub Private Sub Text4_Click() Me.ReSet = True End Sub Private Sub Text6_Click() Me.ReSet = True End Sub Private Sub Detail_Click() Me.ReSet = True End Sub Private Sub Form_Click() Me.ReSet = True End Sub