home *** CD-ROM | disk | FTP | other *** search
/ Dan Appleman's Visual Bas…s Guide to the Win32 API / Dan.Applmans.Visual.Basic.5.0.Programmers.Guide.To.The.Win32.API.1997.Ziff-Davis.Press.CD / VB5PG32.mdf / articles / vbbultn / source / nl1main.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1994-05-11  |  9.1 KB  |  295 lines

  1. VERSION 2.00
  2. Begin Form top10Main 
  3.    BackColor       =   &H00C0C0C0&
  4.    Caption         =   "Top 10 API Tricks for Visual Basic"
  5.    ClientHeight    =   5595
  6.    ClientLeft      =   1110
  7.    ClientTop       =   1485
  8.    ClientWidth     =   6195
  9.    Height          =   6000
  10.    Left            =   1050
  11.    LinkTopic       =   "Form1"
  12.    ScaleHeight     =   5595
  13.    ScaleWidth      =   6195
  14.    Top             =   1140
  15.    Width           =   6315
  16.    Begin CommandButton Command1 
  17.       Caption         =   "10"
  18.       Height          =   435
  19.       Index           =   10
  20.       Left            =   300
  21.       TabIndex        =   18
  22.       Top             =   5040
  23.       Width           =   855
  24.    End
  25.    Begin CommandButton Command1 
  26.       Caption         =   "9"
  27.       Height          =   435
  28.       Index           =   9
  29.       Left            =   300
  30.       TabIndex        =   8
  31.       Top             =   4500
  32.       Width           =   855
  33.    End
  34.    Begin CommandButton Command1 
  35.       Caption         =   "8"
  36.       Height          =   435
  37.       Index           =   8
  38.       Left            =   300
  39.       TabIndex        =   7
  40.       Top             =   3960
  41.       Width           =   855
  42.    End
  43.    Begin CommandButton Command1 
  44.       Caption         =   "7"
  45.       Height          =   435
  46.       Index           =   7
  47.       Left            =   300
  48.       TabIndex        =   6
  49.       Top             =   3420
  50.       Width           =   855
  51.    End
  52.    Begin CommandButton Command1 
  53.       Caption         =   "6"
  54.       Height          =   435
  55.       Index           =   6
  56.       Left            =   300
  57.       TabIndex        =   5
  58.       Top             =   2880
  59.       Width           =   855
  60.    End
  61.    Begin CommandButton Command1 
  62.       Caption         =   "5"
  63.       Height          =   435
  64.       Index           =   5
  65.       Left            =   300
  66.       TabIndex        =   4
  67.       Top             =   2340
  68.       Width           =   855
  69.    End
  70.    Begin CommandButton Command1 
  71.       Caption         =   "4"
  72.       Height          =   435
  73.       Index           =   4
  74.       Left            =   300
  75.       TabIndex        =   3
  76.       Top             =   1800
  77.       Width           =   855
  78.    End
  79.    Begin CommandButton Command1 
  80.       Caption         =   "3"
  81.       Height          =   435
  82.       Index           =   3
  83.       Left            =   300
  84.       TabIndex        =   2
  85.       Top             =   1260
  86.       Width           =   855
  87.    End
  88.    Begin CommandButton Command1 
  89.       Caption         =   "2"
  90.       Height          =   435
  91.       Index           =   2
  92.       Left            =   300
  93.       TabIndex        =   1
  94.       Top             =   720
  95.       Width           =   855
  96.    End
  97.    Begin CommandButton Command1 
  98.       Caption         =   "1"
  99.       Height          =   435
  100.       Index           =   1
  101.       Left            =   300
  102.       TabIndex        =   0
  103.       Top             =   180
  104.       Width           =   855
  105.    End
  106.    Begin Label Label1 
  107.       BackStyle       =   0  'Transparent
  108.       Caption         =   "Reading strings"
  109.       FontBold        =   -1  'True
  110.       FontItalic      =   0   'False
  111.       FontName        =   "MS Sans Serif"
  112.       FontSize        =   9.75
  113.       FontStrikethru  =   0   'False
  114.       FontUnderline   =   0   'False
  115.       Height          =   315
  116.       Index           =   9
  117.       Left            =   1260
  118.       TabIndex        =   19
  119.       Top             =   5160
  120.       Width           =   2775
  121.    End
  122.    Begin Label Label1 
  123.       BackStyle       =   0  'Transparent
  124.       Caption         =   "Combining Images"
  125.       FontBold        =   -1  'True
  126.       FontItalic      =   0   'False
  127.       FontName        =   "MS Sans Serif"
  128.       FontSize        =   9.75
  129.       FontStrikethru  =   0   'False
  130.       FontUnderline   =   0   'False
  131.       Height          =   315
  132.       Index           =   8
  133.       Left            =   1260
  134.       TabIndex        =   17
  135.       Top             =   4620
  136.       Width           =   2775
  137.    End
  138.    Begin Label Label1 
  139.       BackStyle       =   0  'Transparent
  140.       Caption         =   "Launching a background operation"
  141.       FontBold        =   -1  'True
  142.       FontItalic      =   0   'False
  143.       FontName        =   "MS Sans Serif"
  144.       FontSize        =   9.75
  145.       FontStrikethru  =   0   'False
  146.       FontUnderline   =   0   'False
  147.       Height          =   315
  148.       Index           =   7
  149.       Left            =   1260
  150.       TabIndex        =   16
  151.       Top             =   4080
  152.       Width           =   4755
  153.    End
  154.    Begin Label Label1 
  155.       BackStyle       =   0  'Transparent
  156.       Caption         =   "Screen Capture"
  157.       FontBold        =   -1  'True
  158.       FontItalic      =   0   'False
  159.       FontName        =   "MS Sans Serif"
  160.       FontSize        =   9.75
  161.       FontStrikethru  =   0   'False
  162.       FontUnderline   =   0   'False
  163.       Height          =   315
  164.       Index           =   6
  165.       Left            =   1260
  166.       TabIndex        =   15
  167.       Top             =   3540
  168.       Width           =   2775
  169.    End
  170.    Begin Label Label1 
  171.       BackStyle       =   0  'Transparent
  172.       Caption         =   "Number of Colors Available"
  173.       FontBold        =   -1  'True
  174.       FontItalic      =   0   'False
  175.       FontName        =   "MS Sans Serif"
  176.       FontSize        =   9.75
  177.       FontStrikethru  =   0   'False
  178.       FontUnderline   =   0   'False
  179.       Height          =   315
  180.       Index           =   5
  181.       Left            =   1260
  182.       TabIndex        =   14
  183.       Top             =   3000
  184.       Width           =   3915
  185.    End
  186.    Begin Label Label1 
  187.       BackStyle       =   0  'Transparent
  188.       Caption         =   "Placing Tabs in list boxes"
  189.       FontBold        =   -1  'True
  190.       FontItalic      =   0   'False
  191.       FontName        =   "MS Sans Serif"
  192.       FontSize        =   9.75
  193.       FontStrikethru  =   0   'False
  194.       FontUnderline   =   0   'False
  195.       Height          =   315
  196.       Index           =   4
  197.       Left            =   1260
  198.       TabIndex        =   13
  199.       Top             =   1920
  200.       Width           =   3075
  201.    End
  202.    Begin Label Label1 
  203.       BackStyle       =   0  'Transparent
  204.       Caption         =   "Get a list of running tasks"
  205.       FontBold        =   -1  'True
  206.       FontItalic      =   0   'False
  207.       FontName        =   "MS Sans Serif"
  208.       FontSize        =   9.75
  209.       FontStrikethru  =   0   'False
  210.       FontUnderline   =   0   'False
  211.       Height          =   315
  212.       Index           =   3
  213.       Left            =   1260
  214.       TabIndex        =   12
  215.       Top             =   2460
  216.       Width           =   2775
  217.    End
  218.    Begin Label Label1 
  219.       BackStyle       =   0  'Transparent
  220.       Caption         =   "Close another application"
  221.       FontBold        =   -1  'True
  222.       FontItalic      =   0   'False
  223.       FontName        =   "MS Sans Serif"
  224.       FontSize        =   9.75
  225.       FontStrikethru  =   0   'False
  226.       FontUnderline   =   0   'False
  227.       Height          =   315
  228.       Index           =   2
  229.       Left            =   1260
  230.       TabIndex        =   11
  231.       Top             =   1380
  232.       Width           =   2775
  233.    End
  234.    Begin Label Label1 
  235.       BackStyle       =   0  'Transparent
  236.       Caption         =   "Find the window handle of another application"
  237.       FontBold        =   -1  'True
  238.       FontItalic      =   0   'False
  239.       FontName        =   "MS Sans Serif"
  240.       FontSize        =   9.75
  241.       FontStrikethru  =   0   'False
  242.       FontUnderline   =   0   'False
  243.       Height          =   315
  244.       Index           =   0
  245.       Left            =   1260
  246.       TabIndex        =   10
  247.       Top             =   840
  248.       Width           =   4875
  249.    End
  250.    Begin Label Label1 
  251.       BackStyle       =   0  'Transparent
  252.       Caption         =   "Changing the Default Printer"
  253.       FontBold        =   -1  'True
  254.       FontItalic      =   0   'False
  255.       FontName        =   "MS Sans Serif"
  256.       FontSize        =   9.75
  257.       FontStrikethru  =   0   'False
  258.       FontUnderline   =   0   'False
  259.       Height          =   315
  260.       Index           =   1
  261.       Left            =   1260
  262.       TabIndex        =   9
  263.       Top             =   300
  264.       Width           =   3075
  265.    End
  266. Option Explicit
  267. Sub Command1_Click (Index As Integer)
  268.     Dim classname$
  269.     Dim di%
  270.     Me.Hide
  271.     LastCommand% = Index
  272.     Select Case Index
  273.         Case 1
  274.             ChangePrinter.Show 1
  275.         Case 2, 3
  276.             FindOrClose.Show 1
  277.         Case 4, 5
  278.             TaskListForm.Show 1
  279.         Case 6
  280.             MsgBox Str$(NumberOfColors(hDC)), 0, "Total Colors"
  281.         Case 7
  282.             ScreenCap.Show 1
  283.         Case 8
  284.             LaunchBackground.Show 1
  285.         Case 9
  286.             Combine.Show 1
  287.         Case 10
  288.             ' Obtain the class name for a standard form
  289.             classname$ = String$(32, "A")
  290.             di% = GetClassName(top10Main.hWnd, classname$, 31)
  291.             MsgBox "Length:" & Str$(Len(classname$)) & " " & classname$, 0, "Class without nulls stripped"
  292.     End Select
  293.     Me.Show
  294. End Sub
  295.