1、模块代码:
'标准模块声明写入(自定义类型)
Type cp
wp As Single
hp As Single
tp As Single
lp As Single
fp As Single
End Type
Declare Function GetWindowsDirectory Lib "kernel32" Alias "GetWindowsDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long
'屏幕尺寸
Private Declare Function GetSystemMetrics32 Lib "user32" _
Alias "GetSystemMetrics" (ByVal nIndex As Long) As Long
Public ap() As cp '定义窗体数组
'屏幕宽
Function ScreenWidth() As Long
ScreenWidth = GetSystemMetrics32(0) * 15
End Function
'屏幕高,去除底部状态栏高度
Function ScreenHeight() As Long
ScreenHeight = (GetSystemMetrics32(1) - 40) * 15
End Function
Public Function MyGetWinDirectory() As String
Dim sBuffer As String
Dim lSize As Long
sBuffer = String(255, 0)