home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1994 #1 / monster.zip / monster / WIN_UTL2 / XRAY11.ZIP / XTEST.FRM < prev    next >
Text File  |  1994-01-04  |  5KB  |  184 lines

  1. VERSION 2.00
  2. Begin Form Form1 
  3.    Caption         =   "Form1"
  4.    ClientHeight    =   6216
  5.    ClientLeft      =   1776
  6.    ClientTop       =   3624
  7.    ClientWidth     =   10596
  8.    FontBold        =   -1  'True
  9.    FontItalic      =   0   'False
  10.    FontName        =   "Terminal"
  11.    FontSize        =   4.8
  12.    FontStrikethru  =   0   'False
  13.    FontUnderline   =   0   'False
  14.    Height          =   6636
  15.    Left            =   1728
  16.    LinkTopic       =   "Form1"
  17.    ScaleHeight     =   6216
  18.    ScaleWidth      =   10596
  19.    Top             =   3252
  20.    Width           =   10692
  21.    Begin CommandButton Command4 
  22.       Caption         =   "Get Cursor"
  23.       Height          =   432
  24.       Left            =   9300
  25.       TabIndex        =   12
  26.       Top             =   4680
  27.       Width           =   1032
  28.    End
  29.    Begin CommandButton Command3 
  30.       Caption         =   "keytest"
  31.       Height          =   432
  32.       Left            =   9300
  33.       TabIndex        =   11
  34.       Top             =   4080
  35.       Width           =   1032
  36.    End
  37.    Begin TextBox Length 
  38.       Height          =   372
  39.       Left            =   9420
  40.       TabIndex        =   6
  41.       Top             =   2160
  42.       Width           =   972
  43.    End
  44.    Begin TextBox ColumnNo 
  45.       Height          =   372
  46.       Left            =   9420
  47.       TabIndex        =   4
  48.       Top             =   1680
  49.       Width           =   972
  50.    End
  51.    Begin TextBox LineNo 
  52.       Height          =   372
  53.       Left            =   9420
  54.       TabIndex        =   2
  55.       Top             =   1200
  56.       Width           =   972
  57.    End
  58.    Begin CommandButton Command2 
  59.       Caption         =   "Test A Field"
  60.       Height          =   372
  61.       Left            =   9000
  62.       TabIndex        =   1
  63.       Top             =   660
  64.       Width           =   1392
  65.    End
  66.    Begin CommandButton Command1 
  67.       Caption         =   "Screen Capture"
  68.       Height          =   372
  69.       Left            =   9000
  70.       TabIndex        =   0
  71.       Top             =   180
  72.       Width           =   1392
  73.    End
  74.    Begin Label Label5 
  75.       Caption         =   "Results"
  76.       Height          =   372
  77.       Left            =   5340
  78.       TabIndex        =   10
  79.       Top             =   2520
  80.       Width           =   1452
  81.    End
  82.    Begin Label Label4 
  83.       Caption         =   "Label4"
  84.       Height          =   72
  85.       Left            =   3600
  86.       TabIndex        =   9
  87.       Top             =   180
  88.       Width           =   12
  89.    End
  90.    Begin Label Results 
  91.       BorderStyle     =   1  'Fixed Single
  92.       Height          =   792
  93.       Left            =   5280
  94.       TabIndex        =   8
  95.       Top             =   2940
  96.       Width           =   5172
  97.    End
  98.    Begin Label Label3 
  99.       Caption         =   "Length"
  100.       Height          =   372
  101.       Left            =   7860
  102.       TabIndex        =   7
  103.       Top             =   2160
  104.       Width           =   1452
  105.    End
  106.    Begin Label Label2 
  107.       Caption         =   "Column"
  108.       Height          =   372
  109.       Left            =   7860
  110.       TabIndex        =   5
  111.       Top             =   1680
  112.       Width           =   1452
  113.    End
  114.    Begin Label Label1 
  115.       Caption         =   "Line Number"
  116.       Height          =   372
  117.       Left            =   7860
  118.       TabIndex        =   3
  119.       Top             =   1200
  120.       Width           =   1452
  121.    End
  122. End
  123. Declare Function XRAYfield Lib "xray.dll" (ByVal s As String, ByVal w As Integer, ByVal y As Integer, ByVal x As Integer, ByVal l As Integer) As Integer
  124. Declare Function XRAYStuffKeyboard Lib "xray.dll" (ByVal k As Integer, ByVal w As Integer) As Integer
  125. Declare Function XRAYGetCursor Lib "xray.dll" (ByVal w As Integer) As Integer
  126.  
  127. Sub Command1_Click ()
  128. Dim s As String
  129. form1.Cls
  130. form1.CurrentX = 0
  131. form1.CurrentY = 0
  132. s = String$(2000, 0)
  133. z = XRAYfield(s, 1, 0, 0, 2000)
  134. For j = 1 To 25
  135. form1.Print Mid$(s, ((j - 1) * 80) + 1, 80)
  136. Next
  137. End Sub
  138.  
  139. Sub Command2_Click ()
  140. Dim s As String
  141. If (Val(form1.Length) > 80 Or Val(form1.Length) < 1) Then
  142.    MsgBox "Length must be from 1 to 80"
  143.    form1.Length.SetFocus
  144.    Exit Sub
  145. End If
  146. If (Val(form1.LineNo) > 25 Or Val(form1.LineNo) < 1) Then
  147.    MsgBox "Line must be from 1 to 25"
  148.    form1.LineNo.SetFocus
  149.    Exit Sub
  150. End If
  151. If (Val(form1.ColumnNo) > 80 Or Val(form1.ColumnNo) < 1) Then
  152.    MsgBox "Column must be from 1 to 80"
  153.    form1.ColumnNo.SetFocus
  154.    Exit Sub
  155. End If
  156. s = String$(Val(form1.Length) + 1, 0)
  157. z = XRAYfield(s, 1, Val(form1.LineNo) - 1, Val(form1.ColumnNo) - 1, Length)
  158. s = Left$(s, InStr(s, Chr$(0)) - 1)
  159.  form1.Results.Caption = s
  160. End Sub
  161.  
  162. Sub Command3_Click ()
  163. Dim c As Integer
  164. s$ = "DIR /w"
  165. For j = 1 To Len(s$)
  166.   c = Asc(Mid$(s$, j, 1))
  167.   z = XRAYStuffKeyboard(c, 1)
  168. Next j
  169.   z = XRAYStuffKeyboard(&HD, 1)     ' enter
  170.   x = XRAYStuffKeyboard(&H3D00, 1)  ' f3
  171. End Sub
  172.  
  173. Sub Command4_Click ()
  174.   x = XRAYGetCursor(1)
  175.   form1.Cls
  176. form1.CurrentX = 0
  177. form1.CurrentY = 0
  178.   form1.Print "Current x = "; Int(x / 256)
  179.   form1.Print "Current y = "; x Mod 256
  180.  
  181.  
  182. End Sub
  183.  
  184.