Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Option Explicit
- 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
- Private Declare Function FlashWindow Lib "user32.dll" (ByVal Hwnd As Long, ByVal bInvert As Long) As Long
- Const SWP_NOMOVE = &H2&
- Const SWP_NOSIZE = &H1&
- Const HWND_TOP As Long = 0
- Const HWND_TOPMOST = -1
- Const HWND_NOTOPMOST = -2
- Private Sub cmdTestPopup_Click()
- Me.WindowState = 1
- Me.Caption = "Minimized..."
- tmrPopup.Interval = txtPopupDelay
- tmrPopup = True
- End Sub
- Private Sub tmrPopup_Timer()
- tmrPopup = False
- Me.WindowState = 0
- BringWindowOnTop Me.Hwnd
- FlashWindow Me.Hwnd, True
- Me.Caption = "Popped up"
- End Sub
- Public Sub BringWindowOnTop(Hwnd As Long)
- SetWindowPos Hwnd, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE
- SetWindowPos Hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE
- SetWindowPos Hwnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement