i can't seem to figure out lines 6 to 8, and 16 to 17..
Expand|Select|Wrap|Line Numbers
- Private Const HWND_TOPMOST = -1
- Private Const HWND_NOTOPMOST = -2
- Private Const SWP_NOACTIVATE = &H10
- Private Const SWP_SHOWWINDOW = &H40
- Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, _
- ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, _
- ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
- Code:
- Private Sub SetWindowOnTop(f As Form, bAlwaysOnTop As Boolean)
- Dim iFlag As Long
- iFlag = IIf(bAlwaysOnTop, HWND_TOPMOST, HWND_NOTOPMOST)
- SetWindowPos f.hwnd, iFlag, f.Left / Screen.TwipsPerPixelX, f.Top / Screen.TwipsPerPixelY, _
- f.Width / Screen.TwipsPerPixelX, f.Height / Screen.TwipsPerPixelY, SWP_NOACTIVATE Or SWP_SHOWWINDOW
- End Sub