From: Steve Ricketts on
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

From: Peter Duniho on
Steve Ricketts wrote:
> [...]
> 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
From: Steve Ricketts on
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" <no.peted.spam(a)no.nwlink.spam.com> wrote in message
news:uU7fSup9KHA.3176(a)TK2MSFTNGP05.phx.gbl...
> Steve Ricketts wrote:
>> [...]
>> 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

From: Peter Duniho on
Steve Ricketts wrote:
> 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
 | 
Pages: 1
Prev: CLR Debugger
Next: Dsl Dial-up connection