Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can I launch vb in a window from vfp
Message
From
08/09/2003 17:19:17
Gary Foster
Pointsource Consulting LLC
Chanhassen, Minnesota, United States
 
 
To
08/09/2003 16:30:47
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00827140
Message ID:
00827294
Views:
15
Here is one way to do it. I used to use this to pop up VFP data entry forms within VB and C++ apps so they could do some databased work with a real database tool.


*-- Down and dirty window parent setting

*-- Launch the VB app with ShellExecute or CreateObject, etc.

*-- Declare the API functions
DECLARE integer FindWindow IN WIN32API STRING, STRING
DECLARE INTEGER SetParent IN WIN32API integer, integer

*-- Get the window handle of a running application.
*-- FindWindow() is a quick way if you know the window title.
*-- It has to be the exact title of the window.
*-- EXAMPLE -> hWord = FindWindow(0,"MyDoc.doc - Microsoft Word")
hWord = FindWindow(0,"MyVB Apps Window")

*-- Call SetParent() with the window handle of the window to move and the
*-- parent window, in this example, VFP itself.
SetParent(hWord, _vfp.hWnd)

Gary


>By "launching within a window" I mean a visual foxpro window. Just as one can do with the Web browser control. Launching internet explorer within a vfp window.
>
>I want it to be contained inside a vfp window. Not just launching it as an external program.
Previous
Reply
Map
View

Click here to load this message in the networking platform