home *** CD-ROM | disk | FTP | other *** search
/ Hot Shareware 35 / hot35.iso / ficheros / LVB / T2W32543.ZIP / _DIB-BMP.FRM < prev    next >
Text File  |  1998-05-21  |  8KB  |  314 lines

  1. VERSION 5.00
  2. Begin VB.Form frmDIBBitmap 
  3.    BorderStyle     =   4  'Fixed ToolWindow
  4.    Caption         =   "DIB & Bitmap"
  5.    ClientHeight    =   5685
  6.    ClientLeft      =   1725
  7.    ClientTop       =   1785
  8.    ClientWidth     =   7485
  9.    MaxButton       =   0   'False
  10.    MDIChild        =   -1  'True
  11.    PaletteMode     =   1  'UseZOrder
  12.    ScaleHeight     =   5685
  13.    ScaleWidth      =   7485
  14.    ShowInTaskbar   =   0   'False
  15.    Begin VB.Frame Frame1 
  16.       Height          =   570
  17.       Left            =   0
  18.       TabIndex        =   3
  19.       Top             =   -90
  20.       Width           =   7485
  21.       Begin VB.CommandButton cmdNP 
  22.          Caption         =   ">"
  23.          Height          =   285
  24.          Index           =   1
  25.          Left            =   7110
  26.          TabIndex        =   8
  27.          Top             =   195
  28.          Width           =   285
  29.       End
  30.       Begin VB.CommandButton cmdNP 
  31.          Caption         =   "<"
  32.          Height          =   285
  33.          Index           =   0
  34.          Left            =   6210
  35.          TabIndex        =   7
  36.          Top             =   195
  37.          Width           =   285
  38.       End
  39.       Begin VB.CommandButton Command1 
  40.          Caption         =   "&Go"
  41.          Default         =   -1  'True
  42.          Height          =   285
  43.          Left            =   6570
  44.          TabIndex        =   6
  45.          Top             =   195
  46.          Width           =   465
  47.       End
  48.       Begin VB.ComboBox cmb_Function 
  49.          Height          =   315
  50.          Left            =   1365
  51.          TabIndex        =   4
  52.          Top             =   180
  53.          Width           =   4755
  54.       End
  55.       Begin VB.Label Label2 
  56.          Caption         =   "&Select a function"
  57.          Height          =   255
  58.          Left            =   90
  59.          TabIndex        =   5
  60.          Top             =   210
  61.          Width           =   1275
  62.       End
  63.    End
  64.    Begin VB.CommandButton Command3 
  65.       Caption         =   "Load"
  66.       Height          =   375
  67.       Left            =   6750
  68.       TabIndex        =   2
  69.       Top             =   2610
  70.       Visible         =   0   'False
  71.       Width           =   645
  72.    End
  73.    Begin VB.PictureBox Picture1 
  74.       AutoRedraw      =   -1  'True
  75.       Height          =   2985
  76.       Left            =   90
  77.       ScaleHeight     =   2925
  78.       ScaleWidth      =   7245
  79.       TabIndex        =   1
  80.       Top             =   2610
  81.       Width           =   7305
  82.    End
  83.    Begin VB.TextBox txt_Result 
  84.       BackColor       =   &H00C0C0C0&
  85.       BorderStyle     =   0  'None
  86.       Height          =   1845
  87.       Left            =   105
  88.       Locked          =   -1  'True
  89.       MultiLine       =   -1  'True
  90.       ScrollBars      =   2  'Vertical
  91.       TabIndex        =   0
  92.       Top             =   630
  93.       Width           =   7260
  94.    End
  95. End
  96. Attribute VB_Name = "frmDIBBitmap"
  97. Attribute VB_GlobalNameSpace = False
  98. Attribute VB_Creatable = False
  99. Attribute VB_PredeclaredId = True
  100. Attribute VB_Exposed = False
  101. Option Explicit
  102. Option Base 1
  103.  
  104. Private Const Iteration = 3
  105.  
  106. Dim IsLoaded         As Integer
  107.  
  108. Dim TimerStartOk     As Integer
  109. Dim TimerCloseOk     As Integer
  110.  
  111. Dim TimerHandle      As Integer
  112. Dim TimerValue       As Long
  113.  
  114. Private Sub cmdNP_Click(Index As Integer)
  115.  
  116.    Call sub_NextPrev(cmb_Function, Index)
  117.  
  118. End Sub
  119.  
  120.  
  121. Private Sub cmb_Function_Click()
  122.    
  123.    If (IsLoaded = False) Then Exit Sub
  124.    
  125.    Call cDisableFI(mdiT2W.Picture1)
  126.    
  127.    txt_Result = ""
  128.    
  129.    DoEvents
  130.    
  131.    Command3.Visible = False
  132.    Picture1.Width = 7305
  133.    
  134.    Select Case cmb_Function.ListIndex
  135.       Case 0
  136.          Call TestDIBSaveScreen
  137.       Case 1
  138.          Call TestDIBSaveWindow
  139.       Case 2
  140.          Picture1.Width = 6585
  141.          Command3.Visible = True
  142.          Call TestInstallHookKeyboard
  143.    End Select
  144.    
  145.    DoEvents
  146.    Call cEnableFI(mdiT2W.Picture1)
  147.    
  148. End Sub
  149.  
  150.  
  151. Private Sub Command3_Click()
  152.    If (cFilePathExists(T2WDirTest + "\TESTDIB.BMP") = True) Then
  153.       Picture1.Picture = LoadPicture(T2WDirTest + "\TESTDIB.BMP")
  154.    Else
  155.       MsgBox "File '" & T2WDirTest + "\TESTDIB.BMP" & "' not found"
  156.    End If
  157. End Sub
  158.  
  159. Private Sub Form_Activate()
  160.  
  161.    mdiT2W.Label2.Caption = cInsertBlocks(mdiT2W.Label2.Tag, "" & Iteration)
  162.  
  163. End Sub
  164.  
  165. Private Sub Form_Load()
  166.  
  167.    IsLoaded = False
  168.    
  169.    Show
  170.  
  171.    Call sub_Load_Combo(cmb_Function, T2WDirInst + "_dib-bmp.t2w")
  172.    
  173.    IsLoaded = True
  174.    
  175. End Sub
  176.  
  177. Private Sub Command1_Click()
  178.    
  179.    Call cmb_Function_Click
  180.    
  181. End Sub
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190. Private Sub TestDIBSaveWindow()
  191.    
  192.    Dim intResult        As Integer
  193.    Dim strResult        As String
  194.    Dim strDisplay       As String
  195.    Dim strFile          As String
  196.    
  197.    Dim i                As Integer
  198.    
  199.    strFile = T2WDirTest + "\snap_win.bmp"
  200.    
  201.    intResult = cDIBSaveWindow(Me.hwnd, DIB_SAVE_WINDOW, strFile)
  202.    
  203.    If (intResult = True) Then
  204.       strDisplay = strDisplay & "Active window has been saved" & vbCrLf & "in the file '" & strFile & "'" & vbCrLf & vbCrLf
  205.    Else
  206.       strDisplay = strDisplay & "Active window can't be saved" & vbCrLf & "in the file '" & strFile & "'" & vbCrLf & vbCrLf
  207.    End If
  208.    
  209.    txt_Result = strDisplay
  210.  
  211.    Picture1.Picture = LoadPicture(strFile)
  212.    
  213.    'time the function
  214.  
  215.    TimerHandle = cTimerOpen()
  216.    TimerStartOk = cTimerStart(TimerHandle)
  217.    
  218.    For i = 1 To Iteration
  219.       intResult = cDIBSaveWindow(Me.hwnd, DIB_SAVE_WINDOW, strFile)
  220.    Next i
  221.    
  222.    intResult = cKillFile(strFile)
  223.    
  224.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  225.    
  226.    TimerCloseOk = cTimerClose(TimerHandle)
  227.  
  228. End Sub
  229.  
  230. Private Sub TestDIBSaveScreen()
  231.    
  232.    Dim intResult        As Integer
  233.    Dim strResult        As String
  234.    Dim strDisplay       As String
  235.    Dim strFile          As String
  236.    
  237.    Dim i                As Integer
  238.    
  239.    strFile = T2WDirTest + "\snap_scr.bmp"
  240.    
  241.    intResult = cDIBSaveScreen(strFile)
  242.    
  243.    If (intResult = True) Then
  244.       strDisplay = strDisplay & "Screen has been saved" & vbCrLf & "in the file '" & strFile & "'" & vbCrLf & vbCrLf
  245.    Else
  246.       strDisplay = strDisplay & "Screen can't be saved" & vbCrLf & "in the file '" & strFile & "'" & vbCrLf & vbCrLf
  247.    End If
  248.    
  249.    txt_Result = strDisplay
  250.  
  251.    Picture1.Picture = LoadPicture(strFile)
  252.    
  253.    'time the function
  254.  
  255.    TimerHandle = cTimerOpen()
  256.    TimerStartOk = cTimerStart(TimerHandle)
  257.    
  258.    For i = 1 To Iteration
  259.       intResult = cDIBSaveScreen(strFile)
  260.    Next i
  261.    
  262.    intResult = cKillFile(strFile)
  263.    
  264.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  265.    
  266.    TimerCloseOk = cTimerClose(TimerHandle)
  267.  
  268. End Sub
  269.  
  270.  
  271.  
  272. Private Sub TestInstallHookKeyboard()
  273.    
  274.    Dim intResult        As Integer
  275.    Dim strResult        As String
  276.    Dim strDisplay       As String
  277.    Dim strFile          As String
  278.    
  279.    Dim i                As Integer
  280.    
  281.    intResult = cInstallHookKeyboard(True)
  282.    
  283.    If (intResult = True) Then
  284.       strDisplay = strDisplay & "InstallHookKeyboard has been successfully installed" & vbCrLf & vbCrLf
  285.    Else
  286.       strDisplay = strDisplay & "InstallHookKeyboard has been already installed" & vbCrLf & vbCrLf
  287.    End If
  288.    
  289.    strDisplay = strDisplay & "Press ALT+CTRL+SHIFT+F11 to save the screen" & vbCrLf
  290.    strDisplay = strDisplay & "Press ALT+CTRL+SHIFT+F12 to save the active window" & vbCrLf & vbCrLf
  291.    strDisplay = strDisplay & "For the test" & vbCrLf
  292.    strDisplay = strDisplay & "   don't change the directory" & vbCrLf
  293.    strDisplay = strDisplay & "   enter the name of the file TESTDIB" & vbCrLf
  294.    strDisplay = strDisplay & "   select a file type" & vbCrLf
  295.    strDisplay = strDisplay & "   push the OK button" & vbCrLf
  296.    strDisplay = strDisplay & "   push the LOAD command button" & vbCrLf
  297.    
  298.    txt_Result = strDisplay
  299.  
  300.    'time the function
  301.  
  302.    TimerHandle = cTimerOpen()
  303.    TimerStartOk = cTimerStart(TimerHandle)
  304.    
  305.    For i = 1 To Iteration
  306.       intResult = cInstallHookKeyboard(True)
  307.    Next i
  308.    
  309.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  310.    
  311.    TimerCloseOk = cTimerClose(TimerHandle)
  312.  
  313. End Sub
  314.