Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Set focus to the executable
Message
De
18/02/2010 09:10:38
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
01449446
Message ID:
01449689
Vues:
31
ahhh i see so if i had
DECLARE INTEGER SetForegroundWindow IN user32 INTEGER hwnd
this would basically make the form i pass the hwnd function to the forewindow?
im gonna try it :D without all the other fancy code

so i did
procedure ActivateWindow
	lparameters tnHwnd
	declare short SetForegroundWindow in win32API integer nHwnd
	declare short ShowWindow in WIN32API alias Win32ShowWindow ;
		integer hwnd, ;
		integer nCmdShow
			SetForegroundWindow( m.tnHWND )
and it worked in activating my window..im not sure i should go with this...but i dont like using code i cant understand :(


>From the VFP code you can call Windows API functions (such as SetForegroundWindow and others) by first declaring them and then using as regular functions.
>
>You can go to this site http://www.news2news.com/vfp/index.php and see lots of examples of how you can use these functions and what you can achieve with them.
>
>>ahh! it works!
>>but can you please tell me what this code says?
>>
>>procedure ActivateWindow
>>	lparameters tnHwnd
>>	declare short SetForegroundWindow in win32API integer nHwnd
>>	declare short ShowWindow in WIN32API alias Win32ShowWindow ;
>>		integer hwnd, ;
>>		integer nCmdShow
>>	declare short GetWindowPlacement in WIN32API ;
>>		integer hwnd, ;
>>		string @ lpwndpl
>>
>>	#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
>>
>>	local lnHWND, lpwndpl
>>	lpwndpl = chr(4*3+8*2+4*4)+replicate(chr(0),4*3+8*2+4*4-1)
>>	SetForegroundWindow( m.tnHWND )
>>	if ( GetWindowPlacement(m.tnHWND, @lpwndpl) # 0 ) and ;
>>			inlist(asc(substr(m.lpwndpl, 4+4+1, 1)), ;
>>			SW_SHOWMINIMIZED, SW_MINIMIZE, SW_SHOWMINNOACTIVE, SW_FORCEMINIMIZE)
>>		Win32ShowWindow(m.tnHWND, SW_RESTORE)
>>	endif
>>
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform