Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Go Back   Foros Club Delphi > Principal > API de Windows
Register FAQ Members List Calendar Guía de estilo Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 05/11/2011
MAXIUM's Avatar
MAXIUM MAXIUM is offline
Miembro
 
Join Date: May 2005
Posts: 1,503
Poder: 23
MAXIUM Va camino a la fama
Exclamation ¿Como usar este código?

Encontré este código, pero no me dice que USES debo usar (algo común cuando publican código...)

Código Delphi [-]
procedure  GetListInstalledUpdates;
var
  updateSession        : OleVariant;
  updateSearcher       : OleVariant;
  updateSearchResult   : OleVariant;
  updateEntry          : OleVariant;
  UpdateCollection     : OleVariant;
  oEnum                : IEnumvariant;
  iValue               : LongWord;
begin
  updateSession:= CreateOleObject('Microsoft.Update.Session');
  updateSearcher := updateSession.CreateUpdateSearcher;
  Writeln('Searching');
  //IUpdateSearcher::Search Method http://msdn.microsoft.com/en-us/library/aa386526%28v=VS.85%29.aspx
  updateSearcher.online:=False;
  updateSearchResult:= updateSearcher.Search(Format('IsInstalled = 1 and Type=%s',[QuotedStr('Software')]));
  UpdateCollection  := updateSearchResult.Updates;
  oEnum         := IUnknown(UpdateCollection._NewEnum) as IEnumVariant;
  //IUpdate Interface http://msdn.microsoft.com/en-us/library/aa386099%28v=VS.85%29.aspx
  while oEnum.Next(1, updateEntry, iValue) = 0 do
  begin
    Writeln(updateEntry.Title);
    updateEntry:=Unassigned;
  end;
  Writeln('Done');
end;
Reply With Quote
  #2  
Old 05/11/2011
[maeyanes] maeyanes is offline
Capo de los Capos
 
Join Date: May 2003
Location: Campeche, México
Posts: 2,732
Poder: 26
maeyanes Va por buen camino
Hola...

Como mínimo, agrega estas 3 unidades: ActiveX, ComObj y Variants.


Saludos...
__________________
Lee la Guía de Estilo antes que cualquier cosa. - Twitter
Reply With Quote
  #3  
Old 05/11/2011
MAXIUM's Avatar
MAXIUM MAXIUM is offline
Miembro
 
Join Date: May 2005
Posts: 1,503
Poder: 23
MAXIUM Va camino a la fama
Gracias!!!

Last edited by MAXIUM : 05/11/2011 at 04:10.
Reply With Quote
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Como implementar este codigo en delphi 7 freddiaz07 Internet 4 16/09/2011 22:34
Como Represento Este Codigo bothy Lazarus, FreePascal, Kylix, etc. 2 12/02/2010 06:34
como modificar este codigo kurono Varios 9 19/10/2008 18:08
como asignarle los componente dialogs a este codigo kurono Varios 4 12/04/2008 08:36
como mejorar este codigo... sumando campos Goyo Varios 3 19/05/2007 00:07


All times are GMT +2. The time now is 20:11.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi