Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem showing the application in EXE
Message
De
09/04/2004 11:45:36
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
09/04/2004 11:14:05
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00893559
Message ID:
00893577
Vues:
20
>We have a problem showing the application when we run our EXE. When we run the EXE from VFP, the application starts and we are in the menu. But, when we run it from Windows Explorer by clicking on the EXE, the app starts, we can see it in the Windows task bar but we have to click twice on the Windows task item to switch to it.
>
>I have tried the following after our _screen.Visible=.T.
>
>
>Declare Integer GetActiveWindow In USER32.Dll
>Declare SHORT SetActiveWindow In USER32.Dll Integer HWnd
>LOCAL lnActiveWindow
>lnActiveWindow=GetActiveWindow()
>SetActiveWindow(lnActiveWindow)
>
>
>But, that doesn't help.
>
>Any idea to resolve that issue would be welcome.
#define SW_SHOWMINIMIZED    2
#define SW_SHOWMAXIMIZED    3
#define SW_MAXIMIZE         3
#define SW_SHOWNOACTIVATE   4
#define SW_SHOW             5
#define SW_MINIMIZE         6
#define SW_SHOWMINNOACTIVE  7
#define SW_SHOWNA           8
#define SW_RESTORE          9
#define SW_SHOWDEFAULT      10
#define SW_FORCEMINIMIZE    11

DECLARE short ShowWindow IN WIN32API ;
  integer hWnd, ;
  integer nCmdShow
declare short SetForegroundWindow in win32API integer nHwnd
DECLARE short GetWindowPlacement IN WIN32API ;
  integer hWnd, ;
  string @ lpwndpl

lpwndpl = CHR(4*3+8*2+4*4)+replicate(CHR(0),4*3+8*2+4*4-1)

		lnHWND = _screen.Hwnd
		SetForegroundWindow( m.lnHWND )
		IF ( GetWindowPlacement(m.lnHWND, @lpwndpl) # 0 ) AND ;
			INLIST(ASC(SUBSTR(m.lpwndpl, 4+4+1, 1)), ;
			SW_SHOWMINIMIZED, SW_MINIMIZE, SW_SHOWMINNOACTIVE, SW_FORCEMINIMIZE)
			ShowWindow(lnHWND, SW_RESTORE)
		endif
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform