Qt 程序主窗口句柄

        HWND hForeWnd = NULL;
		HWND hWnd = FindWindow(NULL, L"NewVision VC Desktop");
		DWORD dwForeID;
		DWORD dwCurID;
		
		hForeWnd = GetForegroundWindow();
	
		dwCurID = GetCurrentThreadId();
		dwForeID = GetWindowThreadProcessId(hForeWnd, NULL);
		AttachThreadInput(dwCurID, dwForeID, TRUE);
		SetFocus(hWnd);
		ShowWindow(hWnd, SW_SHOWNORMAL);
		SetWindowPos(hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE);
		SetWindowPos(hWnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE);
		SetForegroundWindow(hWnd);
		AttachThreadInput(dwCurID, dwForeID, FALSE);

or

	HWND hwnd = FindWindow(NULL, L"NewVision VC Desktop");
    ShowWindow(hwnd, SW_NORMAL)

 

 

 

你可能感兴趣的:(qt)