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.
This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

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 03:20 pm
Powered by Dreamwidth Studios