Einzelnen Beitrag anzeigen

Benutzerbild von nicodex
nicodex

Registriert seit: 2. Jan 2008
Ort: Darmstadt
286 Beiträge
 
Delphi 2007 Professional
 
#3

Re: Programme im Kompatibilitätsmodus ausführen!

  Alt 13. Nov 2008, 12:10
Setze vorher die Umgebungsvariable __COMPAT_LAYER.
Siehe http://www.microsoft.com/windowsxp/u.../layertip.mspx

Mit Hilfe von __COMPAT_LAYER kann man auch feststellen, ob das eigene Programm mit AppCompat-Layern ausgeführt wird.

Zum Lesen und Setzen der permantenten AppCompat-Layer (Dateieigenschaften) gibt es (meines Wissens nur) undokumentierte Funktionen (welche momentan die o.g. Registrywerte lesen/setzen):
Delphi-Quellcode:
interface

uses
  Windows;

const
  APPHELP_PERMLAYERS_LOCAL = $00000001;
  APPHELP_PERMLAYERS_GLOBAL = $00000002;
  APPHELP_PERMLAYERS_ALL =
    APPHELP_PERMLAYERS_LOCAL or
    APPHELP_PERMLAYERS_GLOBAL;

type
  TFNGetPermLayers = function(wszPath: LPCWSTR; wszBuffer: LPWSTR; var pdwBytes: ULONG; dwFlags: ULONG): BOOL; stdcall;

function GetPermLayers(wszPath: LPCWSTR; wszBuffer: LPWSTR; var pdwBytes: ULONG; dwFlags: ULONG): BOOL; stdcall;

type
  TFNSetPermLayers = function(wszPath, wszLayers: LPCWSTR; bGlobal: BOOL): BOOL; stdcall;

function SetPermLayers(wszPath, wszLayers: LPCWSTR; bGlobal: BOOL): BOOL; stdcall;

const
  AppHelpLib = 'apphelp.dll';

implementation

function GetPermLayers; external AppHelpLib;
function SetPermLayers; external AppHelpLib;

end.
  Mit Zitat antworten Zitat