⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 wubird.frm

📁 会飞的鸟,右击上发条,含全部源代码,在VB与WINXP上测试通过!
💻 FRM
📖 第 1 页 / 共 5 页
字号:
VERSION 5.00
Begin VB.Form Form1 
   BorderStyle     =   0  'None
   Caption         =   "ZS"
   ClientHeight    =   1440
   ClientLeft      =   105
   ClientTop       =   105
   ClientWidth     =   1035
   Icon            =   "WUBird.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   MouseIcon       =   "WUBird.frx":08CA
   MousePointer    =   99  'Custom
   Moveable        =   0   'False
   ScaleHeight     =   96
   ScaleMode       =   3  'Pixel
   ScaleWidth      =   69
   StartUpPosition =   2  '屏幕中心
   Begin VB.Timer Timer1 
      Left            =   -15
      Top             =   1440
   End
   Begin VB.Image Key 
      Height          =   390
      Index           =   6
      Left            =   4245
      MouseIcon       =   "WUBird.frx":0A1C
      MousePointer    =   99  'Custom
      Picture         =   "WUBird.frx":0B6E
      Top             =   390
      Width           =   285
   End
   Begin VB.Image Key 
      Height          =   390
      Index           =   5
      Left            =   3960
      MouseIcon       =   "WUBird.frx":11B8
      MousePointer    =   99  'Custom
      Picture         =   "WUBird.frx":130A
      Top             =   390
      Width           =   285
   End
   Begin VB.Image Key 
      Height          =   390
      Index           =   4
      Left            =   3675
      MouseIcon       =   "WUBird.frx":1954
      MousePointer    =   99  'Custom
      Picture         =   "WUBird.frx":1AA6
      Top             =   390
      Width           =   285
   End
   Begin VB.Image Key 
      Height          =   390
      Index           =   3
      Left            =   4530
      MouseIcon       =   "WUBird.frx":20F0
      MousePointer    =   99  'Custom
      Picture         =   "WUBird.frx":2242
      Top             =   0
      Width           =   285
   End
   Begin VB.Image Key 
      Height          =   390
      Index           =   2
      Left            =   4245
      MouseIcon       =   "WUBird.frx":288C
      MousePointer    =   99  'Custom
      Picture         =   "WUBird.frx":29DE
      Top             =   0
      Width           =   285
   End
   Begin VB.Image Key 
      Height          =   390
      Index           =   1
      Left            =   3960
      MouseIcon       =   "WUBird.frx":3028
      MousePointer    =   99  'Custom
      Picture         =   "WUBird.frx":317A
      Top             =   0
      Width           =   285
   End
   Begin VB.Image Key 
      Height          =   390
      Index           =   0
      Left            =   3675
      MouseIcon       =   "WUBird.frx":37C4
      MousePointer    =   99  'Custom
      Picture         =   "WUBird.frx":3916
      Top             =   0
      Width           =   285
   End
   Begin VB.Image KeyPic 
      Height          =   390
      Left            =   735
      MouseIcon       =   "WUBird.frx":3F60
      MousePointer    =   99  'Custom
      Picture         =   "WUBird.frx":40B2
      Top             =   825
      Width           =   285
   End
   Begin VB.Image Head 
      Height          =   825
      Index           =   4
      Left            =   2640
      MouseIcon       =   "WUBird.frx":46FC
      MousePointer    =   99  'Custom
      Picture         =   "WUBird.frx":484E
      Top             =   3300
      Width           =   1035
   End
   Begin VB.Image Head 
      Height          =   825
      Index           =   3
      Left            =   2640
      MouseIcon       =   "WUBird.frx":5C08
      MousePointer    =   99  'Custom
      Picture         =   "WUBird.frx":5D5A
      Top             =   2475
      Width           =   1035
   End
   Begin VB.Image Head 
      Height          =   825
      Index           =   2
      Left            =   2640
      MouseIcon       =   "WUBird.frx":7114
      MousePointer    =   99  'Custom
      Picture         =   "WUBird.frx":7266
      Top             =   1650
      Width           =   1035
   End
   Begin VB.Image Head 
      Height          =   825
      Index           =   1
      Left            =   2640
      MouseIcon       =   "WUBird.frx":8620
      MousePointer    =   99  'Custom
      Picture         =   "WUBird.frx":8772
      Top             =   825
      Width           =   1035
   End
   Begin VB.Image Head 
      Height          =   825
      Index           =   0
      Left            =   2640
      MouseIcon       =   "WUBird.frx":9B2C
      MousePointer    =   99  'Custom
      Picture         =   "WUBird.frx":9C7E
      Top             =   0
      Width           =   1035
   End
   Begin VB.Image Legs 
      Height          =   360
      Index           =   10
      Left            =   1845
      Picture         =   "WUBird.frx":B038
      Top             =   1440
      Visible         =   0   'False
      Width           =   795
   End
   Begin VB.Image Legs 
      Height          =   360
      Index           =   9
      Left            =   1845
      Picture         =   "WUBird.frx":B9BA
      Top             =   1080
      Visible         =   0   'False
      Width           =   795
   End
   Begin VB.Image Legs 
      Height          =   360
      Index           =   8
      Left            =   1845
      Picture         =   "WUBird.frx":C33C
      Top             =   720
      Visible         =   0   'False
      Width           =   795
   End
   Begin VB.Image Legs 
      Height          =   360
      Index           =   7
      Left            =   1845
      Picture         =   "WUBird.frx":CCBE
      Top             =   360
      Visible         =   0   'False
      Width           =   795
   End
   Begin VB.Image Legs 
      Height          =   360
      Index           =   6
      Left            =   1845
      Picture         =   "WUBird.frx":D640
      Top             =   0
      Visible         =   0   'False
      Width           =   795
   End
   Begin VB.Image Legs 
      Height          =   360
      Index           =   5
      Left            =   1050
      Picture         =   "WUBird.frx":DFC2
      Top             =   1800
      Visible         =   0   'False
      Width           =   795
   End
   Begin VB.Image Legs 
      Height          =   360
      Index           =   4
      Left            =   1050
      Picture         =   "WUBird.frx":E944
      Top             =   1440
      Visible         =   0   'False
      Width           =   795
   End
   Begin VB.Image Legs 
      Height          =   360
      Index           =   3
      Left            =   1050
      Picture         =   "WUBird.frx":F2C6
      Top             =   1080
      Visible         =   0   'False
      Width           =   795
   End
   Begin VB.Image Legs 
      Height          =   360
      Index           =   2
      Left            =   1050
      Picture         =   "WUBird.frx":FC48
      Top             =   720
      Visible         =   0   'False
      Width           =   795
   End
   Begin VB.Image Legs 
      Height          =   360
      Index           =   1
      Left            =   1050
      Picture         =   "WUBird.frx":105CA
      Top             =   360
      Visible         =   0   'False
      Width           =   795
   End
   Begin VB.Image Legs 
      Height          =   360
      Index           =   0
      Left            =   1050
      Picture         =   "WUBird.frx":10F4C
      Top             =   0
      Visible         =   0   'False
      Width           =   795
   End
   Begin VB.Image BottomPic 
      Height          =   360
      Left            =   30
      MouseIcon       =   "WUBird.frx":118CE
      MousePointer    =   99  'Custom
      Picture         =   "WUBird.frx":11A20
      Top             =   1080
      Width           =   795
   End
   Begin VB.Image BodyPic 
      Height          =   255
      Left            =   150
      MouseIcon       =   "WUBird.frx":123A2
      MousePointer    =   99  'Custom
      Picture         =   "WUBird.frx":124F4
      Top             =   825
      Width           =   585
   End
   Begin VB.Image HeadPic 
      Height          =   825
      Left            =   0
      MouseIcon       =   "WUBird.frx":12BDE
      MousePointer    =   99  'Custom
      Picture         =   "WUBird.frx":12D30
      Top             =   0
      Width           =   1035
   End
   Begin VB.Image IconPic 
      Height          =   480
      Index           =   1
      Left            =   465
      MouseIcon       =   "WUBird.frx":140EA
      MousePointer    =   99  'Custom
      Top             =   1860
      Width           =   480
   End
   Begin VB.Image IconPic 
      Height          =   480
      Index           =   0
      Left            =   0
      MouseIcon       =   "WUBird.frx":1423C
      MousePointer    =   99  'Custom
      Top             =   1860
      Width           =   480
   End
   Begin VB.Menu mPopupMenu 
      Caption         =   "PopupMenu"
      Visible         =   0   'False
      Begin VB.Menu mWindItUp 
         Caption         =   "&上发条"
      End
      Begin VB.Menu mSound 
         Caption         =   "&声音"
         Checked         =   -1  'True
      End
      Begin VB.Menu mAbout 
         Caption         =   "&关于"
      End
      Begin VB.Menu mSep0 
         Caption         =   "-"
      End
      Begin VB.Menu mExit 
         Caption         =   "&退出"
      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

'Windows 32 API
Private Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long
Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Private Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
Private Declare Function SetWindowRgn Lib "user32" (ByVal hwnd As Long, ByVal hRgn As Long, ByVal bRedraw As Boolean) As Long
Private Declare Function CreatePolygonRgn Lib "gdi32" (lpPoint As POINTAPI, ByVal nCount As Long, ByVal nPolyFillMode As Long) As Long
Private Declare Function CombineRgn Lib "gdi32" (ByVal hDestRgn As Long, ByVal hSrcRgn1 As Long, ByVal hSrcRgn2 As Long, ByVal nCombineMode As Long) As Long
Private Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long

'nCombineMode boolean logic
Private Const RGN_AND = 1
Private Const RGN_OR = 2
Private Const RGN_XOR = 3
Private Const RGN_DIFF = 4
Private Const RGN_COPY = 5

'Constants for SetWindowPos
Private Const HWND_TOPMOST = -1
Private Const HWND_NOTOPMOST = -2
Private Const SWP_NOSIZE = &H1
Private Const SWP_NOMOVE = &H2

'Constants for sndPlaySound
Private Const SND_SYNC = &H0                          'play synchronously (default)
Private Const SND_ASYNC = &H1                        'play asynchronously
Private Const SND_NODEFAULT = &H2              'silence not default, if sound not found

Private Const NORMAL_SPEED = 1
Private Const SLOW_SPEED1 = 50
Private Const SLOW_SPEED2 = 120
Private Const MAX_WINDUP = 400

'Type for CreatePolygonRgn
Private Type POINTAPI
    X As Long
    Y As Long
End Type

'Variables for moving form
Dim DifferenceX As Single
Dim DifferenceY As Single

'Variable for making irregular form
Dim MaxPolygonPoints
Dim lpPoint(48) As POINTAPI
Dim Region1 As Long
Dim Region2 As Long

'Other variables
Dim LegsNo As Integer
Dim StartMoving As Boolean
Dim WindUp As Boolean
Dim WindUpCount As Integer
Dim Broken As Boolean
Dim HeadNo As Integer
Dim AnimatedHeadIndex As Integer
Dim AnimatedHead As String
Dim KeyNo As Integer
Dim KeyCount As Integer

Private Sub Form_Load()
    LegsNo = 0
    Form1.Height = 1815
    Form1.Width = 1125
    Form1.BackColor = &H0&
    StartMoving = False
    WindUp = False
    Broken = False
    AnimatedHeadIndex = 0
    HeadNo = 0
    KeyNo = 0
    KeyCount = 0
    WindUpCount = 0
    AnimatedHead = "12314131413141314131413141210"
    SetWindowPos hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE Or SWP_NOMOVE
    DoMakeIrregularForm
    
    If GetSetting("Screen Mates", "Wind-Ups", "Bird Sound", "NotFound") = "NotFound" Then
        SaveSetting "Screen Mates", "Wind-Ups", "Bird Sound", mSound.Checked
    Else
        mSound.Checked = GetSetting("Screen Mates", "Wind-Ups", "Bird Sound")
    End If
End Sub

Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    DoMouseDown Button, Shift, X, Y
End Sub

Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    DoMouseMove Button, Shift, X, Y
End Sub

Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
    DoMouseUp Button, Shift, X, Y
End Sub

Private Sub Form_Unload(Cancel As Integer)
    End
End Sub

Private Sub HeadPic_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    DoMouseDown Button, Shift, X, Y
End Sub

Private Sub HeadPic_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    DoMouseMove Button, Shift, X, Y
End Sub

Private Sub HeadPic_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
    DoMouseUp Button, Shift, X, Y
End Sub

Private Sub BodyPic_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    DoMouseDown Button, Shift, X, Y
End Sub

Private Sub BodyPic_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    DoMouseMove Button, Shift, X, Y
End Sub

Private Sub BodyPic_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
    DoMouseUp Button, Shift, X, Y
End Sub

Private Sub BottomPic_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    DoMouseDown Button, Shift, X, Y
End Sub

Private Sub BottomPic_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    DoMouseMove Button, Shift, X, Y
End Sub

Private Sub BottomPic_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
    DoMouseUp Button, Shift, X, Y
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -