Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
How to change display settings: screen resolution, screen refresh rate
Enumerating data formats currently available on the clipboard
Custom GDI+ class
Mapping and disconnecting network drives
Winsock: sending email messages (SMTP, port 25)
Capturing keyboard activity of another application with the Raw Input API (VFP9)
Winsock: retrieving directory listing from an FTP server using passive data connection (FTP, port 21)
Converting Unicode data from the Clipboard to a character string using a given code page
Enumerating raw input devices attached to the system (keyboard, mouse, human interface device)
Disk in drive A:
How to display the Properties dialog box for a file (ShellExecuteEx)
Enumerating network resources
Detecting changes in connections to removable drives (VFP9)
Splash Screen for the VFP application
How to download a file from the FTP server using FtpGetFile
Using Font and Text functions
Using EnumPrinters function to enumerate locally installed printers
How to play AVI file on the _screen
Retrieving the name of the network resource associated with a local device
Using Video Capture: displaying on FoxPro form frames and previewing video obtained from a digital camera
Running MSDOS Shell as a child process with redirected input and output (smarter RUN command)
Creating irregularly shaped FoxPro form using transparency color key
Creating a console window for Visual FoxPro application
How to put a horizontal text scrolling on the form (a news line)
Setting properties of the window: caption and user-defined value

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
 
DO decl
 
#DEFINE SW_SHOWNORMAL        1
#DEFINE GWL_USERDATA       -21
#DEFINE ccCustomTitle      "Calc-U-lator"
 
LOCAL hCalc, lnCounter
 
* retrieve window hanlde to Windows Calculator
hCalc = GetCalcWinHandle()
 
* change the text of the title bar
= SetWindowText (hCalc, ccCustomTitle)
 
* retrieve the user data associated with the window
lnCounter = GetWindowLong (hCalc, GWL_USERDATA)
 
* increment value
lnCounter = lnCounter + 1
? "User-data value:", lnCounter
 
* set it back
? SetWindowLong (hCalc, GWL_USERDATA, lnCounter)  && optional value
 
FUNCTION  GetCalcWinHandle
    LOCAL hwnd
    hwnd = FindWindow (.NULL., ccCustomTitle)
    IF hwnd = 0
    * start the calculator if not found
        = WinExec ("calc.exe", SW_SHOWNORMAL)
        hwnd = FindWindow (.NULL., "Calculator")
    ENDIF
RETURN hwnd
 
PROCEDURE  decl
    DECLARE INTEGER SetWindowLong IN user32;
        INTEGER hWnd, INTEGER nIndex, INTEGER dwNewLong
 
    DECLARE INTEGER FindWindow IN user32;
        STRING lpClassName, STRING lpWindowName
 
    DECLARE INTEGER GetWindowLong IN user32;
        INTEGER hWnd, INTEGER nIndex
 
    DECLARE INTEGER WinExec IN kernel32;
        STRING  lpCmdLine, INTEGER nCmdShow
 
    DECLARE INTEGER SetWindowText IN user32;
        INTEGER hWnd, STRING lpString
 
 

User rating: 0/10 (0 votes)
Rate this code sample:
  • ~
1252 bytes  
Created: 2001-11-01 19:40:13  
Modified: 2006-03-12 14:16:42  
Visits in 7 days: 89  
Listed functions:
FindWindow
GetWindowLong
SetWindowLong
SetWindowText
WinExec
Printer friendly API declarations
Word Index links for this example:
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.22.127.92)
2.79 hrs.Example: 'How to ping a remote site using ICMP API calls'
 Example: 'Using File Mapping for enumerating files opened by Visual FoxPro'
3.73 hrs.Function: 'GetFileTitle'
Function group: 'Common Dialog Box'
6.25 hrs.Function: 'HeapUnlock'
 Example: 'Storing screen shot of a form to enhanced metafile (*.emf)'
8.58 hrs.Function: 'OpenPrinter'
9.61 hrs.
9.62 hrs.Example: 'Obtaining names and positions for shortcuts located on the Windows Desktop'
14.3 hrs.Example: 'Displaying the associated icons and descriptions for files and folders'
 
Function group: 'Process and Thread'
Google
Advertise here!