I use this code to make form cover entire screen in Win10-64 and set always on top.
...but on left side, right and bottom screen is not cover completely.Code: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 GetDeviceCaps Lib "gdi32" (ByVal hdc As Long, ByVal nIndex As Long) As Long Private Const HORZRES = 8 Private Const VERTRES = 10 Public Sub SetAlwaysOnTop(ByVal hwnd As Long, Optional ByVal AlwaysOnTop As Boolean = True) Const SWP_NOSIZE = &H1 Const SWP_NOMOVE = &H2 Const SWP_SHOWWINDOW = &H40 Const HWND_NOTOPMOST = -2 Const HWND_TOPMOST = -1 If AlwaysOnTop Then SetWindowPos hwnd, HWND_TOPMOST, 0&, 0&, 0&, 0&, SWP_NOMOVE Or SWP_NOSIZE Or SWP_SHOWWINDOW Else SetWindowPos hwnd, HWND_NOTOPMOST, 0&, 0&, 0&, 0&, SWP_NOMOVE Or SWP_NOSIZE Or SWP_SHOWWINDOW End If End Sub Private Sub Form_Load() Me.Move 0, 0, GetDeviceCaps(Me.hdc, HORZRES) * Screen.TwipsPerPixelX, GetDeviceCaps(Me.hdc, VERTRES) * Screen.TwipsPerPixelY SetAlwaysOnTop Me.hwnd End Sub
Can someone tell me how to do this?




Reply With Quote