>Hello!
>I am using automation to open a word reference inside a VFP program.
>
>The object is created, the document is opened and object released. The document is open in 'Preview' mode, and though the release has occurred, the user may minimize to continue working with the VFP app, and then click the taskbar control to maximize.
>
>VARTYPE returns "U" (the object has been released), However "FindWindow" will return a number (hWnd?) for the document caption.
>
>If the document is minimized, and user selects to open it from a control in VFP, rather than the taskbar, I'd like to be able to maximize it. Since there is no reference available, I thought that I could maximize it using the hWnd from FindWindow:
>nhWnd.Windowstate=0 (or sumpin like that), but I get a 1429 stating that hWnd is not an object.
>
>Any ideas appreciated.
>
>Terry
Terry,
If you know the window handle (I would save it when I launched and made word active) you could call :
#define SW_NORMAL 1
#define SW_MAXIMIZE 3
#define SW_MINIMIZE 6
#define SW_RESTORE 9
declare short ShowWindow in win32API integer hWnd, integer nCmdShow
ShowWindow(nHwnd, SW_MAXIMIZE)
You migh get obj.ref with GetObject(,'Word.application') but I wouldn't suggest you to do.
Cetin