Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
How to display the port-configuration dialog box for a port on the specified server
Using Multimedia Command Strings to play MIDI files
Quering a waveform-audio input device
Reading and setting Environment variables
Reading metrics for the currently selected font
Retrieving the elapsed time since the system was started
Retrieving the name of the network resource associated with a local device
Winsock: how to retrieve the protocol information corresponding to a protocol name
Retrieving configuration information for the specified workstation (Win2000/XP)
URL: splitting into its component parts
Winsock: how to retrieve a service information corresponding to a port
Accessing the list of Windows Recent Documents
Determining whether or not the system is connected to the Internet
Obtaining some properties for the Windows desktop using the GetWindowPlacement function
Retrieving Network Provider information
Simulating DOEVENTS
Winsock: retrieving information about available transport protocols
Displaying standard progress dialog box when copying files
GetFocus returns a HWND value
Obtaining Shell32.dll version
Obtaining window class name for the main VFP window
Printf-style formatted text output in VFP
Retrieving System Error message strings
String representation for disk or memory capacity
How to display the port-configuration dialog box for a port on the specified server

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
Before you begin:

Another example shows how to enumerate ports available for printing. Run it to determine valid port names.
DO decl

* Null means local computer
*= ConfigurePort(Null, GetActiveWindow(), "LPT1:")
*= ConfigurePort(Null, GetActiveWindow(), "FILE:")

* as well you can use an existing server name
*= ConfigurePort("\\MYSERV", GetActiveWindow(), "USB001:")

IF ConfigurePort(Null, GetActiveWindow(), "COM1:") = 0
*  5 - ERROR_ACCESS_DENIED
* 50 - ERROR_NOT_SUPPORTED
    ? "Error:", GetLastError()
ELSE
* here you have the dialog box displayed (modal)
ENDIF
* end of main

PROCEDURE decl
    DECLARE INTEGER GetLastError IN kernel32
    DECLARE INTEGER GetActiveWindow IN user32

    DECLARE INTEGER ConfigurePort IN winspool.drv;
        STRING pName, INTEGER hWnd, STRING pPortName



User rating: 0/10 (0 votes)
Rate this code sample:
  • ~
680 bytes  
Created: 2002-12-31 18:40:03  
Modified: 2009-01-03 15:26:33  
Visits in 7 days: 49  
Listed functions:
ConfigurePort
GetActiveWindow
GetLastError
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-2018 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.6.39), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
Last Topics Visited (54.82.78.213)
13 sec.
29 sec.Function: 'CeCloseHandle'
Function group: 'Remote Application Programming (RAPI)'
40 sec.Function: 'RevertToSelf'
55 sec.
Function group: 'HTTP Functions (WinHTTP)'
1.13 min.Function: 'SHGetStockIconInfo'
Function group: 'Shell Functions'
1.32 min.Function: '_lopen'
Function group: 'File Management'
1.57 min.Function: 'CeRegSetValueEx'
Function group: 'Remote Application Programming (RAPI)'
1.83 min.Example: 'Dragging files from Explorer window and dropping them on FoxPro control (requires VFP9)'
2.17 min.Function: 'mmioCreateChunk'
2.48 min.
Function group: 'Brush'
Google
Advertise here!