if GetModuleHandle( HB_ARGV( 0 ) ) != 0
MsgInfo( "App already running" )
return 0
endif
pTitulo:="Nome do teu sistema que fica na barra de cima da Window"
If IsExeRunning( cFilename( hb_Argv(0) ) )
SHOWWINDOW( FINDWINDOW( 0, pTitulo ), 3 )
SETFOREGROUNDWINDOW( FINDWINDOW( 0, pTitulo ) )
return nil
Endif
FUNCTION main
if IsExeRunning( cFileName( HB_ARGV( 0 ) ) )
ShowApplication()
else
DEFINE WINDOW oWnd
WritePProString( "Programm" , "RECHNUNG", oWnd:cTitle(), ".\ini\whLink.ini" )
ACTIVATE WINDOW oWnd MAXIMIZED
endif
return
//----------------------------------------------------------------------------//
function ShowApplication()
local hWnd := 0
local cFileNoExt := ""
local uVar = GetPvProfString( "Programm", "RECHNUNG", "WINHOTEL",".\ini\whLink.ini" )
hWnd := FindWnd( uVar )
if hWnd != nil
if IsIconic( hWnd )
ShowWindow( hWnd, SW_RESTORE )
endif
SetFocus( hWnd )
SetForeGroundWindow( hWnd )
endif
return nil
//----------------------------------------------------------------------------//
function FindWnd( cTitle )
local hWnd := GetWindow( GetDesktopWindow(), GW_CHILD )
while hWnd != 0
if Upper( cTitle ) $ Upper( GetWindowText( hWnd ) )
return hWnd
endif
hWnd = GetWindow( hWnd, GW_HWNDNEXT )
end
return nil
//----------------------------------------------------------------------------//
norberto wrote:Kleyber, this works after build main window, i need before.
i need something using the name of exe, not main windows title, because at this point , it not create.
Thanks
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 124 guests