Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ShowWindow
Message
 
 
To
20/10/1999 06:44:08
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Title:
Miscellaneous
Thread ID:
00278675
Message ID:
00278877
Views:
16
John,

Here's what I use to bring the VFP app back on top if they try to launch another instance of the app:
if ( this.mlBringBackOnTop )

   external procedure mainhwnd
   SET LIBRARY TO "FOXTOOLS.FLL" additive
   local lnHWND
   lnHWND = mainhwnd()

   if ( _screen.WindowState = 1 )
      * this window is iconized so first we need to restore it

      * Use the ShowWindow API call because we don't know whether to set WindowState to 0 or 2
      * the API call does return the window to whatever state it was before it was iconized

      declare integer ShowWindow in WIN32API integer, integer
      #define SW_RESTORE 9
      
      ShowWindow( lnHWND, SW_RESTORE )
   endif

   DECLARE INTEGER SetForegroundWindow IN WIN32API INTEGER

   SetForegroundWindow( lnHWND )
endif
>I am using WIN32API to find out if the application is all ready loaded then using ShowWindow to show the window. I get inconsistant results on showing the window. Sometimes it is shown and sometimes it is only partialy painted. I have tried the following with 3, 5 and 6:
>
>

>LPARAMETER lnHWND
>
>DECLARE INTEGER ShowWindow IN Win32API;
> INTEGER hwnd, INTEGER dflag
>
>= ShowWindow(lnHWND, 3)
>
><\PRE>
>
>Does anyone know the syntax for ShowWindow to maximize the window and bring it to the top?
>
>Thanks
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform