May be we should change that next time it's possible.
But you can retrieve the native window handle (e.g. HWND on windows).

Cast the window to the interface css.awt.XSystemDependentWindowPeer
and call it's method getWindowHandle(). The parameter ProcessId can be ignored (use an empty array) ... but the second parameter SystemType must be from type css.lang.SystemDependent.

The return value itselfs depend from the used SystemType parameter.
Please read the document of the interface.

Here a basic macro, which shows the needed steps:

sub maximize

    frame  = StarDesktop.getActiveFrame()
    window = frame.getContainerWindow()
    handle = window.getWindowHandle(dimarray(), 1) ' 1=WIN32
    msgbox handle

end sub



Andreas

Thanks for you response.

I took your code and added this:

Declare Function ShowWindow Lib "user32" _
   (ByVal lHwnd As Long, _
   ByVal lCmdShow As Long) As Boolean

sub MaxWindow
   dim frame
   dim window
   dim handle
frame = StarDesktop.getActiveFrame()
   window = frame.getContainerWindow()
   handle = window.getWindowHandle(dimarray(), 1) ' 1=WIN32
   'msgbox handle
   ShowWindow( handle, 3 )
end sub

Now, if I call this with a Writer, Calc, Draw or Impress document open it works wonderfully.

However, what I wanted to do was use this to maximize a data entry form from a Base database file. When I do that I receive a runtime error, or
unintended action.

If any of the other types of documents are open, as well as the data entry form, then this other document is actually maximized. If the data entry form is the only one open, then an error is generated "Object Variable not set" - on the "Frame" variable. Interestingly enough after the first error you can
run it again, and the Basic IDE frame will be maximized.


Andrew

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to