Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Prevent run second session
Message
From
24/11/1997 10:35:17
 
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00061508
Message ID:
00061934
Views:
41
>>>Hi: I need find the way to prevent the user open same application twice. Does anyone know how to do it?
>>>
>>>Thanks,
>>>tfp@inel.gov
>>
>>There is the solution!
>>
>>
>>**Can maximize a window
>>DECLARE INTEGER ShowWindow ;
>>IN WIN32API ;
>>	INTEGER  hWnd , ;
>>	INTEGER nState
>>
>>**get the window handle
>>DECLARE INTEGER FindWindow ;
>>IN WIN32API ;
>>	STRING cNull, ;
>>	STRING cWinName
>>
>>**place the window on top
>>DECLARE INTEGER BringWindowToTop ;
>>IN WIN32API ;
>>	INTEGER  hWnd
>>
>>*Sample code, it this case the window title = 'Calculatrice'
>>IF !FindWindow( 0, 'Calculatrice') > 0
>>	*Not find, do something...
>>ELSE
>>	*Find! Bring it to top and maximize it!
>>	=BringWindowToTop(FindWindow( 0, 'Calculatrice'))
>>	=ShowWindow(FindWindow( 0, 'Calculatrice'),1)
>>ENDIF	
>>
>>
>It is a grate help but I still have a little problem. I am using the Visual FoxPro window screen as my system default window. I try to use the WTITLE() function to get the Visual FoxPro window screen title name but the function return empty string. What is the window title name I should put in the FINDWINDOW function to check the session is already open?
>
>Thanks!
>tfp@inel.gov

You should check for _SCREEN.Caption
Edward Pikman
Independent Consultant
Previous
Reply
Map
View

Click here to load this message in the networking platform