Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to close webbrowser form with Esc key
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Database:
Informix
Divers
Thread ID:
01124304
Message ID:
01124936
Vues:
11
>See Q176400, if is OLE control activated :-(

MartinJ,

thank you. I tried it but Esc key does not close the form.
Also, all menu hotkeys do not work if Web browser has focus.
public loform
loform=createobject("form1")
loform.show()

DEFINE CLASS form1 AS form
DoCreate = .T.
dworigwindproc = 0

ADD OBJECT obrowser AS olecontrol WITH ;
		Name = "oBrowser", ;
		Height = 306, ;
		Width = 567

PROCEDURE Init

this.obrowser.navigate("http://www.google.com")
Declare integer GetFocus in user32.dll
LOCAL nhwnd
nhwnd= GETFOCUS()

#define GWL_WNDPROC         (-4)
#define WM_KEYDOWN                      0x0100
#define WM_KEYUP                        0x0101
#define WM_CHAR                         0x0102

DECLARE integer GetWindowLong IN WIN32API ;
		                  integer hWnd, ;
		                  integer nIndex

DECLARE integer CallWindowProc IN WIN32API ;
		                  integer lpPrevWndFunc, ;
		                  integer hWnd,integer Msg,;
		                  integer wParam,;
		                  integer lParam

this.dwOrigWindProc =GetWindowLong(m.nHWnd,GWL_WNDPROC)
BINDEVENT(m.nHWnd, WM_CHAR,this,"HandleMsg")
ENDPROC

PROCEDURE handlemsg
LPARAMETERS hWnd as Integer, msg as Integer, wParam as Integer, lParam as Integer
IF wParam=27
  thisform.Release()
  RETURN 0
  ENDIF 

RETURN CallWindowProc(this.dwOrigWindProc,hWnd,msg,wParam,lParam)
ENDPROC


PROCEDURE obrowser.Refresh
nodefault
ENDPROC

ENDDEFINE
Andrus
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform