i want to run many Instance of App but i need "Control" them.
as they all have "same Name" i can´t use "FindWindow" to get Handle
so how can i "run" a Instance and get it´s Handle under harbour
attached Xbase++ Sample using OT4XB Syntax
Moderator: Rathinagiri
Code: Select all
HMG_retnl ((LONG_PTR) hInstance );If the function succeeds, it returns a value greater than 32. If the function fails, it returns an error value that indicates the cause of the failure. The return value is cast as an HINSTANCE for backward compatibility with 16-bit Windows applications. It is not a true HINSTANCE, however. It can be cast only to an INT_PTR and compared to either 32 or the following error codes below.
Code: Select all
hwnd := ShellExecute(0, "open", "Playvlc.exe", cPara,cHome ,1)
AADD(aWin, hwnd)
Code: Select all
PROCEDURE GetVLChandle()
LOCAL cTitle, hwnd, ii, iMax, cMemo
iMax := nRow * nCol
FOR ii := 1 TO iMax
cTitle := "PLAYVLC" + STRZERO( ii, 2 )
hwnd := FindWindowEx(,,, cTitle )
IF !EMPTY( hwnd )
WritePlay( cTitle + ".PLAY", STR( hwnd ) )
AADD( aWin, hwnd )
ENDIF
NEXT
Code: Select all
STATIC PROCEDURE CheckCloseScreen()
...
IF lCheckScreen = .T.
aDir := DIRECTORY( "PLAYVLC*.PLAY" )
iMax := LEN( aDir )
FOR ii := 1 TO iMax
IF ".PLAY" $ aDir[ ii ] [ F_NAME ]
nCount ++
cMemo := ReadPlay( aDir[ ii ] [ F_NAME ] )
AADD( aCheck, cMemo )
ENDIF
NEXT
IF nCount <> nOpenVLC
lCheckScreen = .F.
iMax := LEN( aWin )
FOR ii := 1 TO iMax
hProcess := aWin[ ii ]
SendMessage( hProcess, WM_CLOSE, 0, 0 )
hb_idleSleep( .1 )
NEXT
Domethod( "IPTVMAIN", "PLAYTV", "SHOW" )
SnapToCtrl("IPTVMAIN","PLAYTV")
ENDIF
ENDIF