-
Fototrend

Új hozzászólás Aktív témák
-
válasz
pmonitor
#16505
üzenetére
Futtattam pénteken egy tesztet: ~300K process indításból csak kb 3000 egyedi PID volt. HWND egyezést csak egyet sikerült előidéznem, azt közvetlenül a gép újraindítása után.
C# (form) kód:using System;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using System.IO;
namespace pidtest {
public partial class Form1 : Form {
[DllImport("user32.dll", SetLastError = true)]
static extern uint GetWindowThreadProcessId(IntPtr hWnd, out uint processId);
public Form1() { InitializeComponent(); }
private void Form1_Load(object sender, EventArgs e) {
try {
uint pid;
IntPtr hwnd = Handle;
GetWindowThreadProcessId(Handle, out pid);
using (StreamWriter w = File.AppendText(@"c:\temp\pidtest.txt")) {
w.WriteLine("{0} {1}", pid.ToString(), hwnd.ToString());
} }
finally { Close(); }
}
}
}
python teszter:import os
a=0
f=open("c:/temp/pidtest.txt","r");A=f.readlines()
while 1:
os.startfile("c:/temp/pidtest.exe")
A+=f.readlines()
if len(A) != len({*A}): break
if a%100==0:
B,C=zip(*[a.split()for a in A])
D,E={*B},{*C}
print(f'Items: {len(B)} - Unique: {len(D)} PID, {len(E)} HWND', end='\r', flush=1)
a+=1
f.close()
Új hozzászólás Aktív témák
● olvasd el a téma összefoglalót!
- AKCIÓ! Gigabyte B760M i3 12100F 16GB DDR4 512GB SSD RTX 2060 Super 8GB ADATA XPG Valor Air 600W
- Apple Watch Ultra 2 - Black - Akku:100% - Jótállás: 2028.05.29-ig
- Számítógép javítás Budapest Laptop szerviz WiFi és router beállítás
- Lenovo ThinkPad L14 Gen 4 - 14" - Ryzen 5 pro 7530U, 16-32GB RAM, SSD, jó akku, számla, 6 hó gar
- AKCIÓ! Intel Core i7 8700 6 mag 12 szál processzor garanciával hibátlan működéssel
Állásajánlatok
Cég: Laptopműhely Bt.
Város: Budapest

