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

📄 pro_6.frm

📁 是API教程4
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form1 
   Appearance      =   0  'Flat
   BackColor       =   &H80000005&
   BorderStyle     =   0  'None
   Caption         =   "Winamp 1.90"
   ClientHeight    =   1725
   ClientLeft      =   4065
   ClientTop       =   2595
   ClientWidth     =   4110
   Icon            =   "pro_6.frx":0000
   LinkTopic       =   "Form1"
   LockControls    =   -1  'True
   Picture         =   "pro_6.frx":030A
   ScaleHeight     =   1725
   ScaleWidth      =   4110
   ShowInTaskbar   =   0   'False
   Begin VB.Image Image2 
      Height          =   135
      Index           =   1
      Left            =   3660
      Top             =   60
      Width           =   135
   End
   Begin VB.Image Image2 
      Height          =   135
      Index           =   0
      Left            =   3960
      Top             =   60
      Width           =   135
   End
   Begin VB.Image Image1 
      Height          =   315
      Left            =   300
      ToolTipText     =   "Winamp 1.90"
      Top             =   0
      Width           =   3315
   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 GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long
Private Declare Function MoveWindow Lib "user32" (ByVal hwnd As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal bRepaint As Long) As Long
Private Declare Function CloseWindow& Lib "user32" (ByVal hwnd As Long)


 
Private Type POINTAPI
        X As Long
        Y As Long
End Type
Private Type RECT
        Left As Long
        Top As Long
        Right As Long
        Bottom As Long
End Type

Private MyRect As RECT
Private MyPoint As POINTAPI
Private Movex As Long, Movey As Long     '记录窗体移动前,窗体左上角与鼠标指针位置间的纵横距离



Private Sub Image1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim dl&
dl& = GetWindowRect(Form1.hwnd, MyRect)
dl& = GetCursorPos(MyPoint)
If Button = 1 Then
     Movex = MyPoint.X - MyRect.Left
     Movey = MyPoint.Y - MyRect.Top
End If
End Sub

Private Sub Image1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
       Dim dl&
       dl& = GetCursorPos(MyPoint)
       If Button = 1 Then
           dl& = MoveWindow(Form1.hwnd, MyPoint.X - Movex, MyPoint.Y - Movey, _
                          MyRect.Right - MyRect.Left, MyRect.Bottom - MyRect.Top, -1)
       End If
End Sub

Private Sub Image2_Click(index As Integer)
   Select Case index
          Case 0
               Unload Me
          Case 1
               CloseWindow (Form1.hwnd)
   End Select
End Sub



⌨️ 快捷键说明

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