hi guys ,
i am making a screen capture program and i want my main form to stay on top
so the user can take a screen shot of full screen games, i have found lots of stuff to keep it on top of all window but nothing works for full screen games
Below is 1 i have tried
Any help will be appreciated.
<<<Gobble>>>
i am making a screen capture program and i want my main form to stay on top
so the user can take a screen shot of full screen games, i have found lots of stuff to keep it on top of all window but nothing works for full screen games
Below is 1 i have tried
Code:
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
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
<<<Gobble>>>
Comment