Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
Tracking mouse movement to detect when to start dragging
Using the DeleteFile
Using the IsWindowEnabled function
GDI+: printing vertical text on VFP reports via generated images (VFP8)
GDI+: Scrolling through large image using the mouse
How to empty the Recycle Bin
Obtaining provider name for a specific type of network
Pocket PC: base class
Printing text with the Escape function
Saving HKEY_LOCAL_MACHINE\\Software\\ODBC Registry Entries to an XML file
Setting properties of the window: caption and user-defined value
Using named pipes for interprocess communication
Using the RestartDialog function -- restarting Windows
Writing entries to custom Event Log
Converting a decimal string to an integer
Form Magnifier
How to hide your program from the Close Program dialog (Win9* only)
How to retrieve number of objects in the Recycle Bin
MapiSendMail class for Visual FoxPro application
Using the MessageBox Win32 function
CryptoAPI: retrieving list of providers
Disabling mouse and keyboard input for the main VFP window (with the app still running)
FindText -- the hopeless and useless Common Dialog
GetFocus returns a HWND value
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: 107  
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 (67.202.9.192)
20.12 min.Example: 'How to view icons stored in executable files (Icon Viewer) - II'
20.18 min.Example: 'Converting an integer value to a hexadecimal string'
20.27 min.Example: 'Reading STARTUPINFO structure for the current VFP session'
1.81 hrs.Function: 'DragAcceptFiles'
Function group: 'Shell Functions'
 Function: 'SetFileTime'
 Example: 'Saving HKEY_LOCAL_MACHINE\\Software\\ODBC Registry Entries to an XML file'
2.02 hrs.
2.03 hrs.Example: 'Opening the Page Setup dialog box to specify the attributes of a printed page'
 Function: 'CryptGenRandom'
Function group: 'Cryptography Reference'
2.8 hrs.Example: 'Finding out if the current user is the Guest account'
Google
Advertise here!