4

I'm trying to write a program that will output window positions/size using C# .Net Core. I've done this for Windows using the PInvoke nuget package that essentially uses User32 dll. I'm trying to do the same thing but for linux distribution.

Does anyone know anything about this or are they able to point me in the right direction? I've downloaded the Xlib nuget package but I'm not really able to figure out how to use it.

I imagine on Linux that I can get all the pointers using Process.MainWindowHandle, but then I'm not exactly sure what APIs I need to pass these handles to in order to get the RECT object back.

I'd like to do something similar to what xdotool does in terms of GetWindowGeometry, but within my c# application.

Thanks guys!

Gooby200
  • 41
  • 3

1 Answers1

0

You would need to use XGetWindowAttributes and XGetGeometry.

C# usage examples:

mfkl
  • 1,914
  • 1
  • 11
  • 21