home *** CD-ROM | disk | FTP | other *** search
/ On Hand / On_Hand_From_Softbank_1994_Release_2_Disc_2_1994.iso / 00202 / s / disk1 / calldlls.fr_ / calldlls.bin
Text File  |  1993-04-28  |  17KB  |  547 lines

  1. VERSION 2.00
  2. Begin Form frmCallDlls 
  3.    BorderStyle     =   1  'Fixed Single
  4.    Caption         =   "Calling DLL Procedures"
  5.    ClipControls    =   0   'False
  6.    Height          =   2310
  7.    Left            =   900
  8.    LinkTopic       =   "Form1"
  9.    MaxButton       =   0   'False
  10.    ScaleHeight     =   1905
  11.    ScaleWidth      =   5505
  12.    Top             =   1080
  13.    Width           =   5625
  14.    Begin PictureBox picSprite 
  15.       AutoRedraw      =   -1  'True
  16.       AutoSize        =   -1  'True
  17.       Height          =   510
  18.       Left            =   960
  19.       Picture         =   CALLDLLS.FRX:0000
  20.       ScaleHeight     =   32
  21.       ScaleMode       =   3  'Pixel
  22.       ScaleWidth      =   32
  23.       TabIndex        =   25
  24.       Top             =   1920
  25.       Visible         =   0   'False
  26.       Width           =   510
  27.    End
  28.    Begin PictureBox picCopy 
  29.       AutoRedraw      =   -1  'True
  30.       BorderStyle     =   0  'None
  31.       Height          =   495
  32.       Left            =   1680
  33.       ScaleHeight     =   33
  34.       ScaleMode       =   3  'Pixel
  35.       ScaleWidth      =   33
  36.       TabIndex        =   24
  37.       Top             =   1920
  38.       Visible         =   0   'False
  39.       Width           =   495
  40.    End
  41.    Begin PictureBox picMask 
  42.       AutoRedraw      =   -1  'True
  43.       AutoSize        =   -1  'True
  44.       Height          =   510
  45.       Left            =   240
  46.       Picture         =   CALLDLLS.FRX:0302
  47.       ScaleHeight     =   32
  48.       ScaleMode       =   3  'Pixel
  49.       ScaleWidth      =   32
  50.       TabIndex        =   23
  51.       Top             =   1920
  52.       Visible         =   0   'False
  53.       Width           =   510
  54.    End
  55.    Begin CommandButton cmdBitBlt 
  56.       Caption         =   "BitBlt"
  57.       Height          =   495
  58.       Left            =   4680
  59.       TabIndex        =   22
  60.       Top             =   1320
  61.       Width           =   735
  62.    End
  63.    Begin Frame fraInfo 
  64.       Caption         =   "Instructions"
  65.       ClipControls    =   0   'False
  66.       Height          =   1695
  67.       Index           =   0
  68.       Left            =   120
  69.       TabIndex        =   0
  70.       Top             =   120
  71.       Width           =   4455
  72.       Begin Label lblInfo 
  73.          Caption         =   "Click the right mouse button on the icons to the right."
  74.          Height          =   495
  75.          Index           =   1
  76.          Left            =   840
  77.          TabIndex        =   1
  78.          Top             =   480
  79.          Width           =   2415
  80.       End
  81.    End
  82.    Begin Timer tmrBounce 
  83.       Enabled         =   0   'False
  84.       Interval        =   1
  85.       Left            =   4080
  86.       Top             =   1920
  87.    End
  88.    Begin Frame fraInfo 
  89.       Caption         =   "General Info"
  90.       ClipControls    =   0   'False
  91.       Height          =   1695
  92.       Index           =   4
  93.       Left            =   120
  94.       TabIndex        =   13
  95.       Top             =   120
  96.       Visible         =   0   'False
  97.       Width           =   4455
  98.       Begin Label lblInfo 
  99.          Caption         =   "Keyboard:"
  100.          Height          =   435
  101.          Index           =   14
  102.          Left            =   120
  103.          TabIndex        =   17
  104.          Top             =   1080
  105.          Width           =   4230
  106.       End
  107.       Begin Label lblInfo 
  108.          AutoSize        =   -1  'True
  109.          Caption         =   "Language:"
  110.          Height          =   195
  111.          Index           =   13
  112.          Left            =   120
  113.          TabIndex        =   16
  114.          Top             =   840
  115.          Width           =   915
  116.       End
  117.       Begin Label lblInfo 
  118.          AutoSize        =   -1  'True
  119.          Caption         =   "Mouse:"
  120.          Height          =   195
  121.          Index           =   12
  122.          Left            =   120
  123.          TabIndex        =   15
  124.          Top             =   360
  125.          Width           =   630
  126.       End
  127.       Begin Label lblInfo 
  128.          AutoSize        =   -1  'True
  129.          Caption         =   "Network:"
  130.          Height          =   195
  131.          Index           =   11
  132.          Left            =   120
  133.          TabIndex        =   14
  134.          Top             =   600
  135.          Width           =   780
  136.       End
  137.    End
  138.    Begin Frame fraInfo 
  139.       Caption         =   "Operating System"
  140.       ClipControls    =   0   'False
  141.       Height          =   1695
  142.       Index           =   1
  143.       Left            =   120
  144.       TabIndex        =   2
  145.       Top             =   120
  146.       Visible         =   0   'False
  147.       Width           =   4455
  148.       Begin Label lblInfo 
  149.          AutoSize        =   -1  'True
  150.          Caption         =   "(Enhanced mode)"
  151.          Height          =   195
  152.          Index           =   3
  153.          Left            =   360
  154.          TabIndex        =   8
  155.          Top             =   600
  156.          Width           =   1500
  157.       End
  158.       Begin Label lblInfo 
  159.          AutoSize        =   -1  'True
  160.          Caption         =   "Disk Operating System 5.0"
  161.          Height          =   195
  162.          Index           =   4
  163.          Left            =   240
  164.          TabIndex        =   4
  165.          Top             =   960
  166.          Width           =   2265
  167.       End
  168.       Begin Label lblInfo 
  169.          AutoSize        =   -1  'True
  170.          Caption         =   "Microsoft Windows Version 3.1"
  171.          Height          =   195
  172.          Index           =   2
  173.          Left            =   240
  174.          TabIndex        =   3
  175.          Top             =   360
  176.          Width           =   2640
  177.       End
  178.    End
  179.    Begin Frame fraInfo 
  180.       Caption         =   "Processor, Memory, and System Resources"
  181.       ClipControls    =   0   'False
  182.       Height          =   1695
  183.       Index           =   2
  184.       Left            =   120
  185.       TabIndex        =   5
  186.       Top             =   120
  187.       Visible         =   0   'False
  188.       Width           =   4455
  189.       Begin Timer tmrSysInfo 
  190.          Interval        =   1
  191.          Left            =   3840
  192.          Top             =   240
  193.       End
  194.       Begin Shape shpFrame 
  195.          Height          =   255
  196.          Index           =   1
  197.          Left            =   1080
  198.          Top             =   960
  199.          Width           =   3135
  200.       End
  201.       Begin Shape shpBar 
  202.          BackStyle       =   1  'Opaque
  203.          DrawMode        =   7  'Xor Pen
  204.          Height          =   255
  205.          Index           =   1
  206.          Left            =   1080
  207.          Top             =   960
  208.          Width           =   1695
  209.       End
  210.       Begin Shape shpFrame 
  211.          Height          =   255
  212.          Index           =   2
  213.          Left            =   1080
  214.          Top             =   1320
  215.          Width           =   3135
  216.       End
  217.       Begin Shape shpBar 
  218.          BackStyle       =   1  'Opaque
  219.          DrawMode        =   7  'Xor Pen
  220.          Height          =   255
  221.          Index           =   2
  222.          Left            =   1080
  223.          Top             =   1320
  224.          Width           =   1695
  225.       End
  226.       Begin Label lblResInfo 
  227.          Alignment       =   2  'Center
  228.          Caption         =   "user"
  229.          Height          =   255
  230.          Index           =   2
  231.          Left            =   1080
  232.          TabIndex        =   21
  233.          Top             =   1320
  234.          Width           =   3135
  235.       End
  236.       Begin Label lblResInfo 
  237.          Alignment       =   2  'Center
  238.          Caption         =   "gdi"
  239.          Height          =   255
  240.          Index           =   1
  241.          Left            =   1080
  242.          TabIndex        =   20
  243.          Top             =   960
  244.          Width           =   3135
  245.       End
  246.       Begin Label lblR 
  247.          Caption         =   "GDI"
  248.          Height          =   255
  249.          Index           =   1
  250.          Left            =   240
  251.          TabIndex        =   19
  252.          Top             =   960
  253.          Width           =   855
  254.       End
  255.       Begin Label lblR 
  256.          Caption         =   "User"
  257.          Height          =   255
  258.          Index           =   2
  259.          Left            =   240
  260.          TabIndex        =   18
  261.          Top             =   1320
  262.          Width           =   855
  263.       End
  264.       Begin Label lblInfo 
  265.          AutoSize        =   -1  'True
  266.          Caption         =   "CPU: 486 (with Math Coprocessor)"
  267.          Height          =   195
  268.          Index           =   5
  269.          Left            =   240
  270.          TabIndex        =   7
  271.          Top             =   360
  272.          Width           =   2940
  273.       End
  274.       Begin Label lblInfo 
  275.          AutoSize        =   -1  'True
  276.          Caption         =   "Memory Free"
  277.          Height          =   195
  278.          Index           =   6
  279.          Left            =   240
  280.          TabIndex        =   6
  281.          Top             =   600
  282.          Width           =   1095
  283.       End
  284.    End
  285.    Begin Frame fraInfo 
  286.       Caption         =   "Video"
  287.       ClipControls    =   0   'False
  288.       Height          =   1695
  289.       Index           =   3
  290.       Left            =   120
  291.       TabIndex        =   9
  292.       Top             =   120
  293.       Visible         =   0   'False
  294.       Width           =   4455
  295.       Begin Label lblInfo 
  296.          AutoSize        =   -1  'True
  297.          Caption         =   "Colors:"
  298.          Height          =   195
  299.          Index           =   10
  300.          Left            =   240
  301.          TabIndex        =   12
  302.          Top             =   1320
  303.          Width           =   600
  304.       End
  305.       Begin Label lblInfo 
  306.          AutoSize        =   -1  'True
  307.          Caption         =   "Resolution"
  308.          Height          =   195
  309.          Index           =   9
  310.          Left            =   240
  311.          TabIndex        =   11
  312.          Top             =   960
  313.          Width           =   915
  314.       End
  315.       Begin Label lblInfo 
  316.          Caption         =   "Video Driver:"
  317.          Height          =   495
  318.          Index           =   8
  319.          Left            =   240
  320.          TabIndex        =   10
  321.          Top             =   360
  322.          Width           =   3975
  323.       End
  324.    End
  325.    Begin Image ImgIcon 
  326.       Height          =   480
  327.       Index           =   1
  328.       Left            =   4800
  329.       Picture         =   CALLDLLS.FRX:0604
  330.       Top             =   720
  331.       Width           =   480
  332.    End
  333.    Begin Image ImgIcon 
  334.       Height          =   480
  335.       Index           =   0
  336.       Left            =   4800
  337.       Picture         =   CALLDLLS.FRX:0906
  338.       Top             =   120
  339.       Width           =   480
  340.    End
  341. End
  342. Option Explicit
  343. Dim dx As Integer, dy As Integer, X As Integer, Y As Integer
  344. Dim PicWidth As Integer, PicHeight As Integer
  345. Dim RightEdge As Integer, BottomEdge As Integer
  346.  
  347. Sub cmdBitBlt_Click ()
  348. Dim t As Integer
  349.     If tmrBounce.Enabled Then
  350.     tmrBounce.Enabled = False
  351.     Refresh
  352.     Else
  353.     ScaleMode = PIXELS
  354.     dx = 15
  355.     dy = 15
  356.     tmrBounce.Enabled = True
  357.     PicWidth = picSprite.ScaleWidth
  358.     PicHeight = picSprite.ScaleHeight
  359.     picCopy.Width = PicWidth
  360.     picCopy.Height = PicHeight
  361.     t = BitBlt(picCopy.hDC, 0, 0, PicWidth, PicHeight, hDC, X, Y, SRCCOPY)
  362.     End If
  363. End Sub
  364.  
  365. Sub FillSysInfo ()
  366. Dim WinFlags As Long, FreeSpace As Currency, FreeBlock As Currency, temp
  367.  
  368. ' Operating System Info.
  369.     WinFlags = GetWinFlags()
  370.     
  371.     lblinfo(2).Caption = "Microsoft Windows Version " & WindowsVersion()
  372.     If WinFlags And WF_ENHANCED Then
  373.     lblinfo(3).Caption = "(Enhanced Mode)"
  374.     Else
  375.     lblinfo(3).Caption = "(Standard Mode)"
  376.     End If
  377.     
  378.     lblinfo(4).Caption = "Disk Operating System " & DosVersion()
  379.  
  380. ' CPU Info.
  381.     If WinFlags And WF_CPU486 Then
  382.     lblinfo(5).Caption = "CPU: 486"
  383.     ElseIf WinFlags And WF_CPU386 Then
  384.     lblinfo(5).Caption = "CPU: 386"
  385.     ElseIf WinFlags And WF_CPU286 Then
  386.     lblinfo(5).Caption = "CPU: 286"
  387.     End If
  388.     If WinFlags And WF_80x87 Then
  389.     lblinfo(5).Caption = lblinfo(5).Caption & " (with Math coprocessor)"
  390.     End If
  391.     
  392. ' Video info.
  393.     lblinfo(8).Caption = "Video Driver: " & GetSysIni("boot.description", "display.drv")
  394.     lblinfo(9).Caption = "Resolution: " & Screen.Width \ Screen.TwipsPerPixelX & " x " & Screen.Height \ Screen.TwipsPerPixelY
  395.     lblinfo(10).Caption = "Colors: " & DeviceColors((hDC))
  396.  
  397. ' General info.
  398.     If GetSystemMetrics(SM_MOUSEPRESENT) Then
  399.     lblinfo(11).Caption = "Mouse: " & GetSysIni("boot.description", "mouse.drv")
  400.     Else
  401.     lblinfo(11).Caption = "No mouse"
  402.     End If
  403.     lblinfo(12).Caption = "Network: " & GetSysIni("boot.description", "network.drv")
  404.     lblinfo(13).Caption = "Language: " & GetSysIni("boot.description", "language.dll")
  405.     lblinfo(14).Caption = "Keyboard: " & GetSysIni("boot.description", "keyboard.typ")
  406. End Sub
  407.  
  408. Sub Form_Load ()
  409.  
  410.     Show                ' Make sure this form has an hWnd, etc.
  411.     Load frmMenus
  412.     Icon = imgIcon(1).Picture
  413.  
  414.     FillSysInfo
  415. End Sub
  416.  
  417. Sub Form_QueryUnload (Cancel As Integer, UnloadMode As Integer)
  418.     End
  419. End Sub
  420.  
  421. Sub Form_Resize ()
  422. Dim t As Integer, hDC As Integer
  423.     If WindowState = MINIMIZED Then
  424.     RightEdge = Screen.Width \ Screen.TwipsPerPixelX
  425.     BottomEdge = Screen.Height \ Screen.TwipsPerPixelY
  426.     If tmrBounce.Enabled Then
  427.         hDC = GetDC(GetDeskTopWindow())
  428.         t = BitBlt(picCopy.hDC, 0, 0, PicWidth, PicHeight, hDC, X, Y, SRCCOPY)
  429.         ReleaseDC GetDeskTopWindow(), hDC
  430.     End If
  431.     Else
  432.     ScaleMode = PIXELS
  433.     RightEdge = ScaleWidth
  434.     BottomEdge = ScaleHeight
  435.     If tmrBounce.Enabled Then
  436.         hDC = GetDC(GetDeskTopWindow())
  437.         t = BitBlt(hDC, X, Y, PicWidth, PicHeight, picCopy.hDC, 0, 0, SRCCOPY)
  438.         ReleaseDC GetDeskTopWindow(), hDC
  439.     End If
  440.  
  441.     End If
  442. End Sub
  443.  
  444. Sub ImgIcon_MouseDown (Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
  445. Dim IX  As Integer, IY As Integer
  446. Dim hMenu As Integer, hSubMenu As Integer, R As Integer
  447. Dim menRect As Rect
  448.     If Button And 2 Then
  449.     ScaleMode = TWIPS
  450.     menRect.Left = 0
  451.     menRect.Top = 0
  452.     menRect.Right = Screen.Width / Screen.TwipsPerPixelX
  453.     menRect.Bottom = Screen.Height / Screen.TwipsPerPixelY
  454.     IX = (X + Left + imgIcon(Index).Left) \ Screen.TwipsPerPixelX
  455.     IY = (Y + Top + imgIcon(Index).Top + imgIcon(Index).Height) \ Screen.TwipsPerPixelY
  456.     hMenu = GetMenu(frmMenus.hWnd)
  457.     hSubMenu = GetSubMenu(hMenu, Index)
  458.     R = TrackPopupMenu(hSubMenu, 2, IX, IY, 0, frmMenus.hWnd, menRect)
  459.     End If
  460.  
  461.     ' Refresh SysInfo
  462.     If Index = 2 Then
  463.     FillSysInfo
  464.     End If
  465. End Sub
  466.  
  467. Sub tmrBounce_Timer ()
  468. 'Following are static only to improve speed
  469. Static NewX As Integer, NewY As Integer, temp As Integer
  470. Static hDC As Integer, releaseit As Integer
  471.  
  472. 'Calculate new position
  473.     ScaleMode = PIXELS
  474.     temp = X + dx
  475.     If temp + PicWidth \ 2 > RightEdge Then
  476.     dx = -Abs(dx)
  477.     ElseIf temp < 0 Then
  478.     dx = Abs(dx)
  479.     End If
  480.     
  481.     NewX = X + dx
  482.     
  483.     temp = Y + dy
  484.     If temp + PicHeight \ 2 > BottomEdge Then
  485.     dy = -Abs(dy)
  486.     ElseIf temp < 0 Then
  487.     dy = Abs(dy)
  488.     End If
  489.     
  490.     NewY = Y + dy
  491.  
  492.     If WindowState = MINIMIZED Then
  493.     hDC = GetDC(GetDeskTopWindow())
  494.     releaseit = True
  495.     Else
  496.     hDC = Me.hDC
  497.     releaseit = False
  498.     End If
  499.  
  500.  
  501. 'Now perform "transparent" BitBlts:
  502. '1 Copy old background back over sprite's old position
  503. '2 Copy the background where the sprite will go
  504. '3 Draw the mask
  505. '4 Draw the sprite
  506.     temp = BitBlt(hDC, X, Y, PicWidth, PicHeight, picCopy.hDC, 0, 0, SRCCOPY)
  507.     temp = BitBlt(picCopy.hDC, 0, 0, PicWidth, PicHeight, hDC, NewX, NewY, SRCCOPY)
  508.     temp = BitBlt(hDC, NewX, NewY, PicWidth, PicHeight, picMask.hDC, 0, 0, SRCAND)
  509.     temp = BitBlt(hDC, NewX, NewY, PicWidth, PicHeight, picSprite.hDC, 0, 0, SRCINVERT)
  510.     X = NewX
  511.     Y = NewY
  512.     If releaseit Then ReleaseDC GetDeskTopWindow(), hDC
  513. End Sub
  514.  
  515. Sub tmrSysInfo_Timer ()
  516. Static Res(1 To 2) As Integer, OldFreeSpace As Currency
  517. Dim i As Integer, newVal As Integer, temp, FreeSpace As Currency
  518.  
  519.     ' Update resource info if visible.
  520.     If fraInfo(RES_INFO).Visible Then
  521.     For i = 1 To 2
  522.         newVal = GetFreeSystemResources(i)
  523.         ' Reduce flashing by updating bar graphs and percentage
  524.         ' display only if they've actually changed.
  525.         If newVal <> Res(i) Then
  526.         Res(i) = newVal
  527.         lblResInfo(i).Caption = Res(i) & "%"
  528.         shpBar(i).Width = shpFrame(i).Width * Res(i) \ 100
  529.         End If
  530.     Next
  531.     
  532.     temp = GetFreeSpace(0)
  533.     If Sgn(temp) = -1 Then
  534.         ' Return of GetFreeSpace is an unsigned long
  535.         ' so handle case when high bit is set (two's complement).
  536.         FreeSpace = CLng(temp + 1&) Xor &HFFFFFFFF
  537.     Else
  538.         FreeSpace = temp
  539.     End If
  540.     If FreeSpace <> OldFreeSpace Then
  541.         lblinfo(6).Caption = "Free memory space: " & Format(FreeSpace, "#,# \b\y\t\e\s")
  542.         OldFreeSpace = FreeSpace
  543.     End If
  544.     End If
  545. End Sub
  546.  
  547.