home *** CD-ROM | disk | FTP | other *** search
/ Mastering Microsoft Visual Basic 5 / Mastering Microsoft Visual Basic 5.ISO / demo code / ch05 / winapi / frmmain.frm (.txt) next >
Encoding:
Visual Basic Form  |  1997-01-24  |  1.7 KB  |  60 lines

  1. VERSION 5.00
  2. Begin VB.Form frmMain 
  3.    Caption         =   "FlashWindow Demo"
  4.    ClientHeight    =   2340
  5.    ClientLeft      =   60
  6.    ClientTop       =   345
  7.    ClientWidth     =   4380
  8.    LinkTopic       =   "Form1"
  9.    ScaleHeight     =   2340
  10.    ScaleWidth      =   4380
  11.    StartUpPosition =   3  'Windows Default
  12.    Begin VB.CommandButton cmdFlash 
  13.       Caption         =   "&FlashWindow On"
  14.       Default         =   -1  'True
  15.       BeginProperty Font 
  16.          Name            =   "MS Sans Serif"
  17.          Size            =   9.75
  18.          Charset         =   0
  19.          Weight          =   400
  20.          Underline       =   0   'False
  21.          Italic          =   0   'False
  22.          Strikethrough   =   0   'False
  23.       EndProperty
  24.       Height          =   915
  25.       Left            =   1380
  26.       TabIndex        =   0
  27.       Top             =   600
  28.       Width           =   1875
  29.    End
  30.    Begin VB.Timer Timer1 
  31.       Enabled         =   0   'False
  32.       Interval        =   1000
  33.       Left            =   180
  34.       Top             =   1680
  35.    End
  36. Attribute VB_Name = "frmMain"
  37. Attribute VB_GlobalNameSpace = False
  38. Attribute VB_Creatable = False
  39. Attribute VB_PredeclaredId = True
  40. Attribute VB_Exposed = False
  41. Private Sub cmdFlash_Click()
  42.   Dim sCaption As String
  43.   ' Flash the window
  44.   FlashWindow frmMain.hwnd, 1
  45.   ' Toggle the timer's enabled state
  46.   Timer1.Enabled = Not Timer1.Enabled
  47.   ' Set the button text
  48.   sCaption = "&FlashWindow "
  49.   If Timer1.Enabled Then
  50.     sCaption = sCaption + "Off"
  51.   Else
  52.     sCaption = sCaption + "On"
  53.   End If
  54.   cmdFlash.Caption = sCaption
  55. End Sub
  56. Private Sub Timer1_Timer()
  57.   ' Flash the window
  58.   FlashWindow frmMain.hwnd, 1
  59. End Sub
  60.