- Code: Select all Expand view
# define NOME_PROGRAMMA_TITLE "Winbeach"
Function Main()
...
IF ISEXERUNNING( CFILENAME( HB_ARGV( 0 ) ) )
MsgWait(NOME_PROGRAMMA_TITLE+" è già in esecuzione !","Attenzione")
SHOWWINDOW( FINDWND( NOME_PROGRAMMA_TITLE ), 9 )
SETFOREGROUNDWINDOW( FINDWND( NOME_PROGRAMMA_TITLE ) )
RETURN NIL
ENDIF
WITH OBJECT oApp := TApplication():New()
:Activate()
END
the function
- Code: Select all Expand view
- 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 )
ENDDO
RETURN NIL
now a strange thing happens to me that is
before accessing the application I do enter the access login for the users of the system
Let's imagine that the user gets distracted and opens the exe again
then we would have this situation
ie it displays me the message that the application is already running
but then it happens that it still opens the main window as if it were another section then we would have this situation
how should i do to avoid making the main window appear?
because it's very strange because I active the Main window on TApplication and on method Activate() where is the dialog of check login
- Code: Select all Expand view
- method Activate() class TApplication
IF ::CheckLogin()
GetWinCoors( ::oWndMain, ::cInifile )
* Get_Modules(::cInifile)
::oWndMain:bResized := {|| ResizeWndMain() }
::oWndMain:aMinMaxInfo := { nil, nil, ,, 1130,650, , }
ACTIVATE WINDOW ::oWndMain ;
VALID ::ExitFromX()
ENDIF
when I show the login and a user enters I go to load a series of parameters for that user,
for example access to programs that are activated from the menu or from the buttonbar if I used
on method Activate()
::oWndMain:bInit := { || IIF(::CheckLogin(),,::ExitFromSource()) }
it can run but then I have problems because the buttonbar and the menu are allready load without the paramters I want for that user