Changing window size/location for child process w/.Net

  • Thread starter Thread starter Steve Ricketts
  • Start date Start date
S

Steve Ricketts

I'd like to start a process and then change the window location and size at
various times during its life in a .Net (sans user32.dll). I can get the
window handle easy enough but I don't know what to do next to replace the
GetWindowRect and MoveWindow DllImports.

mediaPlayer.FileName = "mplayer";
mediaPlayer.Start();
mediaPlayer.WaitForInputIdle();
IntPtr hWin = mediaPlayer.MainWindowHandle;

GetWindowRect(hWin, out rect); // <- what is
..Net equivalent?
MoveWindow(hWin, left, top, width, height, true); // <- what is .Net
equivalent?

sr
 
Steve said:
[...]
GetWindowRect(hWin, out rect); // <-
what is ..Net equivalent?
MoveWindow(hWin, left, top, width, height, true); // <- what is .Net
equivalent?

I don't think there is a .NET equivalent. If you want to do something
like that, you'll have to use the native API you're used to using, via
p/invoke.

Pete
 
Humm... probably should have said I was running this in Mono on Linux... ;-)
Back to the drawing board!

Thanks for the reply Peter!

sr

Peter Duniho said:
Steve said:
[...]
GetWindowRect(hWin, out rect); // <- what
is ..Net equivalent?
MoveWindow(hWin, left, top, width, height, true); // <- what is .Net
equivalent?

I don't think there is a .NET equivalent. If you want to do something
like that, you'll have to use the native API you're used to using, via
p/invoke.

Pete
 
Steve said:
Humm... probably should have said I was running this in Mono on Linux...
;-) Back to the drawing board!

Um. Can you run Mono under Wine? :)

Anyway, I don't know much about Mono, but hopefully it's got _some_ kind
of interop API that you can use in lieu of the Windows p/invoke stuff.

Pete
 
Back
Top