3

When my application exits, the Windows "Program Compatibility Assistant" appears. I want to not have that window appear when my application terminates.


This is the solution by my problem http://msdn.microsoft.com/en-us/library/dd371711(v=vs.85).aspx I added custom manifest.

Dori
  • 915
  • 1
  • 12
  • 20
Kar
  • 31
  • 2

1 Answers1

3

If you're seeing this dialog, one of two things can be happening:

  1. Your program was detected as an installer, and Windows is offering to elevate the installer for you. There's little you can do about this, because this elevation check is heuristically determined by the filename. If your program contains "setup", "instal" (yes, a single l), or a few others in it's filename, the dialog will appear, and there's nothing you can do about it.
    EDIT: Apparently there might be a way around this... see comments.

  2. Alternately, you could be calling some API that is deprecated for the current version of Windows, or calling some API incorrectly, triggering compatibility heuristics. If this is the case, you just have to find the place in your program which is triggering the heuristic. You can use the Application Compatibility Toolkit (ACT) to determine what's triggering the dialog, IIRC.

There's no way to just "disable" this dialog -- you have to fix what's triggering it in the first place to make it go away.

Billy ONeal
  • 104,103
  • 58
  • 317
  • 552
  • If it's #1, then you'll be OK if you have a requestedExecutionLevel tag in your manifest. The heuristic is only applied if there is no manifest or if the manifest doesn't specify the requestedExecutionLevel. – Adrian McCarthy Jun 14 '11 at 20:41
  • @Adrian: Would you care to put steps for doing that into an answer? – Billy ONeal Jun 14 '11 at 20:49
  • Instructions on how to add requestedExecutionLevel to your application's manifest: http://msdn.microsoft.com/en-us/library/bb756929.aspx – Adrian McCarthy Jun 16 '11 at 23:50
  • @Adrian: Main reason I was asking for you to put that in an answer is so that we can upvote it :) – Billy ONeal Jun 16 '11 at 23:53