locked
Pressing ALT-F4 to close printer device app causes an error message

    Question

  • I'm running with the "Device App For Printers C# Sample" program, and found a symptom I could not figure out:

    Here're the steps to duplicate the error:

    1.Compile and install "Device App For Printers C# sample", associate it with one of the inbox drivers.

    2.Launch IE (Windows Style edition), bring up the sample custom GUI by pressing "More settings" button.

    3.Click anywhere in the sample custom GUI (to make sure focus is in that custom GUI area), then press ALT-F4

    It then shows "Something went wrong and this app can't set print settings"/"Go back to continue printing" in several seconds.

    Is there any way to resolve this issue in the sample code?

    Thanks


    spider

    Tuesday, August 14, 2012 1:09 PM

Answers

  • Hi Edward,

    I wouldn't recommend trying to mitigate this. The difference between the default UI and your UI is that you are a hosted app, whereas the default UI is not. Since Alt-F4 closes the app with focus, that means your app gets closed. The hosting UI should probably be a little more informative, but since this is functional and doesn't cause data loss, I doubt we'll address it in the short term.

    Thanks!

    Justin

    Friday, August 24, 2012 5:27 PM

All replies

  • Can you reproduce this on RTM? If you connect a debugger do you see an exception?

    --Rob

    Thursday, August 16, 2012 7:47 PM
    Moderator
  • Hi Rob,

    Yes this can be seen in RTM too. No exception was captured in debugger. The GUI was closed immediately after pressing ALT+F4, and that error message(shown above) appeared in several seconds.

    Thanks


    spider

    Monday, August 20, 2012 2:08 PM
  • What behavior did you expect when you hit Alt-F4? That's historically meant "close application". I can repro the behavior by doing the same thing in any app that's open in a flyout (eg Share to Mail). This isn't a printer specific behavior.

    Tuesday, August 21, 2012 6:05 PM
  • Justin,

    Closing program via ALT+F4 is as expected. My question is: how to resolve the error message in that sample C# device app. Is there any solution to prevent the error message (or just ignoring ALT+F4 like default GUI does)?

    Thanks


    spider

    Tuesday, August 21, 2012 11:54 PM
  • Hi Edward,

    I wouldn't recommend trying to mitigate this. The difference between the default UI and your UI is that you are a hosted app, whereas the default UI is not. Since Alt-F4 closes the app with focus, that means your app gets closed. The hosting UI should probably be a little more informative, but since this is functional and doesn't cause data loss, I doubt we'll address it in the short term.

    Thanks!

    Justin

    Friday, August 24, 2012 5:27 PM