Saludos a Todos
Necesito llamar aplicacion externa y esta deberá mostrarse dentro de mi aplicacion, si el usuario maxima la aplicacion externa debera hacerlo dentro de la ventana MDI de mi.
aplicacion
Agradecido por su valioso aporte.
LOCAL cComando
cComando := "h:\Desarrollo\Externo\NewProgram.exe"
WinExec( cComando )
ó
WaitRun( cComando )
karinha wrote:Intentas:
- Code: Select all Expand view RUN
LOCAL cComando
cComando := "h:\Desarrollo\Externo\NewProgram.exe"
WinExec( cComando )
ó
WaitRun( cComando )
Saludos.
#include "fivewin.ch"
#define SW_HIDE 0
#define SW_SHOWNORMAL 1
#define SW_SHOWMINIMIZED 2
#define SW_MAXIMIZE 3
#define SW_SHOWMAXIMIZED 3
#define SW_SHOWNOACTIVATE 4
#define SW_SHOW 5
#define SW_MINIMIZE 6
#define SW_SHOWMINNOACTIVE 7
#define SW_SHOWNA 8
#define SW_RESTORE 9
#define SW_SHOWDEFAULT 10
//------------------------------------//
ShellExecute( oDlg:hWnd, "open", cExe,,, SW_SHOWNORMAL )
karinha wrote:y con ShellExecute?
- Code: Select all Expand view RUN
#include "fivewin.ch"
#define SW_HIDE 0
#define SW_SHOWNORMAL 1
#define SW_SHOWMINIMIZED 2
#define SW_MAXIMIZE 3
#define SW_SHOWMAXIMIZED 3
#define SW_SHOWNOACTIVATE 4
#define SW_SHOW 5
#define SW_MINIMIZE 6
#define SW_SHOWMINNOACTIVE 7
#define SW_SHOWNA 8
#define SW_RESTORE 9
#define SW_SHOWDEFAULT 10
//------------------------------------//
ShellExecute( oDlg:hWnd, "open", cExe,,, SW_SHOWNORMAL )
Saludos.
cnavarro wrote:Juan, te refieres a llamar a otra aplicación ( como por ejemplo Notepad.exe ) ? e incrustarla dentro de la mdichild?
Esto?
cnavarro wrote:Qué versión utilizas?
Como te llamas?
#include "FiveWin.ch"
Static oWnd
Static oWndChild
Static nRow := 0
Static nCol := 0
Static nHChild := 650
Static nWChild := 1000
Static hWin
function Main()
DEFINE WINDOW oWnd MDI FROM 0, 0 TO 750, 1300 PIXEL ;
TITLE "A sample of a MDI environment" MENU MyMenu()
ACTIVATE WINDOW oWnd
return nil
//----------------------------------------------------------------------------//
Function MyMenu()
local oMnu
MENU oMnu
MENUITEM "Create_Child" ACTION ( CreaChild() )
MENUITEM "Exit" ACTION oWnd:End()
ENDMENU
Return oMnu
//----------------------------------------------------------------------------//
Function CreaChild()
DEFINE WINDOW oWndChild MDICHILD OF oWnd ;
FROM nRow + 1 , nCol TO nHChild, nWChild PIXEL ;
COLOR CLR_WHITE, METRO_OLIVE
ACTIVATE WINDOW oWndChild ;
ON PAINT ( Externo() )
return oWndChild
//----------------------------------------------------------------------------//
#define GW_HWNDNEXT 2
#define GW_CHILD 5
#define GWL_STYLE -16
#define GWL_EXSTYLE -20
#define SWP_NOZORDER 0x0004
#define SWP_NOREDRAW 0x0008
#define SWP_FRAMECHANGED 0x0020
#define SWP_NOOWNERZORDER 0x0200
#define SWP_ASYNCWINDOWPOS 0x4000
#define HWND_TOP 0
#define HWND_BOTTOM 1
//----------------------------------------------------------------------------//
STATIC FUNCTION Externo()
local nStyle
local lIni := .T.
if Empty( hWin )
WinExec( "Notepad" )
hWin := FindWnd( "Bloc" )
else
lIni := .F.
endif
if !Empty( hWin )
if lIni
nStyle := GetWindowLong( hWin, GWL_STYLE )
nStyle -= WS_CAPTION
nStyle -= WS_SYSMENU
nStyle += WS_THICKFRAME
SetParent( hWin, oWndChild:hWnd )
SetWindowLong( hWin, GWL_STYLE, nStyle )
endif
SetPosExt( hWin )
SetFocus( hWin )
endif
RETURN NIL
//----------------------------------------------------------------------------//
Function FindWnd( cTitle )
local hWnd1 := GetWindow( GetDesktopWindow(), GW_CHILD )
local lSw := .F.
while hWnd1 != 0
if Upper( cTitle ) $ Upper( GetWindowText( hWnd1 ) )
lSw := .T.
Exit
endif
hWnd1 = GetWindow( hWnd1, GW_HWNDNEXT )
end
return if( lSw, hWnd1, nil )
//----------------------------------------------------------------------------//
Function SetPosExt( hWnd )
local aRect := GetClientRect( hWnd )
local nAncho := oWndChild:nWidth - 10
local nInc := 1
local nInc1 := 0
local aPos := Array( 4 )
DEFAULT aPos[ 1 ] := 2
DEFAULT aPos[ 2 ] := 2
DEFAULT aPos[ 3 ] := nAncho - 12
DEFAULT aPos[ 4 ] := oWndChild:nHeight - nInc - nInc1 - aPos[ 1 ]
SetWindowPos( hWnd, HWND_TOP, ; //BOTTOM, ;
aPos[ 1 ] + nInc, aPos[ 2 ] + 1, aPos[ 3 ], aPos[ 4 ], ;
nOr( SWP_ASYNCWINDOWPOS, SWP_FRAMECHANGED, SWP_NOOWNERZORDER, SWP_NOZORDER, SWP_NOREDRAW ) ) //, SWP_NOZORDER ) )
Return nil
//----------------------------------------------------------------------------//
Return to FiveWin para Harbour/xHarbour
Users browsing this forum: No registered users and 65 guests