Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
How to register custom Event Log source
How to Start a Process as Another User (NT/XP/2K)
Placing an arbitrary rectangular area of main VFP window on the Clipboard
Reading data from INI files
Using NetWkstaTransportEnum to obtain MAC Address of remote server
How to create a desktop shortcut (shell link)
How to retrieve adapter information for the local computer (including MAC address)
Obtaining addresses for the adapters on the local computer (Win XP/2003/Vista)
Programmatically removing submenus from VFP main menu
Quering a waveform-audio input device
Winsock: retrieving information about available transport protocols
Enumerating devices installed on the local machine
How to display advanced Task Dialog (Vista)
How to generate GUID values
How to run FoxPro application under different user name (impersonating user)
Retrieving IP statistics for the computer
System and Local Time values
Winsock: how to retrieve the protocol information corresponding to a protocol name
Winsock: resolving an address to a host name
Converting a hexadecimal string to an integer
Finding out if the current user is the Guest account
PocketPC: custom RAPI class for executing routines on remote Windows CE device
Retrieving the name of the default printer for the current user on the local computer (Win NT/XP)
Using the CreateFile
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: 88  
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-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)
4 sec.Function: 'SetThreadPriority'
Function group: 'Process and Thread'
1.92 hrs.Example: 'Retrieving national language settings'
 Function: 'MAPIReadMail'
Function group: 'Simple MAPI'
2.13 hrs.Example: 'Custom GDI+ class'
3.68 hrs.Function: 'GdipTranslateWorldTransform'
3.69 hrs.Function: 'Shell_NotifyIcon'
Function group: 'Shell Functions'
5.73 hrs.Function: 'GetMapMode'
 Function: 'SQLSetConfigMode'
Function group: 'ODBC API'
5.74 hrs.Example: 'Displaying OS Memory Status'
5.99 hrs.Example: 'Class library providing access to the System Registry'
Google
Advertise here!