Application window getting hide - windows

I have done multi threaded MFC application. App is running fine, but after some time PC window gets logged off with the given password to log in the PC. My application does not appear anywhere but process is running.
What could be the reason for this behavior?

Related

Is there a way to trick GUI applications in docker to think their window loaded?

I try to run an windows 10 application inside a windows servercore container.
The app can run without user input via COM-Interface (and without visible GUI), but it seems that it needs to load a hidden window in the background. When I start it on docker, the application log file indicates that it's stuck on starting this window.
Is there a way to make the app assume it successfully loaded the window?
All information I found so far was about users who want to see the GUI or about Linux/Windows combinations. None of that helped me.

How to capture exiting of Qt Application when shut down by debugger?

I am developing a GUI application in Qt 4.8.4 with Visual Studio 2010. I need to perform some cleanup work before my application closes so I have reimplemented the QWidget closeEvent in my MainWindow class to capture when the user either clicks X or when they select File->Exit from the menu. That works fine. The problem however is when I am running the application in the VS debugger and I use the debugger to shut down the application the close event doesn't get triggered. I can always just shutdown my application by clicking File->Exit or clicking X but sometimes I forget and shut down the debugger instead so it's really more of an annoyance. Is there a way to capture when the debugger shuts down my application?
Not that I know of.
The logic of it: the debugger is running a sandbox, and when it shuts down, the sandbox gets freed. Your application is running inside that sandbox - so when that sandbox gets freed/closed/destroyed, your app simply vanishes without any cleanup.

Popup application under citrix

We are planning to develop an application that will run as a windows service that reads a DB for entries on a timer interval basis. whenever an entry is found the service opens shows a popup in the system try, something like lync or ocs.
My question is whether it is possible to deploy the windows service and the popup application under citrix xen app?
Man thanks
Yes you can do that, but you need to keep in mind how those popups will be consumed by a XenApp user. In particular how is the popup app going to get started?
If your users are using published desktops then you can put your popup app in the startup folder of your users so it will always launch and be running and everything will work fine. However if your users are running published apps then you should have the popup app published and get your users to run this published app.

Selenium grid 2 over cygwin

Ok, this is a tricky one. I'm trying to set up a Selenium Grid 2 with some Windows 7 VMs to run Webdriver tests. To automatize the whole process I use some ant script that connects to the VMs through ssh to start/stop/reconfigure the nodes.
Everything works great, the nodes can register with the hub host and execute the test. Only problem is that I don't see any browser window during the test run. I can see the process and I see the test log being executed, but there is no graphical interface.
On the other hand, if I start the node manually through Windows, everything is normal.
I suppose the problem is that processes executed under cygwin cannot start Windows displays, but in that case, shouldn't throw an error? The other option I'm thinking is that Webdriver is using HTMLunit as a fallback, but then... why do I see the firefox process as long as the test lasts and consuming CPU and memory?
Through ssh, you only exchange with Windows stdin, stdout and stderr streams. The ssh connection is tunneling those streams and nothing else. You don't see Windows Desktop interface, but the Desktop object exists on the Windows machine, the programs (here the browsers) are connected to it, and all GUI interactions are live in there.
If the GUI doesn't require any user interaction, everything is fine that way. The dialog boxes are created, the program runs, once it finishes, the dialog boxes are destroyed by the application and the application closes. Nothing is blocking in terms of GUI our application.
If you program requires an user action in the created yet invisible dialog boxes, your program will be there waiting for your interaction to move forward. You will see the process in the task manager, doing nothing but waiting. As you don't have access to the Windows Desktop where the dialog boxes are created and virtually 'displayed', the program seems to hang.
A typical case 2 is if you remote run a program waiting for a user to do something, say notepad. You can launch notepad, it will be spawned and then it will wait for you to type some text or close it.
With your Selenium tests, you are in case 1: all the browsers' interactions needed to make the GUI working are actually done by Selenium server that does the navigation clicks and the program exit for you. Their GUI actually are living by browsing through your test web servers, you just don't see it.
Some further readings from Microsoft website on Desktops and Desktop Creation.
If you want to see the tests and have valid screenshots, you need to have a user logged in and those tests need to run as that user. Everything must run through that single desktop session, so you cannot use RDP to remotely connect to the machine. Your best bet is to use VNC, since that will connect to an already established session.

How to shutdown local tomcat server when closing browser window?

I hava a web app running on a local tomcat server.
When the user starts the app (via desktop shortcut) the server starts and the app is opened in a browser window.
But when the user just clicks on the close button to stop the application the server is still running in the background - that's annoying.
I tried to utilize the "unonload" and "onbeforeunload" events from javascript but unfortunately these events are also fired on some other requests in the app.
So I can't use them, except I do a lot of refactoring.
Does anyone have an idea for a possible solution?
Btw, what I find interesting is the behaviour of Visual Studio when debugging a web application. When I close the browser window Visual Studio also gets a trigger to stop debug mode. So it seems it somehow notices the close event of the browser window, which would be exactly what I need. But I don't know how they do it...
Can you wrap the starting of Tomcat and launching your app in a batch file or shell script? (Not sure what your target OS is...)
The script/batch file would start Tomcat and then launch your application. When the user exits your application, the script/batch file would then shut down Tomcat.
You can setup a short session timeout, and use a HttpSessionListener. On sessionDestroyed(..) you can stop tomcat (using catalina.bat for example) .
Otherwise you can try to detect browser close, and send a shutdown message to the server using ajax (before the browser is closed).

Resources