home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Visual Database / Visual BASIC 5.0 (Ent. Edition) / Vb5ent Extractor.EXE / VB / SAMPLES / COMPTOOL / CALLDLLS / CALLDLLS.FRM (.txt) next >
Encoding:
Visual Basic Form  |  1996-11-15  |  19.5 KB  |  591 lines

  1. VERSION 5.00
  2. Begin VB.Form frmCallDlls 
  3.    BorderStyle     =   1  'Fixed Single
  4.    Caption         =   "Calling DLL Procedures"
  5.    ClientHeight    =   1935
  6.    ClientLeft      =   4305
  7.    ClientTop       =   5280
  8.    ClientWidth     =   5520
  9.    ClipControls    =   0   'False
  10.    BeginProperty Font 
  11.       Name            =   "MS Sans Serif"
  12.       Size            =   8.25
  13.       Charset         =   0
  14.       Weight          =   700
  15.       Underline       =   0   'False
  16.       Italic          =   0   'False
  17.       Strikethrough   =   0   'False
  18.    EndProperty
  19.    LinkTopic       =   "Form1"
  20.    MaxButton       =   0   'False
  21.    MinButton       =   0   'False
  22.    PaletteMode     =   1  'UseZOrder
  23.    ScaleHeight     =   1935
  24.    ScaleWidth      =   5520
  25.    StartUpPosition =   2  'CenterScreen
  26.    WhatsThisHelp   =   -1  'True
  27.    Begin VB.PictureBox picSprite 
  28.       AutoRedraw      =   -1  'True
  29.       AutoSize        =   -1  'True
  30.       Height          =   540
  31.       Left            =   960
  32.       Picture         =   "CALLDLLS.frx":0000
  33.       ScaleHeight     =   32
  34.       ScaleMode       =   3  'Pixel
  35.       ScaleWidth      =   32
  36.       TabIndex        =   25
  37.       Top             =   1920
  38.       Visible         =   0   'False
  39.       Width           =   540
  40.    End
  41.    Begin VB.PictureBox picCopy 
  42.       AutoRedraw      =   -1  'True
  43.       BorderStyle     =   0  'None
  44.       Height          =   495
  45.       Left            =   1680
  46.       ScaleHeight     =   33
  47.       ScaleMode       =   3  'Pixel
  48.       ScaleWidth      =   33
  49.       TabIndex        =   24
  50.       Top             =   1920
  51.       Visible         =   0   'False
  52.       Width           =   495
  53.    End
  54.    Begin VB.PictureBox picMask 
  55.       AutoRedraw      =   -1  'True
  56.       AutoSize        =   -1  'True
  57.       Height          =   540
  58.       Left            =   240
  59.       Picture         =   "CALLDLLS.frx":030A
  60.       ScaleHeight     =   32
  61.       ScaleMode       =   3  'Pixel
  62.       ScaleWidth      =   32
  63.       TabIndex        =   23
  64.       Top             =   1920
  65.       Visible         =   0   'False
  66.       Width           =   540
  67.    End
  68.    Begin VB.CommandButton cmdBitBlt 
  69.       Caption         =   "BitBlt"
  70.       Height          =   495
  71.       Left            =   4680
  72.       TabIndex        =   22
  73.       Top             =   1320
  74.       Width           =   735
  75.    End
  76.    Begin VB.Frame fraInfo 
  77.       Caption         =   "Instructions"
  78.       ClipControls    =   0   'False
  79.       Height          =   1695
  80.       Index           =   0
  81.       Left            =   120
  82.       TabIndex        =   0
  83.       Top             =   120
  84.       Width           =   4455
  85.       Begin VB.Label lblInfo 
  86.          Caption         =   "Click the right mouse button on the icons to the right."
  87.          Height          =   495
  88.          Index           =   1
  89.          Left            =   840
  90.          TabIndex        =   1
  91.          Top             =   480
  92.          Width           =   2415
  93.       End
  94.    End
  95.    Begin VB.Timer tmrBounce 
  96.       Enabled         =   0   'False
  97.       Interval        =   1
  98.       Left            =   2520
  99.       Top             =   2040
  100.    End
  101.    Begin VB.Frame fraInfo 
  102.       Caption         =   "Operating System"
  103.       ClipControls    =   0   'False
  104.       Height          =   1695
  105.       Index           =   1
  106.       Left            =   120
  107.       TabIndex        =   2
  108.       Top             =   120
  109.       Visible         =   0   'False
  110.       Width           =   4455
  111.       Begin VB.Label lblInfo 
  112.          AutoSize        =   -1  'True
  113.          Caption         =   "(Enhanced mode)"
  114.          Height          =   195
  115.          Index           =   3
  116.          Left            =   360
  117.          TabIndex        =   8
  118.          Top             =   600
  119.          Width           =   1500
  120.       End
  121.       Begin VB.Label lblInfo 
  122.          AutoSize        =   -1  'True
  123.          Caption         =   "Disk Operating System 5.0"
  124.          Height          =   195
  125.          Index           =   4
  126.          Left            =   240
  127.          TabIndex        =   4
  128.          Top             =   960
  129.          Width           =   2265
  130.       End
  131.       Begin VB.Label lblInfo 
  132.          AutoSize        =   -1  'True
  133.          Caption         =   "Microsoft Windows Version 3.1"
  134.          Height          =   195
  135.          Index           =   2
  136.          Left            =   240
  137.          TabIndex        =   3
  138.          Top             =   360
  139.          Width           =   2640
  140.       End
  141.    End
  142.    Begin VB.Frame fraInfo 
  143.       Caption         =   "General Info"
  144.       ClipControls    =   0   'False
  145.       Height          =   1695
  146.       Index           =   4
  147.       Left            =   120
  148.       TabIndex        =   13
  149.       Top             =   120
  150.       Visible         =   0   'False
  151.       Width           =   4455
  152.       Begin VB.Label lblInfo 
  153.          Caption         =   "Keyboard:"
  154.          Height          =   435
  155.          Index           =   14
  156.          Left            =   120
  157.          TabIndex        =   17
  158.          Top             =   1080
  159.          Width           =   4230
  160.       End
  161.       Begin VB.Label lblInfo 
  162.          AutoSize        =   -1  'True
  163.          Caption         =   "Language:"
  164.          Height          =   195
  165.          Index           =   13
  166.          Left            =   120
  167.          TabIndex        =   16
  168.          Top             =   840
  169.          Width           =   915
  170.       End
  171.       Begin VB.Label lblInfo 
  172.          AutoSize        =   -1  'True
  173.          Caption         =   "Mouse:"
  174.          Height          =   195
  175.          Index           =   12
  176.          Left            =   120
  177.          TabIndex        =   15
  178.          Top             =   360
  179.          Width           =   630
  180.       End
  181.       Begin VB.Label lblInfo 
  182.          AutoSize        =   -1  'True
  183.          Caption         =   "Network:"
  184.          Height          =   195
  185.          Index           =   11
  186.          Left            =   120
  187.          TabIndex        =   14
  188.          Top             =   600
  189.          Width           =   780
  190.       End
  191.    End
  192.    Begin VB.Frame fraInfo 
  193.       Caption         =   "Processor Type and Memory Statistics"
  194.       ClipControls    =   0   'False
  195.       Height          =   1695
  196.       Index           =   2
  197.       Left            =   120
  198.       TabIndex        =   5
  199.       Top             =   120
  200.       Visible         =   0   'False
  201.       Width           =   4455
  202.       Begin VB.Timer tmrSysInfo 
  203.          Interval        =   1
  204.          Left            =   3840
  205.          Top             =   240
  206.       End
  207.       Begin VB.Shape shpFrame 
  208.          Height          =   255
  209.          Index           =   3
  210.          Left            =   1080
  211.          Top             =   1320
  212.          Width           =   3135
  213.       End
  214.       Begin VB.Shape shpBar 
  215.          BackStyle       =   1  'Opaque
  216.          DrawMode        =   7  'Invert
  217.          Height          =   255
  218.          Index           =   3
  219.          Left            =   1080
  220.          Top             =   1320
  221.          Width           =   1695
  222.       End
  223.       Begin VB.Label lblResInfo 
  224.          Alignment       =   2  'Center
  225.          Caption         =   "pagefile"
  226.          Height          =   255
  227.          Index           =   3
  228.          Left            =   1080
  229.          TabIndex        =   27
  230.          Top             =   1320
  231.          Width           =   3135
  232.       End
  233.       Begin VB.Label lblR 
  234.          Caption         =   "PageFile"
  235.          Height          =   255
  236.          Index           =   3
  237.          Left            =   240
  238.          TabIndex        =   26
  239.          Top             =   1320
  240.          Visible         =   0   'False
  241.          Width           =   855
  242.       End
  243.       Begin VB.Shape shpFrame 
  244.          Height          =   255
  245.          Index           =   1
  246.          Left            =   1080
  247.          Top             =   840
  248.          Width           =   3135
  249.       End
  250.       Begin VB.Shape shpBar 
  251.          BackStyle       =   1  'Opaque
  252.          DrawMode        =   7  'Invert
  253.          Height          =   255
  254.          Index           =   1
  255.          Left            =   1080
  256.          Top             =   840
  257.          Width           =   1695
  258.       End
  259.       Begin VB.Shape shpFrame 
  260.          Height          =   255
  261.          Index           =   2
  262.          Left            =   1080
  263.          Top             =   1080
  264.          Width           =   3135
  265.       End
  266.       Begin VB.Shape shpBar 
  267.          BackStyle       =   1  'Opaque
  268.          DrawMode        =   7  'Invert
  269.          Height          =   255
  270.          Index           =   2
  271.          Left            =   1080
  272.          Top             =   1080
  273.          Width           =   1695
  274.       End
  275.       Begin VB.Label lblResInfo 
  276.          Alignment       =   2  'Center
  277.          Caption         =   "virtual"
  278.          Height          =   255
  279.          Index           =   2
  280.          Left            =   1080
  281.          TabIndex        =   21
  282.          Top             =   1080
  283.          Width           =   3135
  284.       End
  285.       Begin VB.Label lblResInfo 
  286.          Alignment       =   2  'Center
  287.          Caption         =   "physical"
  288.          Height          =   255
  289.          Index           =   1
  290.          Left            =   1080
  291.          TabIndex        =   20
  292.          Top             =   840
  293.          Width           =   3135
  294.       End
  295.       Begin VB.Label lblR 
  296.          Caption         =   "Physical"
  297.          Height          =   255
  298.          Index           =   1
  299.          Left            =   240
  300.          TabIndex        =   19
  301.          Top             =   840
  302.          Width           =   855
  303.       End
  304.       Begin VB.Label lblR 
  305.          Caption         =   "Virtual"
  306.          Height          =   255
  307.          Index           =   2
  308.          Left            =   240
  309.          TabIndex        =   18
  310.          Top             =   1080
  311.          Width           =   855
  312.       End
  313.       Begin VB.Label lblInfo 
  314.          AutoSize        =   -1  'True
  315.          Caption         =   "CPU: 486 (with Math Coprocessor)"
  316.          Height          =   195
  317.          Index           =   5
  318.          Left            =   240
  319.          TabIndex        =   7
  320.          Top             =   240
  321.          Width           =   2940
  322.       End
  323.       Begin VB.Label lblInfo 
  324.          AutoSize        =   -1  'True
  325.          Caption         =   "Memory Free"
  326.          Height          =   195
  327.          Index           =   6
  328.          Left            =   240
  329.          TabIndex        =   6
  330.          Top             =   480
  331.          Width           =   1095
  332.       End
  333.    End
  334.    Begin VB.Frame fraInfo 
  335.       Caption         =   "Video"
  336.       ClipControls    =   0   'False
  337.       Height          =   1695
  338.       Index           =   3
  339.       Left            =   120
  340.       TabIndex        =   9
  341.       Top             =   120
  342.       Visible         =   0   'False
  343.       Width           =   4455
  344.       Begin VB.Label lblInfo 
  345.          AutoSize        =   -1  'True
  346.          Caption         =   "Colors:"
  347.          Height          =   195
  348.          Index           =   10
  349.          Left            =   240
  350.          TabIndex        =   12
  351.          Top             =   1320
  352.          Width           =   600
  353.       End
  354.       Begin VB.Label lblInfo 
  355.          AutoSize        =   -1  'True
  356.          Caption         =   "Resolution"
  357.          Height          =   195
  358.          Index           =   9
  359.          Left            =   240
  360.          TabIndex        =   11
  361.          Top             =   960
  362.          Width           =   915
  363.       End
  364.       Begin VB.Label lblInfo 
  365.          Caption         =   "Video Driver:"
  366.          Height          =   495
  367.          Index           =   8
  368.          Left            =   240
  369.          TabIndex        =   10
  370.          Top             =   360
  371.          Width           =   3975
  372.       End
  373.    End
  374.    Begin VB.Image ImgIcon 
  375.       Height          =   480
  376.       Index           =   1
  377.       Left            =   4800
  378.       Picture         =   "CALLDLLS.frx":0614
  379.       Top             =   720
  380.       Width           =   480
  381.    End
  382.    Begin VB.Image ImgIcon 
  383.       Height          =   480
  384.       Index           =   0
  385.       Left            =   4800
  386.       Picture         =   "CALLDLLS.frx":091E
  387.       Top             =   120
  388.       Width           =   480
  389.    End
  390. Attribute VB_Name = "frmCallDlls"
  391. Attribute VB_GlobalNameSpace = False
  392. Attribute VB_Creatable = False
  393. Attribute VB_PredeclaredId = True
  394. Attribute VB_Exposed = False
  395. Option Explicit
  396. Dim dx As Integer, dy As Integer, X As Integer, Y As Integer
  397. Dim PicWidth As Integer, PicHeight As Integer
  398. Dim RightEdge As Integer, BottomEdge As Integer
  399. Private Sub cmdBitBlt_Click()
  400. Dim t As Integer
  401.     If tmrBounce.Enabled Then
  402.         tmrBounce.Enabled = False
  403.         Refresh
  404.     Else
  405.         ScaleMode = PIXELS
  406.         dx = 15
  407.         dy = 15
  408.         tmrBounce.Enabled = True
  409.         PicWidth = picSprite.ScaleWidth
  410.         PicHeight = picSprite.ScaleHeight
  411.         picCopy.Width = PicWidth
  412.         picCopy.Height = PicHeight
  413.         t = BitBlt(picCopy.hDC, 0, 0, PicWidth, PicHeight, hDC, X, Y, SRCCOPY)
  414.     End If
  415. End Sub
  416. Private Sub FillSysInfo()
  417.     Dim FreeSpace As Currency, FreeBlock As Currency, strTmp As String
  418.     Dim YourMem As MEMORYSTATUS, myVer As MYVERSION
  419.     fraInfo(4).Visible = False
  420.     'Operating System Info.
  421.         Dim YourSystem As SystemInfo
  422.         GetSystemInfo YourSystem
  423.         
  424.         myVer = WindowsVersion()
  425.         
  426.         If myVer.lMajorVersion = 4 Then
  427.             If myVer.lExtraInfo = VER_PLATFORM_WIN32_NT Then
  428.                 strTmp = "Windows NT version : "
  429.             ElseIf myVer.lExtraInfo = VER_PLATFORM_WIN32_WINDOWS Then
  430.                 strTmp = "Windows 95 version : "
  431.             End If
  432.         Else
  433.             strTmp = "Windows version : "
  434.         End If
  435.             
  436.         lblInfo(2).Caption = strTmp & myVer.lMajorVersion & "." & myVer.lMinorVersion
  437.         lblInfo(3).Caption = ""
  438.         lblInfo(4).Caption = ""
  439.                 
  440.     ' CPU Info.
  441.         lblInfo(5).Caption = "CPU: " & YourSystem.dwProcessorType
  442.     ' Video info.
  443.         lblInfo(8).Visible = False
  444.         lblInfo(9).Caption = "Resolution: " & Screen.Width \ Screen.TwipsPerPixelX & " x " & Screen.Height \ Screen.TwipsPerPixelY
  445.         lblInfo(10).Caption = "Colors: " & DeviceColors((hDC))
  446.     ' General info.
  447.         If GetSystemMetrics(SM_MOUSEPRESENT) Then
  448.             lblInfo(11).Caption = "Mouse: " & GetSysIni("boot.description", "mouse.drv")
  449.         Else
  450.             lblInfo(11).Caption = "No mouse"
  451.         End If
  452.         lblInfo(12).Caption = "Network: " & GetSysIni("boot.description", "network.drv")
  453.         lblInfo(13).Caption = "Language: " & GetSysIni("boot.description", "language.dll")
  454.         lblInfo(14).Caption = "Keyboard: " & GetSysIni("boot.description", "keyboard.typ")
  455. End Sub
  456. Private Sub Form_Load()
  457.     Show                ' Make sure this form has an hWnd, etc.
  458.     Load frmMenus
  459.     Icon = ImgIcon(1).Picture
  460.     FillSysInfo
  461.     frmMenus.mnuSysInfo(3).Visible = False
  462. End Sub
  463. Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
  464.     End
  465. End Sub
  466. Private Sub Form_Resize()
  467. Dim t As Integer, hDC As Long
  468.     If WindowState = MINIMIZED Then
  469.         RightEdge = Screen.Width \ Screen.TwipsPerPixelX
  470.         BottomEdge = Screen.Height \ Screen.TwipsPerPixelY
  471.         If tmrBounce.Enabled Then
  472.             hDC = GetDC(GetDesktopWindow())
  473.             t = BitBlt(picCopy.hDC, 0, 0, PicWidth, PicHeight, hDC, X, Y, SRCCOPY)
  474.             ReleaseDC GetDesktopWindow(), hDC
  475.         End If
  476.     Else
  477.         ScaleMode = PIXELS
  478.         RightEdge = ScaleWidth
  479.         BottomEdge = ScaleHeight
  480.         If tmrBounce.Enabled Then
  481.             hDC = GetDC(GetDesktopWindow())
  482.             t = BitBlt(hDC, X, Y, PicWidth, PicHeight, picCopy.hDC, 0, 0, SRCCOPY)
  483.             ReleaseDC GetDesktopWindow(), hDC
  484.         End If
  485.     End If
  486. End Sub
  487. Private Sub ImgIcon_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
  488. Dim IX  As Integer, IY As Integer
  489. 'hMenu and hSubMenu must be long to run on 32-bit
  490. Dim hMenu As Long, hSubMenu As Long, R As Integer
  491. Dim menRect As Rect
  492.     If Button And 2 Then
  493.         ScaleMode = TWIPS
  494.         menRect.Left = 0
  495.         menRect.Top = 0
  496.         menRect.Right = Screen.Width / Screen.TwipsPerPixelX
  497.         menRect.Bottom = Screen.Height / Screen.TwipsPerPixelY
  498.         IX = (X + Left + ImgIcon(Index).Left) \ Screen.TwipsPerPixelX
  499.         IY = (Y + Top + ImgIcon(Index).Top + ImgIcon(Index).Height) \ Screen.TwipsPerPixelY
  500.         hMenu = GetMenu(frmMenus.hWnd)
  501.         hSubMenu = GetSubMenu(hMenu, Index)
  502.         R = TrackPopupMenu(hSubMenu, 2, IX, IY, 0, frmMenus.hWnd, menRect)
  503.     End If
  504.     ' Refresh SysInfo
  505.     If Index = 2 Then
  506.         FillSysInfo
  507.     End If
  508. End Sub
  509. Private Sub tmrBounce_Timer()
  510. 'Following are static only to improve speed
  511. Static NewX As Integer, NewY As Integer, temp As Integer
  512. Static hDC As Long, releaseit As Integer
  513. 'Calculate new position
  514.     ScaleMode = PIXELS
  515.     temp = X + dx
  516.     If temp + PicWidth \ 2 > RightEdge Then
  517.         dx = -Abs(dx)
  518.     ElseIf temp < 0 Then
  519.         dx = Abs(dx)
  520.     End If
  521.     NewX = X + dx
  522.     temp = Y + dy
  523.     If temp + PicHeight \ 2 > BottomEdge Then
  524.         dy = -Abs(dy)
  525.     ElseIf temp < 0 Then
  526.         dy = Abs(dy)
  527.     End If
  528.     NewY = Y + dy
  529.     If WindowState = MINIMIZED Then
  530.         hDC = GetDC(GetDesktopWindow())
  531.         releaseit = True
  532.     Else
  533.         hDC = Me.hDC
  534.         releaseit = False
  535.     End If
  536. 'Now perform "transparent" BitBlts:
  537. '1 Copy old background back over sprite's old position
  538. '2 Copy the background where the sprite will go
  539. '3 Draw the mask
  540. '4 Draw the sprite
  541.     temp = BitBlt(hDC, X, Y, PicWidth, PicHeight, picCopy.hDC, 0, 0, SRCCOPY)
  542.     temp = BitBlt(picCopy.hDC, 0, 0, PicWidth, PicHeight, hDC, NewX, NewY, SRCCOPY)
  543.     temp = BitBlt(hDC, NewX, NewY, PicWidth, PicHeight, picMask.hDC, 0, 0, SRCAND)
  544.     temp = BitBlt(hDC, NewX, NewY, PicWidth, PicHeight, picSprite.hDC, 0, 0, SRCINVERT)
  545.     X = NewX
  546.     Y = NewY
  547.     If releaseit Then ReleaseDC GetDesktopWindow(), hDC
  548. End Sub
  549. Private Sub tmrSysInfo_Timer()
  550. Dim YourMemory As MEMORYSTATUS
  551. Dim intX As Integer
  552. Dim lWidth As Integer
  553.     If fraInfo(RES_INFO).Visible Then
  554.         For intX = 1 To 3
  555.             lblR(intX).Visible = True
  556.             lblResInfo(intX).Visible = True
  557.             shpBar(intX).Visible = True
  558.             shpFrame(intX).Visible = True
  559.         Next intX
  560.     Else
  561.         For intX = 1 To 3
  562.             lblR(intX).Visible = False
  563.             lblResInfo(intX).Visible = False
  564.             shpBar(intX).Visible = False
  565.             shpFrame(intX).Visible = False
  566.         Next intX
  567.     End If
  568.     YourMemory.dwLength = Len(YourMemory)
  569.     GlobalMemoryStatus YourMemory
  570.         
  571.     With YourMemory
  572.         lblInfo(6).Caption = "Physical Memory Available(KB) : " & (.dwAvailPhys / 1024)
  573.         
  574. '       Check width before setting to try and cut down on screen "flashing"
  575.         lWidth = shpFrame(1).Width * (.dwAvailPhys / .dwTotalPhys)
  576.         If lWidth <> shpBar(1).Width Then
  577.             shpBar(1).Width = lWidth
  578.         End If
  579.         
  580.         lWidth = shpFrame(2).Width * (.dwAvailVirtual / .dwTotalVirtual)
  581.         If lWidth <> shpBar(2).Width Then
  582.             shpBar(2).Width = lWidth
  583.         End If
  584.         
  585.         lWidth = shpFrame(3).Width * (.dwAvailPageFile / .dwTotalPageFile)
  586.         If lWidth <> shpBar(3).Width Then
  587.             shpBar(3).Width = lWidth
  588.         End If
  589.     End With
  590. End Sub
  591.