Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
Custom GDI+ class
Storing content of the Clipboard to a bitmap file
Storing screen shot of a form to bitmap file
How to print FoxPro form
Displaying icons in the system tray (VFP9)
Using NetWkstaTransportEnum to obtain MAC Address of remote server
Capturing keyboard activity of another application with the Raw Input API (VFP9)
How to print a bitmap file
GDI+: Implementing image scrolling with inertia
Using the LoadImage function to have a bitmap file loaded and displayed on VFP main window
Browsing Windows Known Folders (Special Folders)
How to ping a remote site using IP Helper API calls
Obtaining names and positions for shortcuts located on the Windows Desktop
Using InternetSetFilePointer when resuming interrupted download from the Internet
Monitoring clipboard content changes (VFP9)
Enumerating Processes -- WinNT
How to view icons stored in executable files (Icon Viewer) - II
GDI+: reading and writing metadata in JPEG and TIFF files
HOWTO: Use the Win32 API to Access File Dates and Times
System Image List Viewer
Attaching menu to a top-level form
Loading a string resource from an executable file
Vertical Label control
Detecting changes in connections to removable drives (VFP9)
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("")
? "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: 85  
Listed functions:
Printer friendly API declarations
Word Index links for this example:
Translate this page:
  Spanish    Portuguese    German    French    Italian offers instant, free translations of text or web pages.
User Contributed Notes:
There are no notes on this subject.

Copyright 2001-2017 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.38), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
Last Topics Visited (
4 sec.Example: 'Extended MessageBox Class'
9 sec.
Function group: 'URL Monikers'
11 sec.Function: 'GetTempPath'
Function group: 'File Management'
13 sec.Function: 'SCardListCards'
Function group: 'Authentication'
14 sec.Function: 'CeRegEnumKeyEx'
Function group: 'Remote Application Programming (RAPI)'
16 sec.Function: 'SQLConnect'
Function group: 'ODBC API'
18 sec.Function: 'GdipDrawImageRectI'
Function group: 'GDI+ Graphics'
20 sec.Function: 'FindNextPrinterChangeNotification'
Function group: 'Printing and Print Spooler'
22 sec.Example: 'Winsock: retrieving information about available transport protocols'
24 sec.Function: 'DefWindowProc'
Function group: 'Window Procedure'
Advertise here!