dotnet / pinvoke

A library containing all P/Invoke code so you don't have to import it every time. Maintained and updated to support the latest Windows OS.
MIT License
2.12k stars 222 forks source link

Added GetProcessId() #360

Closed ghost closed 6 years ago

ghost commented 6 years ago

I needed that function. You can get the process id of a process by specifying a process handle.

ghost commented 6 years ago

@AArnott That seems to have worked now, but I got another question. I want to add DwmExtendFrameIntoClientArea in the DwmApi.

SigImp doesnt find this function, but since there is a HResult already defined that should be no problem on the return value. But what about the MARGINS structure which is defined in the PInvoke.UxTheme library. DwmApi doesnt reference this library so it doesnt know this structure. Could you give me a hint on what to do here?

AArnott commented 6 years ago

what about the MARGINS structure which is defined in the PInvoke.UxTheme library. DwmApi doesnt reference this library so it doesnt know this structure.

Generally we approach such questions starting with this: "How is this handled in native code?" If DwmApi.dll clients typically import uxtheme headers, then it is reasonable for dwmapi.dll to reference uxtheme.dll.

ghost commented 6 years ago

Wtf am I dumb

AArnott commented 6 years ago

thanks