How to create this kind of GUI on windows - win32gui

There is a win7 application which can show a progress bar on the win7 task bar.
I was wondering how is it implemented. Is there any Win32 API can do this?

You should inhert CProgressCtrl class and redraw the control.
Handle WM_PAINT message as painting the control in OnPaint function.

Related

Qt Activex MainWindow on TabWidget becomes unresponsive

I have a very strange problem. The application is based on Qt C++. There is a TabWidget whose tabs are created dynamically. The tab contains QtMainWindow in ActiveX widget. When multiple apps are started, the selected one works fine. But when another tab is selected, it becomes unresponsive.
When I minimize the Application and then maximize again then the tab starts working fine. I tried with setFocus, activateWindow, showNormal and setActiveWindow but nothing is working.
Can somebody help me in this issue?
The likeliest cause of the app becoming unresponsive is something that stalling the execution on the main thread. With running the project from/ or attaching to Visual Studio debugger (better debugger than the one used by Qt Creator) try to get your app in such unresponsive state. Now look at Main Thread in Threads view (select one), also look at Call Stack view. Where does the execution stall?
The log in Output View is also helping to recreate the context of how to get there. You can see Qt and your own debug output there.
While debugging I found that the App was not syncing because of missing WA_Mapped attribute. My problem was just opposite of the below issue. When I used to maximize after minimize, the App used to become responsive. Finally setting the attribute WA_Mapped at different places (trial n error) fixed the issue.
widgets freezing after minimise window
Thanks for #AlexanderVX response.

How to display a QMessageBox on top of all windows

I have created a program that runs alongside an application in fullscreen. I would like the QMessageBox from my program to be displayed on top of the application that runs in fullscreen.
The platform is Windows 7 and i am using Qt.
I have tried:
QMessageBox *msgBox = new QMessageBox;
msgBox->setParent(0);
msgBox->setWindowTitle(title);
msgBox->setText(text);
msgBox->setWindowFlags(Qt::WindowStaysOnTopHint);
msgBox->show();
With no luck. Any hints?
Try msgBox->raise(); will notify the user in taskbar, using setWindowFlags(Qt::WindowStaysOnTopHint); you eventually could make it stay on top (evtl. minimize/restore).
But a windowmanager, not depending on os, by design should not allow any application to just "steal" the focus from another application, therefor the user still needs to activate (click) your window for gaining focus.

error dialog box with Qt quick

i'm programming a Qt Quick application and I'm looking for a possibility to display the user errors. In Qt widgets there is QMessageBox but i can not find any equivalent to this in Qt Quick.
Sure i can create a MessageBox by myself but I can't imagine that there is no given possibility?
I found an ebook on the official site here and there is an Dialog described on page 67 but it doesn't work anymore and i can't find any further information about that. Is it dropped in the current version?
Thanks in advance
There is no Qt-Quick component for this yet. What I do in my application is using the Window QML component. I set the modality property to Qt.WindowModal to have it as a modal Window. You can then use the Button component to create OK/Cancel buttons.
Another thing I do is create these modals dynamically when something wrong occurs using Qt.createComponent() in QML.
Edit: Just discovered a new Dialog component that will be released in Qt5.2 that seems to match what you are looking for: MessageDialog

JavaFX GUI release background task

I have a simple JavaFX window which display a message. When I call JavaFX application to display something it works, but the caller is blocked while the FX window is open. I want to display window but the background process should not be blocked. How can I do it?
Thanks for your help!
To do some background stuff and not freez you GUI, you have to use JavaFX Service.
Everything is explain here and here

A real top level window with Qt?

I use the last Qt version for a projet and QProcess. I want to lauch program from my application by using QProcess. I want to display a QGraphicsView transparent on full screen over the launched program.
For the moment: I hide the view, launch the program, sleep during 5 seconds and show the view. I want that my view keep the focus and stay on the top level? Is there any better way to do that? A custom setting for the QGraphicsView?
Create your QGraphicsView (or the window that contains it) with the Qt::WindowStaysOnTopHint flag
Once you run a program in QProcess, you have limited control over it. Qt does not provide details about other applications that are running, you won't know where the launched application is being displayed unless it tells you explicitly.
If you have access to the code of the application you're running, it is possible put a transparent overlay on top a given widget, or widgets, that could then record mouse clicks and other interactions. It's also possible to override events and record basic information about the application's use.

Resources