Let the window have been on top

zhaozj2021-02-11  212

Let the window have been on top

http://www.tongyi.net Author: End of the World wind chimes Hits: 419

Many popular software have such options: Always on Top. It allows the window to be on the top, and other windows cannot overwrite it. We in VB, you can use the following methods to achieve: Private Const SWP_NOSIZE = & H1Private Const SWP_NOMOVE = & H2Private Const SWP_NOZORDER = & H4Private Const SWP_NOREDRAW = & H8Private Const SWP_NOACTIVATE = & H10Private Const SWP_FRAMECHANGED = & H20Private Const SWP_SHOWWINDOW = & H40Private Const SWP_NOCOPYBITS = & H80Private Const SWP_NOOWNERZORDER = & H200Private const SWP_DRAWFRAME = SWP_FRAMECHANGEDPrivate const SWP_NOREPOSITION = SWP_NOOWNERZORDERPrivate const HWND_TOP = 0Private const HWND_BOTTOM = 1Private const HWND_TOPMOST = -1Private const HWND_NOTOPMOST = -2Private 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 LongPrivate mbOnTop As BooleanPrivate Property Let OnTop (Setting As Boolean) if Setting ThenSetWindowPos hwnd, -1, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSizeELSESETWINDOWPOS HWND, -2, 0, 0, 0, 0, SWP_NOMOVE OR SWP_NOSIEEND IFMBONTOP = Settingnd Property PR Ivate Property Get ONTOP () AS Boolean'Return The Private Variable Set In Property LetontTop = MbontopEnd Property calls ONTOP = true to let the window Always on top.

转载请注明原文地址:https://www.9cbs.com/read-5448.html

New Post(0)