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
One more way to retrieve environment strings
Opening access to the Microsoft Internet functions for the application
Retrieving various system metrics
Using Multimedia Command Strings to play MIDI files
Who owns the Windows Clipboard
Adding an ODBC data source with the SQLConfigDataSource; use automatic or interactive mode
Comparing dimensions of the VFP main window with _SCREEN properties
Determining whether or not the system is connected to the Internet
GDI+: creating scaled copy of image file
Reading current hardware profile
Winsock: how to retrieve the protocol information corresponding to a protocol number
Printf-style formatted text output in VFP
Retrieving the name of the network resource associated with a local device
Retrieving the state of your Internet connection
How to hide your program from the Close Program dialog (Win9* only)
Open and close a Simple MAPI Session
Reading Internet Query options
Reading metrics for the currently selected font
Testing if a connection to an Url can be established
Retrieving information about MS-DOS device names using QueryDosDevice (WinNT only)
Using the FindMediaType function
Disabling drawing in the VFP form
GDI+: printing vertical text on VFP reports via generated images (VFP8)
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: 52  
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.234.233.48)
23 sec.
Function group: 'Network Management'
43 sec.Example: 'Class for sound recording'
1.03 min.Example: 'Detecting changes in connections to removable drives (VFP9)'
1.37 min.Function: 'CeSeekDatabase'
Function group: 'Remote Application Programming (RAPI)'
1.65 min.Function: 'GetProductInfo'
Function group: 'System Information'
1.95 min.Articles
2.27 min.Function: 'UnregisterHotKey'
Function group: 'Keyboard Input'
2.58 min.
2.85 min.Example: 'Custom GDI+ class'
3.2 min.Function: 'NetUserChangePassword'
Function group: 'Network Management'
Google
Advertise here!