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
Capturing keyboard activity of another application with the Raw Input API (VFP9)
Winsock: sending email messages (SMTP, port 25)
Mapping and disconnecting network drives
How to display the Properties dialog box for a file (ShellExecuteEx)
Winsock: retrieving directory listing from an FTP server using passive data connection (FTP, port 21)
Disk in drive A:
How to download a file from the FTP server using FtpGetFile
Enumerating raw input devices attached to the system (keyboard, mouse, human interface device)
How to play AVI file on the _screen
Using Font and Text functions
Enumerating network resources
Using EnumPrinters function to enumerate locally installed printers
Vertical Label control
Creating irregularly shaped FoxPro form using transparency color key
Changing system colors
Custom HttpRequest class (WinHTTP)
Subclassing CommandButton control to create BackColor property
Using Video Capture: displaying on FoxPro form frames and previewing video obtained from a digital camera
Converting Unicode data from the Clipboard to a character string using a given code page
Using the DrawText function
Using Common Controls: the Header Control
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: 117  
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 (50.16.17.90)
1.34 hrs.Solution: 'LanguageBar ActiveX Control'
3.07 hrs.Examples
Page 10
3.08 hrs.
3.31 hrs.Example: 'Printing Image File, programmatically set print page orientation to landscape'
3.32 hrs.Function: 'ConvertSidToStringSid'
Function group: 'Security'
5.19 hrs.Function: 'LocalSize'
Function group: 'Memory Management'
 Function: 'LookupAccountName'
5.89 hrs.Example: 'How to display advanced Task Dialog (Vista)'
 Example: 'How to set Creation Date/Time for a folder (WinNT)'
 Example: 'Printing text on the client area of the main VFP window'
Google
Advertise here!