Select a window

Hello everybody,
With PowerShell I could select windows opened on directories like this :

$a = New-Object -com "Shell.Application"; $b = $ | select-object HWND, LocationName; $b;

OK, but then I should like to reduce the windows (or I should like to do tests by changing the dimensions).
I found a script that does this :

Oh well, I was happy I had everything needed …
Hum, let us calm down : this script needs the handle of the window. So, I sent the hWnd, and told it look at that it is the handle.
Oh it was not happy with that.
There is the possibility to use a IWin32Window to convert the hWnd to a handle, but I am pretty sure it is not the most direct way of doing it, as the Windows APIs use hWnds, not handles.
Must I write myself a PowerShell function that calls the Windows APIs to manage windows from hWnds, or did anybody already do it and I have only to download ?