Using Win32 functions in Visual FoxPro Image Gallery
Window
..msdn
CloseWindow
CreateWindow
CreateWindowEx
DestroyWindow
EndTask
FindWindow
FindWindowEx
GetAncestor
GetClientRect
GetDesktopWindow
GetForegroundWindow
GetGUIThreadInfo
GetParent
GetShellWindow
GetWindow
GetWindowInfo
GetWindowPlacement
GetWindowRect
GetWindowText
GetWindowTextLength
GetWindowThreadProcessId
InternalGetWindowText
IsChild
IsIconic
IsWindow
IsWindowVisible
IsZoomed
MoveWindow
RealGetWindowClass
SetForegroundWindow
SetLayeredWindowAttributes
SetParent
SetWindowPos
SetWindowText
ShowWindow
SwitchToThisWindow
Code examples:
Creating a window using CreateWindowEx function
Displaying dimmed window behind VFP top-level form
Displaying hypertext links with the SysLink control (VFP9, Comctl32.dll)
How to make a VFP form fading out when released (GDI version)
How to make a VFP form fading out when released (GDI+ version)
Placing a button on the VFP form as a new child window
Placing On-screen Alert on top of all windows
Splash Screen for the VFP application
Using Common Controls: the Header Control
Using Month Calendar Control (VFP9, Comctl32.dll)
Creating a window using CreateWindowEx function

User rating: 0/10 (0 votes)
Rate this code sample:
  • ~
More code examples    Listed functions    Add comment     W32 Constants      Translate this page Printer friendly version of this code sample
 
* Extended Window Styles
#DEFINE WS_EX_DLGMODALFRAME    1
#DEFINE WS_EX_NOPARENTNOTIFY   4
#DEFINE WS_EX_TOPMOST          8
#DEFINE WS_EX_ACCEPTFILES     16
#DEFINE WS_EX_TRANSPARENT     32
#DEFINE WS_EX_MDICHILD        64
#DEFINE WS_EX_TOOLWINDOW     128
#DEFINE WS_EX_WINDOWEDGE     256
#DEFINE WS_EX_CLIENTEDGE     512
#DEFINE WS_EX_CONTEXTHELP   1024
 
#DEFINE WS_EX_CONTROLPARENT 0x10000
#DEFINE WS_EX_STATICEDGE  0x20000
#DEFINE WS_EX_APPWINDOW  0x40000
 
#DEFINE SW_NORMAL  1
#DEFINE WS_OVERLAPPED 0
#DEFINE WS_CAPTION  0xC00000
#DEFINE WS_SYSMENU  0x80000
#DEFINE WS_THICKFRAME  0x40000
#DEFINE WS_MINIMIZEBOX  0x20000
#DEFINE WS_MAXIMIZEBOX  0x10000
 
DO decl
 
    hwnd = GetActiveWindow()
    lcClass = SPACE(250)
 
    lnSize = RealGetWindowClass (hwnd, @lcClass , Len(lcClass ))
    lcClass = STRTRAN (SUBSTR(lcClass, 1,lnSize), Chr(0),"")
 
    dwExStyle = WS_EX_APPWINDOW+WS_EX_CLIENTEDGE+WS_EX_WINDOWEDGE
    dwStyle   = WS_CAPTION+WS_SYSMENU+WS_THICKFRAME+WS_MAXIMIZEBOX+WS_MINIMIZEBOX
 
    hNew = CreateWindowEx (dwExStyle, lcClass, "Sample Window created",;
        dwStyle, 10, 10, 800, 300, hwnd, 0, 0, 0)
 
    = ShowWindow (hNew, SW_NORMAL)
    hDC = GetDC (hNew)
 
    lpString = "The GetActiveWindow function retrieves the active window handle" 
    ? TextOut (hDC, 10,10, lpString, Len(lpString))     
 
    = ReleaseDC (hNew, hDC)
 
PROCEDURE  decl
    DECLARE INTEGER RealGetWindowClass IN user32;
        INTEGER  hwnd,;
        STRING @ pszType,;
        INTEGER  cchType
 
    DECLARE INTEGER GetActiveWindow IN user32 
 
    DECLARE INTEGER CreateWindowEx IN user32;
        INTEGER dwExStyle,;
        STRING lpClassName,;
        STRING lpWindowName,;
        INTEGER dwStyle,;
        INTEGER x,;
        INTEGER y,;
        INTEGER nWidth,;
        INTEGER nHeight,;
        INTEGER hWndParent,;
        INTEGER hMenu,;
        INTEGER hInstance,;
        INTEGER lpParam
 
    DECLARE INTEGER ShowWindow IN user32;
        INTEGER hwnd,;
        INTEGER nCmdShow
 
    DECLARE INTEGER GetDC IN user32 INTEGER hwnd 
 
    DECLARE INTEGER TextOut IN gdi32;
        INTEGER hdc,;
        INTEGER x,;
        INTEGER y,;
        STRING  lpString,;
        INTEGER nCount
 
    DECLARE INTEGER ReleaseDC IN user32;
        INTEGER hwnd, INTEGER hdc 
 
 

User rating: 0/10 (0 votes)
Rate this code sample:
  • ~
2189 bytes  
Created: 2001-07-18 12:00:00  
Modified: 2005-12-27 10:18:56  
Visits in 7 days: 146  
Listed functions:
CreateWindowEx
GetActiveWindow
GetDC
RealGetWindowClass
ReleaseDC
ShowWindow
TextOut
Printer friendly API declarations
My comment:
Try different combinations of constants setting style and extended style of the created window.
Translate this page:
  Spanish    Portuguese    German    French    Italian  
FreeTranslation.com offers instant, free translations of text or web pages.
User Contributed Notes:
There are no notes on this subject.


Copyright © 2001-2013 News2News, Inc. Before reproducing or distributing any data from this site please ask for an approval from its owner. Unless otherwise specified, this page is for your personal and non-commercial use. The information on this page is presented AS IS, meaning that you may use it at your own risk. Microsoft Visual FoxPro and Windows are trade marks of Microsoft Corp. All other trademarks are the property of their respective owners. 

Privacy policy
Credits: PHP (4.4.9), an HTML-embedded scripting language, MySQL (5.1.55-log), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
Last Topics Visited (50.17.109.248)
3 sec.Function: 'RegSaveKey'
Function group: 'Registry'
1.75 hrs.Example: 'Accessing examples contained in this reference from a VFP application'
 Example: 'Retrieving Window Class information for the VFP window'
 Function: 'CreateWaitableTimer'
3.15 hrs.Example: 'Reading parameters of streams in AVI file'
4.42 hrs.Example: 'Obtaining I/O counts for the current process'
 Example: 'Displaying the drive type value'
5.9 hrs.Example: 'Simple Window Viewer'
 Function: 'GdipCreateMatrix'
Function group: 'GDI+ Matrix'
6.71 hrs.Function: 'SetFocus'
Google
Advertise here!