home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / likene1a / myprog4.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1999-09-24  |  4.9 KB  |  161 lines

  1. VERSION 5.00
  2. Begin VB.Form Form2 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    Caption         =   "Windows stuff"
  5.    ClientHeight    =   720
  6.    ClientLeft      =   4845
  7.    ClientTop       =   3660
  8.    ClientWidth     =   2640
  9.    ControlBox      =   0   'False
  10.    BeginProperty Font 
  11.       Name            =   "Arial"
  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       =   "Form2"
  20.    MaxButton       =   0   'False
  21.    MinButton       =   0   'False
  22.    ScaleHeight     =   720
  23.    ScaleWidth      =   2640
  24.    ShowInTaskbar   =   0   'False
  25.    Begin VB.CommandButton Command1 
  26.       Caption         =   "Exit"
  27.       Height          =   375
  28.       Left            =   1320
  29.       TabIndex        =   3
  30.       Top             =   360
  31.       Width           =   1335
  32.    End
  33.    Begin VB.CommandButton Command4 
  34.       Caption         =   "Shut down"
  35.       Height          =   375
  36.       Left            =   1320
  37.       TabIndex        =   2
  38.       Top             =   0
  39.       Width           =   1335
  40.    End
  41.    Begin VB.CommandButton Command5 
  42.       BackColor       =   &H00C0C0C0&
  43.       Caption         =   "hide toolbar"
  44.       Height          =   375
  45.       Left            =   0
  46.       TabIndex        =   1
  47.       Top             =   360
  48.       Width           =   1335
  49.    End
  50.    Begin VB.CommandButton Command24 
  51.       BackColor       =   &H00C0C0C0&
  52.       Caption         =   "Dis Ctrl/Alt/Del"
  53.       Height          =   375
  54.       Left            =   0
  55.       TabIndex        =   0
  56.       Top             =   0
  57.       Width           =   1335
  58.    End
  59. Attribute VB_Name = "form2"
  60. Attribute VB_GlobalNameSpace = False
  61. Attribute VB_Creatable = False
  62. Attribute VB_PredeclaredId = True
  63. Attribute VB_Exposed = False
  64. Dim mmflag As Boolean
  65. Dim sax As Integer
  66. Dim Say As Integer
  67. Private Declare Function mciSendString Lib "winmm.dll" Alias _
  68. "mciSendStringA" (ByVal lpstrCommand As String, ByVal _
  69. lpstrReturnString As String, ByVal uReturnLength As Long, _
  70. ByVal hwndCallback As Long) As Long
  71. Private Type RECT
  72.     Left As Long
  73.     Top As Long
  74.     Right As Long
  75.     Bottom As Long
  76. End Type
  77. Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
  78.    (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
  79.  Private Declare Function ShowWindow Lib "user32" (ByVal hWnd As Long, _
  80.    ByVal nCmdShow As Long) As Long
  81.  Private Const SW_HIDE = 0
  82.  Private Const SW_SHOWNORMAL = 1
  83. Private Sub Command1_Click()
  84. Form12.Show
  85. Unload form2
  86. End Sub
  87. Private Sub Command20_Click()
  88. Load DirControls
  89. DirControls.Show
  90. End Sub
  91. Private Sub Command24_Click()
  92. If Command24.Caption = "Dis Ctrl/Alt/Del" Then
  93. Command24.Caption = "en Ctrl/Alt/Del"
  94. Command24.Caption = "Dis Ctrl/Alt/Del"
  95. End If
  96. If Command24.Caption = "en Ctrl/Alt/Del" Then
  97. Dim Ret As Integer
  98. Dim pOld As Boolean
  99. Ret = SystemParametersInfo(SPI_SCREENSAVERRUNNING, True, pOld, 0)
  100. End If
  101. If Command24.Caption = "Dis Ctrl/Alt/Del" Then
  102. Ret = SystemParametersInfo(SPI_SCREENSAVERRUNNING, False, pOld, 0)
  103. End If
  104. End Sub
  105. Private Sub Command25_Click()
  106.    Call ImplodeForm(Me, 2, 500, 1)
  107.     Unload form2
  108.     Form1.Show
  109. End Sub
  110. Private Sub Command3_Click()
  111. End Sub
  112. Private Sub Command4_Click()
  113. Dim temp
  114. temp = ExitWindowsEx(EWX_SHUTDOWN, 0)
  115. End Sub
  116. Private Sub Command5_Click()
  117. If Command5.Caption = "hide toolbar" Then
  118. Command5.Caption = "show toolbar"
  119. Command5.Caption = "hide toolbar"
  120. End If
  121. If Command5.Caption = "show toolbar" Then
  122.    Dim Ret         As Long
  123.    Dim ClassName   As String
  124.    Dim StartWindow As Long
  125.    ClassName = Space(256)
  126.    ClassName = "Shell_TrayWnd"
  127.    StartWindow = FindWindow(ClassName, vbNullString)
  128.    Ret = ShowWindow(StartWindow, SW_HIDE)
  129.    End If
  130.   If Command5.Caption = "hide toolbar" Then
  131.      ClassName = Space(256)
  132.    ClassName = "Shell_TrayWnd"
  133.    StartWindow = FindWindow(ClassName, vbNullString)
  134.    Ret = ShowWindow(StartWindow, SW_SHOWNORMAL)
  135.    End If
  136. End Sub
  137. Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  138.    Dim fml As Long
  139.    Dim fmt As Long
  140.    Dim a As Integer
  141.    If mmflag = True Then
  142.       fml = Me.Left: fmt = Me.Top
  143.       If X > sax Then Me.Left = fml + (X - sax)
  144.         If X < sax Then Me.Left = fml - (sax - X)
  145.       If Y > Say Then Me.Top = fmt + (Y - Say)
  146.       If Y < Say Then Me.Top = fmt - (Say - Y)
  147.    End If
  148.    End Sub
  149. Private Sub form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  150. If mmflag = False Then
  151.       sax = X
  152.       Say = Y
  153.       mmflag = True
  154.    End If
  155.    Me.MousePointer = vbSizePointer
  156.    End Sub
  157. Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
  158.     mmflag = False
  159.    Me.MousePointer = vbDefault
  160. End Sub
  161.