vb取消窗口置顶

我用这个APIDeclare 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然后SetWindowPos Form1.hwnd, -1, 0, 0, 0, 0, 2 Or 1将form1置顶,但是SetWindowPos Form1.hwnd, HWND_NOTOPMOST, 0, 0, 0, 0, 2 Or 1却没法子改回来?
2026年09月28日 10:22
有2个网友回答
网友(1):

改为SetWindowPos Form1.hwnd,-2, 0, 0, 0, 0, 2 Or 1 主要是你的HWND_NOTOPMOST常量没有定义

网友(2):

你的HWND_NOTOPMOST定义了吗》用SetWindowPos Form1.hwnd,-2, 0, 0, 0, 0, 2 Or 1试试