home *** CD-ROM | disk | FTP | other *** search
/ Hot Shareware 32 / hot34.iso / ficheros / LVB / T2W32523.ZIP / _DIB-BMP.FRM < prev    next >
Text File  |  1998-04-07  |  11KB  |  382 lines

  1. VERSION 5.00
  2. Object = "{0BA686C6-F7D3-101A-993E-0000C0EF6F5E}#1.0#0"; "THREED32.OCX"
  3. Begin VB.Form frmDIBBitmap 
  4.    BorderStyle     =   4  'Fixed ToolWindow
  5.    Caption         =   "DIB & Bitmap"
  6.    ClientHeight    =   5685
  7.    ClientLeft      =   1725
  8.    ClientTop       =   1785
  9.    ClientWidth     =   7485
  10.    MaxButton       =   0   'False
  11.    MDIChild        =   -1  'True
  12.    PaletteMode     =   1  'UseZOrder
  13.    ScaleHeight     =   5685
  14.    ScaleWidth      =   7485
  15.    ShowInTaskbar   =   0   'False
  16.    Begin VB.CommandButton Command1 
  17.       Caption         =   "Load"
  18.       Height          =   375
  19.       Left            =   6750
  20.       TabIndex        =   8
  21.       Top             =   2610
  22.       Visible         =   0   'False
  23.       Width           =   645
  24.    End
  25.    Begin VB.PictureBox Picture1 
  26.       AutoRedraw      =   -1  'True
  27.       Height          =   2985
  28.       Left            =   90
  29.       ScaleHeight     =   2925
  30.       ScaleWidth      =   7245
  31.       TabIndex        =   7
  32.       Top             =   2610
  33.       Width           =   7305
  34.    End
  35.    Begin VB.TextBox txt_Result 
  36.       BackColor       =   &H00C0C0C0&
  37.       BorderStyle     =   0  'None
  38.       Height          =   1845
  39.       Left            =   105
  40.       Locked          =   -1  'True
  41.       MultiLine       =   -1  'True
  42.       ScrollBars      =   2  'Vertical
  43.       TabIndex        =   0
  44.       Top             =   630
  45.       Width           =   7260
  46.    End
  47.    Begin Threed.SSPanel SSPanel1 
  48.       Align           =   1  'Align Top
  49.       Height          =   480
  50.       Left            =   0
  51.       TabIndex        =   1
  52.       Top             =   0
  53.       Width           =   7485
  54.       _Version        =   65536
  55.       _ExtentX        =   13203
  56.       _ExtentY        =   847
  57.       _StockProps     =   15
  58.       ForeColor       =   -2147483640
  59.       BackColor       =   12632256
  60.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  61.          Name            =   "MS Sans Serif"
  62.          Size            =   8.25
  63.          Charset         =   0
  64.          Weight          =   400
  65.          Underline       =   0   'False
  66.          Italic          =   0   'False
  67.          Strikethrough   =   0   'False
  68.       EndProperty
  69.       Begin VB.ComboBox cmb_Function 
  70.          Height          =   315
  71.          Left            =   1365
  72.          TabIndex        =   2
  73.          Top             =   90
  74.          Width           =   4785
  75.       End
  76.       Begin Threed.SSCommand SSCommand1 
  77.          Default         =   -1  'True
  78.          Height          =   300
  79.          Left            =   6615
  80.          TabIndex        =   6
  81.          Top             =   90
  82.          Width           =   465
  83.          _Version        =   65536
  84.          _ExtentX        =   820
  85.          _ExtentY        =   529
  86.          _StockProps     =   78
  87.          Caption         =   "&Go"
  88.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  89.             Name            =   "MS Sans Serif"
  90.             Size            =   8.25
  91.             Charset         =   0
  92.             Weight          =   400
  93.             Underline       =   0   'False
  94.             Italic          =   0   'False
  95.             Strikethrough   =   0   'False
  96.          EndProperty
  97.          BevelWidth      =   1
  98.          RoundedCorners  =   0   'False
  99.          Outline         =   0   'False
  100.       End
  101.       Begin Threed.SSCommand cmdNP 
  102.          Height          =   300
  103.          Index           =   0
  104.          Left            =   6300
  105.          TabIndex        =   4
  106.          Top             =   90
  107.          Width           =   255
  108.          _Version        =   65536
  109.          _ExtentX        =   450
  110.          _ExtentY        =   529
  111.          _StockProps     =   78
  112.          Caption         =   "<"
  113.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  114.             Name            =   "MS Sans Serif"
  115.             Size            =   8.25
  116.             Charset         =   0
  117.             Weight          =   400
  118.             Underline       =   0   'False
  119.             Italic          =   0   'False
  120.             Strikethrough   =   0   'False
  121.          EndProperty
  122.          BevelWidth      =   1
  123.          Font3D          =   3
  124.          RoundedCorners  =   0   'False
  125.          Outline         =   0   'False
  126.       End
  127.       Begin Threed.SSCommand cmdNP 
  128.          Height          =   300
  129.          Index           =   1
  130.          Left            =   7140
  131.          TabIndex        =   3
  132.          Top             =   90
  133.          Width           =   255
  134.          _Version        =   65536
  135.          _ExtentX        =   450
  136.          _ExtentY        =   529
  137.          _StockProps     =   78
  138.          Caption         =   ">"
  139.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  140.             Name            =   "MS Sans Serif"
  141.             Size            =   8.25
  142.             Charset         =   0
  143.             Weight          =   400
  144.             Underline       =   0   'False
  145.             Italic          =   0   'False
  146.             Strikethrough   =   0   'False
  147.          EndProperty
  148.          BevelWidth      =   1
  149.          Font3D          =   3
  150.          RoundedCorners  =   0   'False
  151.          Outline         =   0   'False
  152.       End
  153.       Begin VB.Label Label2 
  154.          Caption         =   "&Select a function"
  155.          Height          =   255
  156.          Left            =   90
  157.          TabIndex        =   5
  158.          Top             =   120
  159.          Width           =   1275
  160.       End
  161.    End
  162. End
  163. Attribute VB_Name = "frmDIBBitmap"
  164. Attribute VB_GlobalNameSpace = False
  165. Attribute VB_Creatable = False
  166. Attribute VB_PredeclaredId = True
  167. Attribute VB_Exposed = False
  168. Option Explicit
  169. Option Base 1
  170.  
  171. Private Const Iteration = 3
  172.  
  173. Dim IsLoaded         As Integer
  174.  
  175. Dim TimerStartOk     As Integer
  176. Dim TimerCloseOk     As Integer
  177.  
  178. Dim TimerHandle      As Integer
  179. Dim TimerValue       As Long
  180.  
  181. Private Sub cmdNP_Click(Index As Integer)
  182.  
  183.    Call sub_NextPrev(cmb_Function, Index)
  184.  
  185. End Sub
  186.  
  187.  
  188. Private Sub cmb_Function_Click()
  189.    
  190.    If (IsLoaded = False) Then Exit Sub
  191.    
  192.    Call cDisableFI(mdiT2W.Picture1)
  193.    
  194.    txt_Result = ""
  195.    
  196.    DoEvents
  197.    
  198.    Command1.Visible = False
  199.    Picture1.Width = 7305
  200.    
  201.    Select Case cmb_Function.ListIndex
  202.       Case 0
  203.          Call TestDIBSaveScreen
  204.       Case 1
  205.          Call TestDIBSaveWindow
  206.       Case 2
  207.          Picture1.Width = 6585
  208.          Command1.Visible = True
  209.          Call TestInstallHookKeyboard
  210.    End Select
  211.    
  212.    DoEvents
  213.    Call cEnableFI(mdiT2W.Picture1)
  214.    
  215. End Sub
  216.  
  217.  
  218. Private Sub Command1_Click()
  219.    If (cFilePathExists(T2WDirTest + "\TESTDIB.BMP") = True) Then
  220.       Picture1.Picture = LoadPicture(T2WDirTest + "\TESTDIB.BMP")
  221.    Else
  222.       MsgBox "File '" & T2WDirTest + "\TESTDIB.BMP" & "' not found"
  223.    End If
  224. End Sub
  225.  
  226. Private Sub Form_Activate()
  227.  
  228.    mdiT2W.Label2.Caption = cInsertBlocks(mdiT2W.Label2.Tag, "" & Iteration)
  229.  
  230. End Sub
  231.  
  232. Private Sub Form_Load()
  233.  
  234.    IsLoaded = False
  235.    
  236.    Show
  237.  
  238.    Call sub_Load_Combo(cmb_Function, T2WDirInst + "_dib-bmp.t2w")
  239.    
  240.    IsLoaded = True
  241.    
  242. End Sub
  243.  
  244.  
  245. Private Sub SSCommand1_Click()
  246.    
  247.    Call cmb_Function_Click
  248.    
  249. End Sub
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258. Private Sub TestDIBSaveWindow()
  259.    
  260.    Dim intResult        As Integer
  261.    Dim strResult        As String
  262.    Dim strDisplay       As String
  263.    Dim strFile          As String
  264.    
  265.    Dim i                As Integer
  266.    
  267.    strFile = T2WDirTest + "\snap_win.bmp"
  268.    
  269.    intResult = cDIBSaveWindow(Me.hWnd, DIB_SAVE_WINDOW, strFile)
  270.    
  271.    If (intResult = True) Then
  272.       strDisplay = strDisplay & "Active window has been saved" & vbCrLf & "in the file '" & strFile & "'" & vbCrLf & vbCrLf
  273.    Else
  274.       strDisplay = strDisplay & "Active window can't be saved" & vbCrLf & "in the file '" & strFile & "'" & vbCrLf & vbCrLf
  275.    End If
  276.    
  277.    txt_Result = strDisplay
  278.  
  279.    Picture1.Picture = LoadPicture(strFile)
  280.    
  281.    'time the function
  282.  
  283.    TimerHandle = cTimerOpen()
  284.    TimerStartOk = cTimerStart(TimerHandle)
  285.    
  286.    For i = 1 To Iteration
  287.       intResult = cDIBSaveWindow(Me.hWnd, DIB_SAVE_WINDOW, strFile)
  288.    Next i
  289.    
  290.    intResult = cKillFile(strFile)
  291.    
  292.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  293.    
  294.    TimerCloseOk = cTimerClose(TimerHandle)
  295.  
  296. End Sub
  297.  
  298. Private Sub TestDIBSaveScreen()
  299.    
  300.    Dim intResult        As Integer
  301.    Dim strResult        As String
  302.    Dim strDisplay       As String
  303.    Dim strFile          As String
  304.    
  305.    Dim i                As Integer
  306.    
  307.    strFile = T2WDirTest + "\snap_scr.bmp"
  308.    
  309.    intResult = cDIBSaveScreen(strFile)
  310.    
  311.    If (intResult = True) Then
  312.       strDisplay = strDisplay & "Screen has been saved" & vbCrLf & "in the file '" & strFile & "'" & vbCrLf & vbCrLf
  313.    Else
  314.       strDisplay = strDisplay & "Screen can't be saved" & vbCrLf & "in the file '" & strFile & "'" & vbCrLf & vbCrLf
  315.    End If
  316.    
  317.    txt_Result = strDisplay
  318.  
  319.    Picture1.Picture = LoadPicture(strFile)
  320.    
  321.    'time the function
  322.  
  323.    TimerHandle = cTimerOpen()
  324.    TimerStartOk = cTimerStart(TimerHandle)
  325.    
  326.    For i = 1 To Iteration
  327.       intResult = cDIBSaveScreen(strFile)
  328.    Next i
  329.    
  330.    intResult = cKillFile(strFile)
  331.    
  332.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  333.    
  334.    TimerCloseOk = cTimerClose(TimerHandle)
  335.  
  336. End Sub
  337.  
  338.  
  339.  
  340. Private Sub TestInstallHookKeyboard()
  341.    
  342.    Dim intResult        As Integer
  343.    Dim strResult        As String
  344.    Dim strDisplay       As String
  345.    Dim strFile          As String
  346.    
  347.    Dim i                As Integer
  348.    
  349.    intResult = cInstallHookKeyboard(True)
  350.    
  351.    If (intResult = True) Then
  352.       strDisplay = strDisplay & "InstallHookKeyboard has been successfully installed" & vbCrLf & vbCrLf
  353.    Else
  354.       strDisplay = strDisplay & "InstallHookKeyboard has been already installed" & vbCrLf & vbCrLf
  355.    End If
  356.    
  357.    strDisplay = strDisplay & "Press ALT+CTRL+SHIFT+F11 to save the screen" & vbCrLf
  358.    strDisplay = strDisplay & "Press ALT+CTRL+SHIFT+F12 to save the active window" & vbCrLf & vbCrLf
  359.    strDisplay = strDisplay & "For the test" & vbCrLf
  360.    strDisplay = strDisplay & "   don't change the directory" & vbCrLf
  361.    strDisplay = strDisplay & "   enter the name of the file TESTDIB" & vbCrLf
  362.    strDisplay = strDisplay & "   select a file type" & vbCrLf
  363.    strDisplay = strDisplay & "   push the OK button" & vbCrLf
  364.    strDisplay = strDisplay & "   push the LOAD command button" & vbCrLf
  365.    
  366.    txt_Result = strDisplay
  367.  
  368.    'time the function
  369.  
  370.    TimerHandle = cTimerOpen()
  371.    TimerStartOk = cTimerStart(TimerHandle)
  372.    
  373.    For i = 1 To Iteration
  374.       intResult = cInstallHookKeyboard(True)
  375.    Next i
  376.    
  377.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  378.    
  379.    TimerCloseOk = cTimerClose(TimerHandle)
  380.  
  381. End Sub
  382.