Einzelnen Beitrag anzeigen

Hedge

Registriert seit: 30. Jun 2007
278 Beiträge
 
Delphi 2009 Professional
 
#5

Re: Mehrere Superbareinträge für ein Programm

  Alt 21. Mai 2010, 19:45
An das PSDK habe ich auch gedacht.
Ohje...jetzt kompiliert es zwar durch, aber wird sofort ohne Fehlermeldung beendet.
Wie kann ich dem Fehler auf die Schliche kommen?

Delphi-Quellcode:
function PropVariantClear(pvar: PPropVariant): HRESULT; stdcall; external 'ole32.dll';
function InitPropVariantFromString(psz: PWideChar; out propvar: TPropVariant): HRESULT; stdcall; external 'ole32.dll';
function SHGetPropertyStoreForWindow(hwnd: HWND; const riid: TGUID; out ppv: IPropertyStore): HRESULT; stdcall; external 'Shell32.dll';


procedure TForm2.SetAppID(aHWND: hWnd; aAppID: string);
var pps,propsys:IPropertyStore ;
pv:tPROPVARIANT;
hr:HRESULT;
begin
 hr:= SHGetPropertyStoreForWindow (self.Handle , IID_IPropertyStore ,pps) ;
 if Succeeded( hr) then
   begin
     if aAppID <>'then
       begin
         hr:= InitPropVariantFromString(PWideChar(aAppID) ,pv);
       end
       else
       ZeroMemory(@pv,SizeOf(pv));
       if Succeeded(hr) then
         begin
           pps.SetValue(PKEY_AppUserModel_ID,pv);
           PropVariantClear(@pv);
         end;
   end;
end;
٩๏̯͡๏)۶
  Mit Zitat antworten Zitat