Home > database >  SetPosition (TopMost! In the before and after, and don't want to the current window loses focus
SetPosition (TopMost! In the before and after, and don't want to the current window loses focus

Time:09-27

I have a reminder window, will be regularly opened (actual open only one, is hidden behind - open - hidden), every open want to display in the front, so using SetPosition (TopMost!) , but this will interrupt the current operation, to make the current object loses focus, how every time in the open remind window displayed on the front, but don't interrupt the current operation?

CodePudding user response:

Refer to the following VB statement

Option Explicit
Declare the 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)
Window code:
Dim RTN
'let the window on the top floor
RTN=SetWindowPos (HWND. Me., 1, 0, 0, 0, 0, 3)
'cancel the window on the top floor
'the RTN=SetWindowPos (F_V HWND, 2, 0, 0, 0, 0, 3)

CodePudding user response:

You need to be placed at the top instead of

SetWindowPos (handle (w_), 1, 0, 0, 0, 0, 3)

CodePudding user response:

Try once, or not
My code is
SetWindowPos (handle (this), 1, 0, 0, 0, 0, 3)
SetWindowPos (handle (this), 2, 0, 0, 0, 0, 3)
If F_V refers to another window

CodePudding user response:

SetWindowPos (handle (this), 1, 0, 0, 0, 0, 3)

CodePudding user response:

To switch to Windows API AnimateWindow (), the effect is very good, don't interrupt the current operation, will not change the current focus,

CodePudding user response:

The study,
  • Related