Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to reference 'released' Word object
Message
From
07/03/2002 13:22:48
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00629721
Message ID:
00629755
Views:
12
>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
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform