PDA

View Full Version : How to minimize a window to the taskbar



mooreaa
13th April 2011, 04:09
Hello,

I am working on an application that has a console window for debugging. I want a mechanism to minimize the console window on statup to the taskbar.

In the past when i did this without QT, I would do something like:
HWND hwnd = GetConsoleWindow();
ShowWindow(hwnd, 0);

What is the best way to do this?

wladek
13th April 2011, 06:43
Hi mooreaa,

Are you using a QApplication or just a QCoreApplication to run your app?
If you are using the first one, then, when creating the main window of the application (QWidget::isWindow) we can show it minimized by using QWidget::showMinimized.

If you are not using any UI and only QCoreApplication,...then I do not have the answer for you.

Regards,
wladek

mooreaa
14th April 2011, 02:24
I'm running a QApplication with a console. Ideally I would like to show/hide the console window via a flag or option but for now I'm just trying to keep the window minimized on launch.

For now I've just set the main app to showMaximized to make it fill up the screen but am still looking for a resolution if anyone has suggestions.