MFC Dialog disappearing while accessing application on Remote Desktop Connection - c++

I am using MFC dialog of style 'Popup', it also contains Tab Control. But dialog is disappearing while accessing the application on Remote Desktop Connection. Actually it is there, when I hover on it accidentally I see a tab but when I move my cursor somewhere else, it gets disappeared again. I have tried changing Dialog properties, but nothing is helping. Any ideas on how to solve this issue?

Try to use : invalidate();
That should work.

Related

Minimize, Maximize button disappear without any reason

It's a dialog based MFC application. I didn't intentionally add any code about the Minimize, Maximize and Restore button. It can show those button at the first. But it just disappear after long time running. Or maybe sleep of the computer causes this?
I have no idea about this, do you have any clue?
Edited:
Thanks #xMRi's remind, I checked its style, seems still to be right.
Listed below few possible reason & resolution may impact you application look. More specifically, your device manager plays important role in application appearance. I would say its environment or certain unnecessary application(Virus)installation issue rather than your MFC application issue.
Full Fix: Minimize, Maximize and Close Buttons Disappear
At least I know a way to restore the disappared system buttons.
ModifyStyle(0, WS_MINIMIZEBOX);
GetSystemMenu(FALSE)->InsertMenu(-1, MF_BYPOSITION, SC_MINIMIZE, _T("Minimize"));
Press F11 for Windows 10, or right-click on the application which you can't see windows button then choose view finally uncheck the full screen

CWnd::SetRedraw(False) make mouse go throught window

So I have a MFC application which flick when we do some action.
So I figured I would set SetRedraw(false) and set it to true at the end of the function.
The application doesn't refresh anymore but if I click on it while SetRedraw(false), my cursor is not catched by my application, it goes throught it and set focus on the application below.
Anyone has some kind of idea how I could fix that.
I ended up using CWnd::LockWindowUpdate instead after some research.
It freezes the update but doesn't act if the window was transparent.

Access visual components text, buttons in a Internet Explorer_TridentDlgFrame dialog

I have a C++ app that makes use of a Webbrowser component. When a certain URL is open I get an standard Script Error dialog. I inspected the dialog and found out its type is *Internet Explorer_TridentDlgFrame*.
What I need to do is to close that dialog window. I already added a Window Hook and on the
WM_SHOWWINDOW I compare the title of the window and close it by sending a WM_CLOSE message.
The problem with that approach is that I cannot distinguish this window from other windows with the same title. So, What I'd need to do is to be able to access the text and the buttons in the
*Internet Explorer_TridentDlgFrame* dialog, in order to filter using its text and then click its Yes button.
I know how to get the child components from standard dialogs but I do not how to do it with this *Internet Explorer_TridentDlgFrame* dialog type. When I inspect it with WinSpy I can see that all the visual elements inside this dialog are encapsulated in *Internet Explorer_Server* element.
Does someone know how to access the visual components on the *Internet Explorer_TridentDlgFrame* dialog?
Thanks in advance for your help!

Modal QMessageBox does not behave like native Windows dialogs

My application has a dialog that asks the user via a QMessageBox whether he wants to discard all changes he made or wants to keep editing. I want this dialog to be modal to the whole application.
I read somewhere that this is the standard behavior for a QMessageBox, so I dont have to set it explicitly with something like:
mbox.setWindowModality(Qt::ApplicationModal);
I wonder why it behaves differently from other modal dialogs in the OS (Windows 7 in my case). On the one hand it functions like it should, i.e. all other input methods in the application are blocked until the user answeres the dialog. However, it doesn't 'blink'* if the user clicks any other window of the application. Is there any way to get Qt to behave like a native Windows dialog?
Thanks in advance!
*If you don't know what I mean with this 'blinking': Just open notepad on a Windows OS, type some text and try to close it. A dialog pops up that asks to save, discard or keep editing. Now click somewhere on the editor window -> the border and titlebar of the dialog flashes/blinks a few times.
The problem arises when the message box has no parent. This works fine for me:
QMessageBox box(this);
box.setStandardButtons(QMessageBox::Close);
box.exec();
But this does not:
QMessageBox box;
box.setStandardButtons(QMessageBox::Close);
box.exec();
This makes sense... the message box can't blink unless it knows that its parent was clicked on.
A simple solution that comes into my mind and if you want to deploy your application only on windows you should #include <windows.h> and use the MessageBoxA API.
Besides that this works great for me in Windows and ubuntu
if (QMessageBox::question(this,"Close?","Close this dialog?",QMessageBox::Yes,QMessageBox::No) == QMessageBox::Yes)
{
this->close();
}

Popup windows are behind window but it is rendered front?

I am updating the webkit embeded to my program however I come across a new problem about popup windows (MessageBox or File/Folder chooser dialogs).
For instance, if I invoke a javascript alert() clicking on a link, the MessageBox is rendered in front of the webkit window and looks like it is clickable, however when it is clicked the webkit window gain the focus and the MessageBox goes back of the webkit window. After that everything works as usual.
This problem does not happens if I invoke the alert() with keyboard.
So given the clues, what could be the solution, any tips ?
OS: Win7
In win/webview.cpp WM_CANCELMODE message invokes a function. Comment out, problem is solved.