ibania blanco
unread,Dec 8, 2010, 5:30:06 PM12/8/10Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Comunidad de Visual Foxpro en Español
amiga coloca esto al inicio de inicio.prg
_SCREEN.CAPTION = "magdalena"
IF YaEstaActivo()
loLogo = .NULL.
RETURN
ENDIF
y al final de inicio.prg
coloca esto
*------------------------------------------------------
* FUNCTION YaEstaActivo()
* - - - - - - - - - - - - - - - - - - - - - - - - - - -
* Verifica si el programa ya está activo
* Retorna: .T. ó .F. si esta activo o no activo
*------------------------------------------------------
FUNCTION YaEstaActivo()
LOCAL lcCaption, llRet
DECLARE INTEGER FindWindow IN WIN32API ;
STRING cNULL, STRING cWinName
lcCaption = _SCREEN.CAPTION
_SCREEN.CAPTION = '_' + lcCaption
lnHWnd = FindWindow(0, lcCaption)
IF lnHWnd # 0
DECLARE INTEGER SetForegroundWindow IN user32;
INTEGER hWindow
DECLARE INTEGER ShowWindow IN user32;
INTEGER HWND, ;
INTEGER nCmdShow
SetForegroundWindow(lnHWnd)
ShowWindow(lnHWnd, 9)
llRet = .T.
ELSE
llRet = .F.
ENDIF
_SCREEN.CAPTION = lcCaption
RETURN llRet
ENDFUNC
lo que hace es que si ya esta activa tu exe, te lo activa y no habre
mas