Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
Establishing connection using the SQLDriverConnect
GDI+: printing vertical text on VFP reports via generated images (VFP9)
GDI+: rotating images using matrix transformations
How to suspend or hibernate your system
Retrieving statistics for the TCP protocol running on the local computer
Using custom Simple MapiSendMail class
Using IsChild() for testing ThisForm.ShowWindow property
Deleting files into the Recycle Bin
Disabling drawing in the VFP form
Printing text on the main VFP window
Retrieving names for the registered clipboard formats
Running a regular FoxPro form while main VFP window is minimized
Creating a clipping region from the path selected into the device context of a form
Encapsulating access to the Windows Services in a class
Exporting DLL icon resources as .ICO files
Obtaining MAC address through Address Resolution Protocol (ARP) request
Reading security permissions for NTFS files and folders
Retrieving the names of all sections in an initialization file
Retrieving Window Class information for the VFP window
Using FillMemory
Winsock: retrieving Web pages using sockets (HTTP, port 80)
Configuring DEVMODE structure for a printer
Disconnecting USB Mass Storage Device programmatically
Extended OS Version info
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: 114  
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 (107.21.156.140)
15.43 min.Function: 'DPtoLP'
Function group: 'Coordinate Space and Transformation'
15.47 min.Example: 'How to put a vertical text scrolling on the form (a movie cast)'
15.52 min.Example: 'GDI+: printing image file'
1.15 hrs.Function: 'DrawMenuBar'
Function group: 'Menu'
 Example: 'GDI+: Color Transparency'
 Example: 'How to display advanced Task Dialog (Vista)'
2.16 hrs.Example: 'How to print picture stored in enhanced-format metafile (*.emf)'
2.17 hrs.Function: 'CryptEnumProviderTypes'
2.84 hrs.Example: 'Enumerating servers of the specified type (e.g. SQL Server) in the primary domain'
 Example: 'Extracting the name and extension parts of a path string'
Google
Advertise here!