AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

WinSAT

Ein Thema von Razor · begonnen am 5. Okt 2009 · letzter Beitrag vom 7. Okt 2009
Antwort Antwort
Seite 1 von 2  1 2      
Razor
(Gast)

n/a Beiträge
 
#1

WinSAT

  Alt 5. Okt 2009, 17:16
Hello!

I am asking becouse there isnt no examples in delphi if there were i wouldnt even ask..


I am using win 7 so i decided to add WinSAT ability to my program so i found this example on MSDN.But its really confusing i c/c++
or c# dont really now.Could someone explain it to me what it does.

i installed winsat library via type import in delphi 2009.So i thought it was easy to do i decided to give it a try....

Delphi-Quellcode:
CInitiateWinSAT1.Create(SELF);
CInitiateWinSAT1.DefaultInterface.InitiateFormalAssessment({what goes in here delphi says a constant wich constant!},nil
)

Zitat:
C++
Code:
HRESULT InitiateFormalAssessment(
  [in, optional] IWinSATInitiateEvents *pCallbacks,
  [in, optional] HWND callerHwnd
);
Parameters
pCallbacks [in, optional]
An IWinSATInitiateEvents interface that you implement to receive notification when the assessment finishes or makes progress. Can be NULL if you do not want to receive notifications.

callerHwnd [in, optional]
The window handle of your client. The handle is used to center the WinSAT dialog boxes. If NULL, the dialog boxes are centered on the desktop.

[quote]
  Mit Zitat antworten Zitat
Razor
(Gast)

n/a Beiträge
 
#2

Re: WinSAT

  Alt 5. Okt 2009, 18:30
Some progress i also included the pass file for other to see if it works.WIN7/VISTA is a must to test this.
This hopfully will start the winsat routine.


Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject);
var
  i:IWinSATInitiateEvents;
  k:_RemotableHandle;
  l:hresult;
  s:string;
begin
  CInitiateWinSAT1.Create(SELF);

  CInitiateWinSAT1.DefaultInterface.InitiateFormalAssessment( i,k) ;
  i.WinSATComplete(l,pchar(s));
end;
Good news Leute this works as it turns off Aero and writes XML to the system.

[edit=mkinzler]Delphi-Tag eingefügt Mfg, mkinzler[/edit]
Angehängte Dateien
Dateityp: pas winsatlib_tlb_287.pas (127,3 KB, 13x aufgerufen)
  Mit Zitat antworten Zitat
mkinzler
(Moderator)

Registriert seit: 9. Dez 2005
Ort: Heilbronn
39.851 Beiträge
 
Delphi 11 Alexandria
 
#3

Re: WinSAT

  Alt 5. Okt 2009, 19:06
Why turning off Aero?
Markus Kinzler
  Mit Zitat antworten Zitat
Razor
(Gast)

n/a Beiträge
 
#4

Re: WinSAT

  Alt 5. Okt 2009, 19:07
Well you know when you start WinSAT or Perfomance Index crap it turns it off to analyze your system if its compatible
It stops at that line wich is comented why is that widestring > pchar or what?
Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject);
var
i:IWinSATInitiateEvents;
k:_RemotableHandle;
v:integer;
s:widestring;
begin


CInitiateWinSAT1.Create(SELF);
CInitiateWinSAT1.DefaultInterface.InitiateFormalAssessment( i,k) ;
    i.WinSATComplete(v,pchar(s)); //<here it stops and why? WINSAT_STATUS_COMPLETED_SUCCESS 0x40033
  
    if v=$40033 then
    showmessage('no');

end;
  Mit Zitat antworten Zitat
mkinzler
(Moderator)

Registriert seit: 9. Dez 2005
Ort: Heilbronn
39.851 Beiträge
 
Delphi 11 Alexandria
 
#5

Re: WinSAT

  Alt 5. Okt 2009, 19:13
Use String instead of WideString
Markus Kinzler
  Mit Zitat antworten Zitat
Razor
(Gast)

n/a Beiträge
 
#6

Re: WinSAT

  Alt 5. Okt 2009, 19:16
Yes but it still holds.It only stops at the line when i try to check for status did it pass or fail.

http://img.techpowerup.org/091005/Capture020901.jpg
  Mit Zitat antworten Zitat
mkinzler
(Moderator)

Registriert seit: 9. Dez 2005
Ort: Heilbronn
39.851 Beiträge
 
Delphi 11 Alexandria
 
#7

Re: WinSAT

  Alt 5. Okt 2009, 19:22
CInitiateWinSAT1 := CoCInitiateWinSAT.Create;
Markus Kinzler
  Mit Zitat antworten Zitat
Razor
(Gast)

n/a Beiträge
 
#8

Re: WinSAT

  Alt 5. Okt 2009, 19:25
Gives the same result as mine.But it works it functions.But the checking procedure fails.If i want to check for the STATUS.
  Mit Zitat antworten Zitat
Razor
(Gast)

n/a Beiträge
 
#9

Re: WinSAT

  Alt 5. Okt 2009, 20:17
Sorry for double post but i think i found the couse.I need only this and then i got it
Its bascily a function for tracing the progress and after the progress ends.

Delphi-Quellcode:
// *********************************************************************//
// Interface: IWinSATInitiateEvents
// Flags: (0)
// GUID: {262A1918-BA0D-41D5-92C2-FAB4633EE74F}
// *********************************************************************//
  IWinSATInitiateEvents = interface(IUnknown)
    ['{262A1918-BA0D-41D5-92C2-FAB4633EE74F}']
    function WinSATComplete(hresult: HResult; strDescription: PWideChar): HResult; stdcall;
    function WinSATUpdate(uCurrentTick: SYSUINT; uTickTotal: SYSUINT; strCurrentState: PWideChar): HResult; stdcall;
  end;
Delphi-Quellcode:
var
i:IWinSATInitiateEvents;
k:_RemotableHandle;
q:CoCInitiateWinSAT ;
v:integer;
s:string;
implementation

{$R *.dfm}

 procedure TForm1.FormCreate(Sender: TObject);
begin
CInitiateWinSAT1.Create(self);
CInitiateWinSAT1.DefaultInterface.InitiateFormalAssessment( i,k) ;
end;

procedure TForm1.Timer1Timer(Sender: TObject);
var
itotal,icurrent:integer;
sa:string;

begin

i.WinSATUpdate(icurrent,itotal,pchar(sa)) ; //CODE HALTS HERE !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
if itotal>0 then
progressbar1.Position:=100*icurrent div itotal;

end;
end;
  Mit Zitat antworten Zitat
mkinzler
(Moderator)

Registriert seit: 9. Dez 2005
Ort: Heilbronn
39.851 Beiträge
 
Delphi 11 Alexandria
 
#10

Re: WinSAT

  Alt 5. Okt 2009, 20:25
@Razor: Remember, you can edit a post for 24 hours!
Markus Kinzler
  Mit Zitat antworten Zitat
Antwort Antwort
Seite 1 von 2  1 2      


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 02:45 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz