p; End Sub
Private Sub Form_Unload(Cancel As Integer)
MODmain.CloseSCR ''关闭屏保
End Sub
Private Sub Timer1_Timer()
If (i >= picnum) Then
i = 1 ''如果循环变量大于
图片的数量则变量赋为1
Else
i = i + 1 ''否则循环变量加一
End If
On Error Resume Next
FRMmain.PaintPicture pic(i - 1), 0, 0, Width, Height, 0, 0, ScaleX(pic(i - 1).Width, vbHimetric, vbTwips), ScaleY(pic(i - 1).Height, vbHimetric, vbTwips) ''在FRMmain上画图
End Sub
Option Explicit ''MODconst
Public Const WM_LOOK = "屏保预览(demo)"
Public Const WM_RUN = "屏保运行(demo)"
Public Const HWND_TOP = 0&
Public Const WS_CHILD = &H40000000
Public Const GWL_STYLE = (-16)
Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Public Const SWP_NOZORDER = &H4
Public Const SWP_NOACTIVATE = &H10
Public Const SWP_SHOWWINDOW = &H40
Public Const WM_CLOSE = &H10
Declare Function GetClientRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long
Declare Function GetClassName Lib "user32" Alias "GetClassNameA" (ByVal hwnd As Long, ByVal lpClassName As String, ByVal nMaxCount As Long) As Long
Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long
Public Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Public Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Declare Function SetWindo