hyuri: (Default)
[personal profile] hyuri
the biggest problem with .NET still seems to be the reduced functionality of the [safe] managed libraries vice [unsafe] P/Invoke. take, for example, FindWindow: you can specify the window's class, its title[/caption], or both, and get back a singular result. the nearest .NET-native equivalent is System.Diagnostics.Process.GetProcessesByName, which takes a process name (the executable filename, limited to 15 characters) and optionally a remote machine name/address (?!), and returns an array of matching processes. alternatively you can use System.Diagnostics.Process.GetProcessById - if you know the [locally unique, dynamically assigned] numeric process ID.

oh, but apparently you can duplicate the behavior of FindWindow: you just call System.Diagnostics.Process.GetProcesses and iterate through every process on the machine! seriously: what? and it gets even better, because apparently Process instances aren't necessarily destroyed once they complete. so part of that array may not even exist anymore.

Profile

hyuri: (Default)
hyuri

November 2014

S M T W T F S
      1
2345678
9101112131415
161718192021 22
23242526272829
30      

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jan. 24th, 2026 11:10 am
Powered by Dreamwidth Studios