Acidburn
02-01-2004, 03:19 AM
this is not my code, But could someone tell me if this is ok? it runs but it also does other things aswell just wondering if there is something else i can take out to shorten the code?
I'm hoping to include this in my coursework for IT however in order to do so im must understand the code some more so if someone could also explain it? However all the credit will go to the aurthor!
Credit goes to: http://www.candace-tripp.com/_pages/access_downloads.asp
Option Compare Database
Option Explicit
Global bOpened As Boolean
Type RECT
left As Long
top As Long
right As Long
bottom As Long
End Type
' x, y, nWidth, nHeight in pixels
Declare Function MoveWindow Lib "user32.dll" (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
Declare Function GetWindowRect Lib "user32.dll" (ByVal hwnd As Long, lpRect As RECT) As Long
Public Sub WipeEffect(frm As Form, lngOpt As Long, lngIncrement As Long)
Dim r As RECT
Dim lngRet As Long
Dim lngX As Long
Dim lngFormHeight As Long
Dim lngFormWidth As Long
Dim lngIncrementW As Long
Dim lngIncrementH As Long
lngRet = GetWindowRect(frm.hwnd, r)
lngFormWidth = r.right - r.left
lngFormHeight = r.bottom - r.top
lngIncrementW = lngFormWidth \ lngIncrement
lngIncrementH = lngFormHeight \ lngIncrement
Select Case lngOpt
Case 5 ' shrink/move
For lngX = 5 To lngIncrement
lngRet = MoveWindow(frm.hwnd, r.left - lngX * lngIncrementW, _
r.top + lngX * lngIncrementH, _
lngFormWidth - lngX * lngIncrementW, _
lngFormHeight - lngX * lngIncrementH, 1)
Next lngX
Case Else ' shiver
Dim lngTop As Long
Dim lngLeft As Long
Dim factor As Long
factor = 30
lngRet = MoveWindow(frm.hwnd, _
lngLeft, _
lngTop, _
lngFormWidth, _
lngFormHeight, 1)
End Select
End Sub
could someonel also explian how to tie it to a splash screen and after 7 secs to run this code?
I'm hoping to include this in my coursework for IT however in order to do so im must understand the code some more so if someone could also explain it? However all the credit will go to the aurthor!
Credit goes to: http://www.candace-tripp.com/_pages/access_downloads.asp
Option Compare Database
Option Explicit
Global bOpened As Boolean
Type RECT
left As Long
top As Long
right As Long
bottom As Long
End Type
' x, y, nWidth, nHeight in pixels
Declare Function MoveWindow Lib "user32.dll" (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
Declare Function GetWindowRect Lib "user32.dll" (ByVal hwnd As Long, lpRect As RECT) As Long
Public Sub WipeEffect(frm As Form, lngOpt As Long, lngIncrement As Long)
Dim r As RECT
Dim lngRet As Long
Dim lngX As Long
Dim lngFormHeight As Long
Dim lngFormWidth As Long
Dim lngIncrementW As Long
Dim lngIncrementH As Long
lngRet = GetWindowRect(frm.hwnd, r)
lngFormWidth = r.right - r.left
lngFormHeight = r.bottom - r.top
lngIncrementW = lngFormWidth \ lngIncrement
lngIncrementH = lngFormHeight \ lngIncrement
Select Case lngOpt
Case 5 ' shrink/move
For lngX = 5 To lngIncrement
lngRet = MoveWindow(frm.hwnd, r.left - lngX * lngIncrementW, _
r.top + lngX * lngIncrementH, _
lngFormWidth - lngX * lngIncrementW, _
lngFormHeight - lngX * lngIncrementH, 1)
Next lngX
Case Else ' shiver
Dim lngTop As Long
Dim lngLeft As Long
Dim factor As Long
factor = 30
lngRet = MoveWindow(frm.hwnd, _
lngLeft, _
lngTop, _
lngFormWidth, _
lngFormHeight, 1)
End Select
End Sub
could someonel also explian how to tie it to a splash screen and after 7 secs to run this code?