VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Form Animates Hides Desktop and many

by Karim Mohammad (2 Submissions)
Category: Custom Controls/Forms/Menus
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Mon 18th April 2005
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Form Animates Hides Desktop and many

Rate Form Animates Hides Desktop and many



Begin VB.Form Form1 
   BackColor       =   &H80000001&
   BorderStyle     =   4  'Fixed ToolWindow
   Caption         =   "Karim Mohammad Computer Assistant, Nellore Division"
   ClientHeight    =   -570
   ClientLeft      =   150
   ClientTop       =   1170
   ClientWidth     =   600
   DrawStyle       =   1  'Dash
   Icon            =   "HEIGHT&WIDTH.frx":0000
   KeyPreview      =   -1  'True
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   -570
   ScaleWidth      =   600
   StartUpPosition =   3  'Windows Default
   Begin VB.Timer Timer1 
      Left            =   3840
      Top             =   3360
   End
   Begin VB.Label lblDisplay 
      Alignment       =   1  'Right Justify
      Appearance      =   0  'Flat
      AutoSize        =   -1  'True
      BackColor       =   &H80000005&
      BackStyle       =   0  'Transparent
      BorderStyle     =   1  'Fixed Single
      Caption         =   "Karim"
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   9.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   -1  'True
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H80000008&
      Height          =   270
      Left            =   6000
      TabIndex        =   0
      Top             =   1080
      Width           =   555
   End
   Begin VB.Menu file 
      Caption         =   "File"
      Begin VB.Menu Age 
         Caption         =   "Age"
      End
   End
   Begin VB.Menu desk 
      Caption         =   "Desktop"
      Begin VB.Menu Hide 
         Caption         =   "Hide Desktop"
      End
      Begin VB.Menu Show 
         Caption         =   "Show Desktop"
      End
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Private Declare Function ShowWindow Lib "user32" (ByVal hWnd As Long, ByVal nCmdShow As Long) As Long
Dim K As Integer
Dim input1 As String, input2 As Integer, input3 As Integer
Dim FormCaption As String
Dim Caption2Scroll As String
Dim CaptionLength As Integer
Dim ScrollSpeed As Integer

Public Sub StartScroll()
    Caption2Scroll = Space(256) & Me.Caption
    CaptionLength = Len(Space(256) + FormCaption)
    
    Timer1.Interval = ScrollSpeed
    
    Timer1.Enabled = True
    
End Sub




Private Sub Age_Click()
On Error Resume Next
input1 = InputBox("What is your name?:", "Name please...")
input2 = InputBox("What year were you born?:", "year please (Ex.. 2005)...")
input3 = InputBox("Enter current year:", "current year please...")
K = input3 - input2
lblDisplay.Visible = True
lblDisplay.Caption = "You are " & input1 & " and you are " & K & " Years old"
End Sub

Private Sub Form_Activate()
Dim i As Integer
Dim K As Integer
For i = 0 To 7565 Step 1
    Form1.Height = i
Next i

For K = 0 To 11455 Step 1
Form1.Width = K
Next K
lblDisplay.Visible = False


    ScrollSpeed = 100
    Call StartScroll
End Sub

Private Sub Form_Load()
Me.BackColor = &H80000018
End Sub

Private Sub Form_Unload(Cancel As Integer)
Me.BackColor = &H80000001
Dim i As Integer
For i = 7565 To 0 Step -1
    Form1.Height = i
    Next i

Dim K As Integer
    For K = 11455 To 0 Step -1
Form1.Width = K
Next K


End Sub

Private Sub Hide_Click()
'To Hide Desktop
Form1.Caption = "Desktop is under HIDDEN"
Dim hWnd As Long
hWnd = FindWindowEx(0&, 0&, "Progman", vbNullString)
ShowWindow hWnd, 0
End Sub

Private Sub Show_Click()
Form1.Caption = "Desktop is Opened"
'To Show Desktop
Dim hWnd As Long
hWnd = FindWindowEx(0&, 0&, "Progman", vbNullString)
ShowWindow hWnd, 1
End Sub

Private Sub Timer1_Timer()
    Me.Caption = Right(Caption2Scroll, CaptionLength)
    
    CaptionLength = CaptionLength - 1
    
    If CaptionLength = 0 Then
        CaptionLength = Len(Space(256) + FormCaption)
        
    End If
    
End Sub


Download this snippet    Add to My Saved Code

Form Animates Hides Desktop and many Comments

No comments have been posted about Form Animates Hides Desktop and many. Why not be the first to post a comment about Form Animates Hides Desktop and many.

Post your comment

Subject:
Message:
0/1000 characters