Autor Beitrag
acnut
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 172
Erhaltene Danke: 3

Windows 7, Windows Vista, Windows XP, Ubuntu, Kubuntu, Pardus
Delphi 2010 SV, Java Editor, VS 2010 SV
BeitragVerfasst: Fr 28.05.10 21:32 
wie kann ich dienste in einer listivew auflisten und beenden

hab das hier probiert:
www.michael-puff.de/...s/EnumServices.shtml

aber das funktiooniert leider nicht(ich sehe nur chinesische oder japanische zeichen)


ist dieses code villeicht nicht mehr für windows 7 anwendbar?


mfg
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8554
Erhaltene Danke: 480

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Fr 28.05.10 22:44 
Mein Tipp: Du arbeitest mit Delphi2009 oder Delphi2010. Dort sind Chars WideChars und Strings UnicodeStrings. Der Code lädt aber die Ansi-Variante der Windows-Funktionen aus der Dll. Probier mal in diesem Teil

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
begin
  hLib := LoadLibrary('ADVAPI32.DLL');
  if hLib <> 0 then
  begin
    @EnumServicesStatus := GetProcAddress(hLib,'EnumServicesStatusA');
    if @EnumServicesStatus = nil then raise Exception.Create('EnumServicesStatusA');
    @OpenSCManager := GetProcAddress(hLib,'OpenSCManagerA');
    if @OpenSCManager = nil then raise Exception.Create('OpenSCManagerA');
  end;


Die A's durch W's zu ersetzen. Alternativ im Rest des Codes alle Chars durch AnsiChars und Strings durch AnsiStrings.

_________________
We are, we were and will not be.
acnut Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 172
Erhaltene Danke: 3

Windows 7, Windows Vista, Windows XP, Ubuntu, Kubuntu, Pardus
Delphi 2010 SV, Java Editor, VS 2010 SV
BeitragVerfasst: Sa 29.05.10 10:16 
danke funktioniert


mfg

---Moderiert von user profile iconNarses: Beiträge zusammengefasst---

Zitat:
ok funktioniert doch nicht ganz wenn ich das mit einem listbox mache sehe ich diesmal fragezeichen
aber mit memo funktioniert es


mfg


//funktioniert doch, hab einen pchar übersehen.


mfg