?? frmgirl.frm
字號:
VERSION 5.00
Begin VB.Form frmGirl
Appearance = 0 'Flat
BackColor = &H00C0E0FF&
BorderStyle = 0 'None
Caption = "華杰軟件"
ClientHeight = 5910
ClientLeft = 0
ClientTop = 0
ClientWidth = 5640
Icon = "frmGirl.frx":0000
LinkTopic = "Form1"
MousePointer = 99 'Custom
OLEDropMode = 1 'Manual
ScaleHeight = 5910
ScaleWidth = 5640
ShowInTaskbar = 0 'False
StartUpPosition = 3 '窗口缺省
Begin VB.Timer Timer4
Left = 2160
Top = 1560
End
Begin VB.Timer Timer3
Left = 1920
Top = 3240
End
Begin VB.Timer Timer2
Enabled = 0 'False
Left = 600
Top = 3000
End
Begin VB.Timer Timer1
Left = 720
Top = 1440
End
Begin VB.CommandButton Command1
Caption = "Command1"
Height = 495
Left = 1560
TabIndex = 0
Top = 2040
Width = 1095
End
End
Attribute VB_Name = "frmGirl"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
'卡通人的運動參數
'當前動作幀,共18幀
Dim GirlAction As Long
'當前動作,分"sit"(坐下)和"fly"(飛翔)
Dim GirlAct As String
Dim GCount As Long
'保存鼠標多久沒有移動的計數器
Dim MouseCount As Long
'保存當前鼠標位置
Dim CurMousePoint As POINTAPI
'保存上一次移動時鼠標位置
Dim FristMousePoint As POINTAPI
'是否自動關機
Dim ShutDown As Long
'Dim IsMouseX, IsMouseY As Single
'Private r As Long
'Private entry As String
'配置文件路徑
Private iniPath As String
Private Sub MakeFrom()
'將窗口的形狀設為卡通人的形狀
'首先讀出卡通人
Dim i, Region1, Region2 As Long
'MsgBox MaxPolygonPoints
Region1 = CreateRectRgn(lpPoint(0).X, lpPoint(0).Y, lpPoint(1).X + 1, lpPoint(1).Y)
'Region1 = CreateRectRgn(1, 1, 100, 100)
For i = 2 To MaxPolygonPoints - 2 Step 2
Region2 = CreateRectRgn(lpPoint(i).X, lpPoint(i).Y, lpPoint(i + 1).X + 1, lpPoint(i + 1).Y)
'Debug.Print lpPoint(i).X, lpPoint(i).Y, lpPoint(i + 1).X + 1, lpPoint(i + 1).Y
CombineRgn Region1, Region1, Region2, RGN_OR
DeleteObject Region2
Next i
SetWindowRgn hwnd, Region1, True
End Sub
Private Sub Command1_Click()
Timer1.Interval = 250
Timer1.Enabled = True
End Sub
Private Sub Form_Load()
On Error GoTo ErrCode:
Dim lHwnd As Long
Dim Rc As RECT
Dim sClass As String * 255
Dim tmpLen As Long
Dim lCount As Long
Me.ScaleMode = 3
'Me.ScaleMode = 3
Me.Width = 64 * Screen.TwipsPerPixelX
Me.Height = 96 * Screen.TwipsPerPixelY
'MsgBox Screen.Width, , Screen.Height
'查找任務欄的位置
lHwnd = WindowFromPointXY(Screen.Width / Screen.TwipsPerPixelX - 1, Screen.Height / Screen.TwipsPerPixelY - 1)
tmpLen = GetClassName(lHwnd, sClass, 255)
Debug.Print lHwnd, sClass
'判斷任務欄的高度
For lCount = 2 To 50
lHwnd = WindowFromPointXY(Screen.Width / Screen.TwipsPerPixelX - lCount, Screen.Height / Screen.TwipsPerPixelY - 10 + lCount / 2)
tmpLen = GetClassName(lHwnd, sClass, 255)
'Debug.Print Left(sClass, tmpLen)
If Left(sClass, tmpLen) = "TrayNotifyWnd" Then lCount = 60
Next lCount
GetWindowRect lHwnd, Rc
'MsgBox Rc.Right - Rc.Left, , Rc.Bottom - Rc.Top
'MsgBox Left(sClass, tmpLen)
If Rc.Left > 80 Then
Me.Move (Rc.Left - 80) * Screen.TwipsPerPixelX, (Rc.Top - 64) * Screen.TwipsPerPixelY
Else
'MsgBox (Screen.Width - 200) / Screen.TwipsPerPixelX, , (Screen.Height - 150) / Screen.TwipsPerPixelY
'如果找不到任務欄就默認為屏幕左下角
Me.Move Screen.Width - Screen.TwipsPerPixelX * 150, Screen.Height - Screen.TwipsPerPixelY * 86
End If
'.Top = Me.ScaleTop
'Form.Left = Me.ScaleLeft
'載入圖片
Me.Picture = LoadResPicture(101, 0)
'設定初始動作為坐姿
GirlAct = "Sit"
GirlAction = 1
GCount = 1
Me.Picture = LoadResPicture(101, 0)
SetGirlSitPoint (1)
MakeFrom
'人物運動時鐘控制
Timer1.Interval = 200
Timer1.Enabled = True
'================================================================================
'設置Timer3,作為檢測電腦是否空閑的計數器
MouseCount = 0
GetCursorPos FristMousePoint
frmGirl.Timer3.Interval = 3000
frmGirl.Timer3.Enabled = True
'iniPath$ = WinDir() + "system.ini"
'entry = GetFromINI("boot", "SCRNSAVE.EXE", iniPath)
'r = WritePrivateProfileString("boot", "SCRNSAVE.EXE", entry, iniPath)
'HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run
'設置程序隨系統啟動
setvalue HKEY_LOCAL_MACHINE, "Software\Microsoft\Windows\CurrentVersion\Run", "DesktopGirl", REG_SZ, App.Path + "\" + App.EXEName + ".exe", 0
'設置默認配置文件路徑
iniPath$ = App.Path + "\SysSet.ini"
'讀取是否自動關機
ShutDown = Val(GetFromINI("系統設置", "自動關機", iniPath))
'讀取是否出現滾動廣告條
tmpLen = Val(GetFromINI("系統設置", "滾動廣告條", iniPath))
If tmpLen = 1 Then ADbar.Show
'使系統不出現屏幕保護,因為屏保會擋住待機畫面。程序退出時會恢復!
SystemParametersInfo SPI_SETSCREENSAVEACTIVE, False, 0&, SPIF_UPDATEINIFILE Or SPIF_SENDWININICHANGE
Load frmTrayIcon '載入系統托盤模塊
'MsgBox Form1.Height, , Screen.Height
Exit Sub
ErrCode:
MsgBox "傳奇網吧伴侶無法正常啟動,請重新下載或安裝!" + Chr(13) + "傳奇網吧伴侶目前支持win98/nt/2000,并需要VB運行庫的支持!", , "啟動出錯"
Unload Me
End Sub
Private Sub form_Click()
' form.Picture = LoadResPicture(101, 0)
' SetGirlSitPoint (1)
' MakeFrom
'If GirlAct <> "Sit" Then
'GirlAct = "Sit"
'GirlAction = 1
'End If
'Debug.Print "Click"
'frmMessage.Show
End Sub
Private Sub form_DblClick()
'Unload frmTrayIcon
'Unload Me
'Unload frmBubble
'Unload frmMessage
'Unload frmADScreen
'Timer1.Enabled = True
'通過雙擊控制人物的運動或停止,這個功能主要是為了解決在玩游戲時,人物也"頑強"地出現在屏幕上,造成游戲不能正常!
If Timer1.Enabled = True Then
Timer1.Enabled = False
Else
Timer1.Enabled = True
End If
End Sub
Private Sub form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
'如果按下的是鼠標左鍵,則移動人物
If Button = 1 Then
Unload frmMessage
Unload frmBubble
GirlAct = "Fly"
GirlAction = 9
ReleaseCapture
SendMessage Me.hwnd, WM_SYSCOMMAND, SC_MOVE + HTCAPTION, 0
'Load frmMessage
Else
'右鍵,則出現設置對話框
frmBubble.Show
Me.Picture = LoadResPicture(101, 0)
SetGirlSitPoint (1)
MakeFrom
If GirlAct <> "Sit" Then
GirlAct = "Sit"
GirlAction = 1
End If
'Debug.Print "Click"
End If
'允許人物運動
Timer1.Enabled = True
End Sub
Private Sub form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
'If IsMouseX = x And IsMouseY = y Then
'Timer4.Interval = 1000
'Timer4.Enabled = True
'End If
'Debug.Print x, y
'If Timer1.Enabled Then
'Timer1.Enabled = False
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -