![知识共享许可协议](https://csdnimg.cn/release/phoenix/images/creativecommons/80x15.png)
void TopWindow(HWND &hWnd) {
SetWindowPos(hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
}
int main() {
HWND hWnd=GetForegroundWindow();
while(1) {
TopWindow(hWnd);
Sleep(10);
}
}
void TopWindow(HWND &hWnd) {
SetWindowPos(hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
}
int main() {
HWND hWnd=GetForegroundWindow();
while(1) {
TopWindow(hWnd);
Sleep(10);
}
}