0

I am programming in C++ using Qt (on Windows), I have a GUI application that can be run on the command line so that users can schedule it to be run using Scheduled Tasks.

Everything was working fine (I think), except when a user tried to schedule the task with the "run when user is logged on or not" option is checked. In this instance the application would run fine, but not pop up the GUI.

I thought maybe my problem was similar to this: https://serverfault.com/questions/101671/scheduled-tasks-w-gui-issue

I thought I found the issue because my GetProcID call was returning a list of ProcessId's and I was only using the first one it returned, which caused some issues. That process ID was then passed to BringToForeground.

After this change it now brings up a transparent, or non-existent other than the application icon on some machines (basically every test except my 3 machines that can debug). Works exactly as required on my test machines.

The application works well if the GUI app is already running and you make the same call on the command line (it passes the call to that process to run). The app also works fine in normal UI mode, (no command line params passed)

UI after command line call

EDIT: Does anyone have any ideas what might cause this? I am thinking it has something to do with the app not starting on the correct Desktop, but don't have a ton of experience with those and have no idea where to even begin.

EDIT 2: Only seem to have the issue when it is run remotely, or through virtualization. (still confirming if this is truly the case)

Community
  • 1
  • 1
gollumullog
  • 1,249
  • 2
  • 14
  • 22
  • I was able to replicate on an old server 2000 machine (don't ask). keyboard commands work (to close message windows that you can't see), it shows up in the task window and the app bar, but you can't bring up the right click menu from the app bar. – gollumullog May 13 '15 at 21:11
  • I think, your problem is similar to this: http://stackoverflow.com/questions/53232/how-can-i-run-a-windows-gui-application-on-as-a-service . The solution here would be to split it into two: one, that can be launched as service, and the other, that will be launched on user login. – Amartel May 14 '15 at 08:00
  • Thank you for the comment, I think the issue is it is transparent whenever it is run on a remote machine or virtualization. I never have the problem when running it locally. – gollumullog May 21 '15 at 15:57

0 Answers0