Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Is there a way to get screen height * width ?
Message
 
À
29/12/1999 12:49:50
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00309284
Message ID:
00309946
Vues:
45
>George,
>Couldn't find Excel implementation but word for the moment :
>
*...
>If type("oWordDocument") = "U"
>    Public oWordDocument
>Endif
>If type("gHwndWord") = "U"
>    Public gHwndWord
>Endif
>
>Declare integer GetForegroundWindow in WIN32API
>Declare short IsWindow in WIN32API integer
>
>********************
>* Create word object
>********************
>If type("oWordDocument") = "O" ;
>        and type("gHwndWord") = "N" ;
>        and IsWindow(gHwndWord)	# 0 && Check if word window is alive
>    oWordDocument=getobject(, "Word.application")	&& Create word object
>Else
>    oWordDocument=createobject("word.application")	&& Create word object
>Endif
>********************
>* Create word object
>********************
>
>With oWordDocument
>    * ....
>    .visible = .t.			&& Show word app
>    .Activate				&& Make word active window
>Endwith
>gHwndWord = GetForegroundWindow()	&& Save word window handle
>Do while IsWindow(gHwndWord) # 0  && Wait while Word is alive
>Enddo
>Clear dlls
>oWordDocument=.Null.
Cetin

Thanks, Cetin. Part of my problem with GetObject() was that I was using my Is_Run32() function to get the window handle based on simple "Excel". What was happening was that this non-visible "Excel" window was being left behind after the FOR EACH oCell IN oRange...ENDFOR section. I should follow my own advice and use "Microsoft Excel". At any rate, even if it is open, it's occurred to me that, since a new document window is going to be spawned anyway (if one already exists. This is Office 2000, for any lurkers), any potential gain that would have been previously realized by using GETOBJECT() rather than CREATEOBJECT(), might very well be lost.
George

Ubi caritas et amor, deus ibi est
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform