Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Make a form use the complete screen(over the win95 task
Message
 
To
07/01/1999 09:30:23
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00173373
Message ID:
00173517
Views:
27
Hi Virusim,

>I also interested in maximizing a form. What are the API function to do so in VFP 5.0, please give if possible, please example. Thank a lot
*--------------------------------------------
* The following define statements are from
* WinUser.H
*--------------------------------------------
#define GWL_EXSTYLE         (-20)
#define WS_EX_TOPMOST       0x00000008
#define HWND_TOPMOST    	   (-1)
#define SWP_NOSIZE          0x0001
#define SWP_NOMOVE          0x0002
#define SWP_NOZORDER        0x0004
#define SWP_FRAMECHANGED    0x0020 

*-----------------------------------------------
* Determine the HWND of the form
*-----------------------------------------------	
Local lnHwnd
Declare Integer FindWindow in Win32Api ;
   String lpszClass, ;
   String lpszWindow
lnHwnd = FindWindow(null,"caption of the form")

*-----------------------------------------------
* Determine the current extended window styles.
*-----------------------------------------------
Local lnStyle
Declare Integer GetWindowLong in Win32Api ;
   Integer hwnd, ;
   Integer nIndex
lnStyle = GetWindowLong( lnHwnd, GWL_EXSTYLE )

*-----------------------------------------------
* and set the AlwaysOnTop style.
*-----------------------------------------------
Declare SetWindowLong in Win32APi ;
   Integer hwnd, ;
   Integer nIndex, ;
   Integer lNewLong
lnStyle = BitOr( lnStyle, WS_EX_TOPMOST )
SetWindowLong( lnHwnd, GWL_EXSTYLE, lnStyle )

*-----------------------------------------------
* Redraw the form in order to make the changes
* permanent.
*-----------------------------------------------
Declare SetWindowPos in Win32APi ;
   Integer hwnd, ;
   Integer hwndInsertAfter, ;
   Integer x, ;
   Integer y, ;
   Integer cx, ;
   Integer cy, ;
   Integer nFlags
SetWindowPos( lnHwnd, HWND_TOPMOST, 0, 0, 0, 0,;
   SWP_NOSIZE + SWP_NOMOVE + SWP_FRAMECHANGED )
Christof
--
Christof
Previous
Reply
Map
View

Click here to load this message in the networking platform