Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
GdiPLusX Drawing on a form with scrollbars
Message
De
17/12/2007 04:43:10
 
 
À
16/12/2007 08:31:45
Information générale
Forum:
Visual FoxPro
Catégorie:
VFPX/Sedna
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP1
Divers
Thread ID:
01276096
Message ID:
01276218
Vues:
34
Hi Sergio,

I'm glad to know it worked !
Realy strange that the way below did not work...

>>>>
LOCAL lnHWnd
>>>>IF Thisform.ShowWindow = 2 && TopLevel Form
>>>>	lnHWnd=SYS(2327, SYS(2325, SYS(2326,Thisform.HWnd))) && From Craig Boyd
>>>>ELSE
>>>>	lnHWnd = Thisform.HWnd
>>>>ENDIF
My conclusion is that when scrollbars are added to a form, a new client window is inserted in it, and creates the confusion of handles...


Here's a simpler way. The code below will return the drawing handlewhatever kind of form you are dealing with:

Add the code to your INIT(), in order to obtain the correct handle, stored in the property "RealHWND"
#DEFINE GW_CHILD 5 
DECLARE LONG GetWindow IN User32 LONG HWND, INTEGER nIndex 
Local lnHwnd 
lnHWND = Thisform.HWND

DO WHILE .T.
	lnClientHwnd = GetWindow(lnHWND, GW_CHILD)
	IF lnClientHWND = 0
		lnClientHWND = lnHWND
		EXIT
	ENDIF
	lnHWND = lnClientHWND
ENDDO
Thisform.AddProperty("RealHWND", lnHWND)
Hope this helps !
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform