PBOSL Process

Windowsspezifisches Forum , API ,..
Beiträge, die plattformübergreifend sind, gehören ins 'Allgemein'-Forum.
broozar
Beiträge: 97
Registriert: 08.03.2010 15:53
Wohnort: Berlin
Kontaktdaten:

Re: PBOSL Process

Beitrag von broozar »

verzeihung, ist so ein automatismus bei mir.

danke, aber ich bin immernoch auf dem holzweg. ich benutze jetzt
SetRights("SeDebugPrivilege")
aber hinten kommt immer noch ein "Unknown Process" raus. ich hab das als erste zeile in die GetProcessFileName2(PID) Procedure gepackt, testweise in meine helper function die ich aufrufe, ohne erfolg. habe auch MSDN bemüht, aber die c++ samples sind mir zu hoch.

bin noch über #PROCESS_ALL_ACCESS bei OpenProcess_() gestolpert, keine änderung.
iMac 27" quad i7 radeon 4850 8gig ram
PB 4.4 in parallelsVM @ 2 cores 3072megs ram 32megs vram win7
Benutzeravatar
edel
Beiträge: 3667
Registriert: 28.07.2005 12:39
Computerausstattung: GameBoy
Kontaktdaten:

Re: PBOSL Process

Beitrag von edel »

Versuch mal das hier :

Code: Alles auswählen

Structure PROCESSINFO
  SnapShot.i
  ProcessEntry.PROCESSENTRY32
  firstrun.i
EndStructure

Global _ExamineProcessInfo.PROCESSINFO

Procedure.i NextProcess()
  
  If _ExamineProcessInfo\firstrun
    _ExamineProcessInfo\firstrun = #False
    ProcedureReturn #True
  EndIf
  
  If Process32Next_(_ExamineProcessInfo\SnapShot, _ExamineProcessInfo\ProcessEntry)    
    ProcedureReturn #True
  EndIf
  
  ProcedureReturn #False
  
EndProcedure

Procedure.s GetProcessName()
  ProcedureReturn PeekS(@_ExamineProcessInfo\ProcessEntry\szExeFile)
EndProcedure

Procedure.i GetProcessPID()
  ProcedureReturn _ExamineProcessInfo\ProcessEntry\th32ProcessID
EndProcedure

Procedure.i ExamineProcess()
  
  Protected result.i
  
  If _ExamineProcessInfo\SnapShot
    CloseHandle_(_ExamineProcessInfo\SnapShot)
  EndIf
  
  _ExamineProcessInfo\firstrun = #True
  
  _ExamineProcessInfo\SnapShot = CreateToolhelp32Snapshot_(#TH32CS_SNAPPROCESS,#Null)
  
  If _ExamineProcessInfo\SnapShot
    
    ClearStructure(_ExamineProcessInfo\ProcessEntry, PROCESSENTRY32)
    
    _ExamineProcessInfo\ProcessEntry\dwSize = SizeOf(PROCESSENTRY32)
    
    result = Process32First_(_ExamineProcessInfo\SnapShot, _ExamineProcessInfo\ProcessEntry)
    
  EndIf 
  
  ProcedureReturn result
EndProcedure

If ExamineProcess()
  
  While NextProcess()
      ip = GetProcessPID()
      name$ = GetProcessName()
    
      Debug Str(ip)+"    "+ name$
      
    
  Wend
  
EndIf
broozar
Beiträge: 97
Registriert: 08.03.2010 15:53
Wohnort: Berlin
Kontaktdaten:

Re: PBOSL Process

Beitrag von broozar »

wow, ich danke dir. klappt hervorragend!
iMac 27" quad i7 radeon 4850 8gig ram
PB 4.4 in parallelsVM @ 2 cores 3072megs ram 32megs vram win7
Antworten