Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
Creating a clipping region from the path selected into the device context of a form
GDI+: saving image of FoxPro form to graphics file (BMP, GIF, JPG, PNG, TIF)
Monitoring changes occurring within a directory
Retrieving list of available disk drives
Current keyboard type
Enumerating ports that are available for printing on a specified server
How to delete IE cookies, clear IE history and delete files in Temporary Internet Files directory
Monitoring changes in a directory
Retrieving the User Datagram Protocol (UDP) listener table
Using FtpCommand
Winsock: retrieving the standard host name and IP address for the local machine
Enumerating the subkeys of a user-specific key
How to create a desktop shortcut (shell link)
Obtaining some properties for the Windows desktop using the GetWindowPlacement function
Testing serial ports
How to make the caption of a VFP application flashing in the Windows task bar
How to register custom Event Log source
The SQLGetProp() creates a bridge between Visual FoxPro and the ODBC API
Displaying dimmed window behind VFP top-level form
Displaying hypertext links with the SysLink control (VFP9, Comctl32.dll)
Displaying icons in the system tray (VFP9)
Displaying printer-properties Property Sheet for the specified printer
Get the power status of your laptop computer
Obtaining physical parameters for a drive: sectors, clusters, cylinders...
Winsock: changing the byte ordering

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
 
* you do not need to call the WSAStartup function
* before using these functions
 
DECLARE INTEGER ntohs IN ws2_32 INTEGER netshort
DECLARE INTEGER ntohl IN ws2_32 INTEGER netlong
DECLARE INTEGER htonl IN ws2_32 INTEGER hostlong
DECLARE INTEGER htons IN ws2_32 INTEGER hostshort
 
* HOST to NET  u_short -- htons
* NET  to HOST u_short -- ntohs
* HOST to NET  u_long  -- htonl
* NET  to HOST u_long  -- ntohl
 
? "*** Working with U_SHORT values"
lnFtpPort = htons(21)
? "Converted to the network byte order:",lnFtpPort
? "Host byte order again:", ntohs(lnFtpPort)
?
 
? "*** Working with U_LONG values"
lnTelnetPort = htonl(23)
? "Converted to the network byte order:", lnTelnetPort
? "Host byte order again:", ntohl(lnTelnetPort)
?    
 
DECLARE INTEGER inet_addr IN ws2_32 STRING cp
DECLARE STRING inet_ntoa IN ws2_32 INTEGER in_addr
 
* The inet_addr function converts a string containing an (Ipv4) 
* Internet Protocol dotted address into a proper address 
* for the IN_ADDR structure
? "*** Converting IP addresses"
lnIP = inet_addr("127.0.0.1")
? "String value converted into a proper address:", lnIP
 
* The inet_ntoa function converts an (Ipv4) Internet network address 
* into a string in Internet standard dotted format
? "Converted back to a string value:", inet_ntoa (lnIP)
 
 

User rating: 0/10 (0 votes)
Rate this code sample:
  • ~
1319 bytes  
Created: 2001-12-19 19:02:10  
Modified: 2001-12-19 19:02:56  
Visits in 7 days: 82  
Listed functions:
htonl
htons
inet_addr
inet_ntoa
ntohl
ntohs
WSAStartup
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.19.155.235)
4 sec.Example: 'Reading entries from Event logs'
7 sec.Function: 'WNetCloseEnum'
2.84 hrs.Example: 'Smart Card Database Query Functions'
3.54 hrs.Function: 'SetMapMode'
Function group: 'Coordinate Space and Transformation'
 Example: 'Using the CopyFile'
 Function: 'SwitchDesktop'
Function group: 'Window Station and Desktop'
4.7 hrs.
Function group: 'Window Station and Desktop'
7.27 hrs.Example: 'Deleting files into the Recycle Bin'
 Example: 'Deleting a file stored on the FTP server'
10.81 hrs.Function: 'ExitProcess'
Google
Advertise here!