Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
Form Magnifier
How to Start a Process as Another User (NT/XP/2K)
Windows Shell Icons displayed and exported to ICO files (Vista)
Enumerating connections made to a shared resource for the local computer (WinNT only)
Extended MessageBox Class
Starting external program from VFP and waiting for its termination
Using Path functions from Shell Lightweight Utility APIs (shlapi.dll)
Winsock: reading and setting socket options
Converting command-line string to a set of Unicode argument strings (WinNT only)
Retrieving information about the main VFP window
Setting the volume label
Storing the environment strings in cursor
System Image List Viewer
Using GetBinaryType (WinNT only) to determine the type of an executable file
Browsing Windows Known Folders (Special Folders)
Drawing Windows frame controls using the DrawFrameControl function
Power capabilities of the system: battery, UPS, sleep and hibernation modes, processor throttling
Retrieving configuration information for the specified server (Win2000/XP)
How to retrieve network parameters for the local computer (including Host name, Domain name, and DNS Server)
Retrieving configuration information for the specified workstation (Win2000/XP)
Using the heap of the calling process to allocate memory blocks
Displaying standard progress dialog box when copying files
Drawing Windows predefined bitmaps using the LoadBitmap functions
Enumerating files opened on the network
Converting command-line string to a set of Unicode argument strings (WinNT only)

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
 
DO decl
 
LOCAL lnCmdlinePtr, lnArrayPtr, lnParamCnt
lnCmdlinePtr = GetCommandLine()
lnParamCnt = 0
lnArrayPtr = CommandLineToArgvW(lnCmdlinePtr, @lnParamCnt)
 
IF lnArrayPtr = 0 Or lnParamCnt = 0
    ? "Error code returned:", GetLastError()
    RETURN
ENDIF
 
LOCAL lnArraySize, lcBuffer
lnArraySize = GlobalSize(lnArrayPtr)
lcBuffer = Repli(Chr(0), lnArraySize)
 
= CopyMemory (@lcBuffer, lnArrayPtr, lnArraySize)
= GlobalFree (lnArrayPtr)
 
* first DWORD (4 bytes) stores a pointer to data
* I assume that it is always a contiguous memory block
lcBuffer = SUBSTR(lcBuffer, 5)
? lcBuffer
 
PROCEDURE  decl
    DECLARE INTEGER GetLastError IN kernel32
    DECLARE INTEGER GetCommandLine IN kernel32
    DECLARE INTEGER GlobalSize IN kernel32 INTEGER hMem
    DECLARE INTEGER GlobalFree IN kernel32 INTEGER hMem
 
    DECLARE INTEGER CommandLineToArgvW IN shell32;
        INTEGER lpCmdLine, INTEGER @pNumArgs
 
    DECLARE RtlMoveMemory IN kernel32 As CopyMemory;
        STRING @Dest, INTEGER Source, INTEGER nLength
 
 

User rating: 0/10 (0 votes)
Rate this code sample:
  • ~
1015 bytes  
Created: 2001-12-11 19:47:38  
Modified: 2001-12-11 19:48:10  
Visits in 7 days: 95  
Listed functions:
CommandLineToArgvW
CopyMemory
GetCommandLine
GetLastError
GlobalFree
GlobalSize
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 (54.234.42.16)
4 sec.Example: 'How to create transparent areas inside a form -- punching holes in the form'
27.48 min.Function: 'CeRapiUninit'
27.53 min.Function: 'NetServerGetInfo'
Function group: 'Network Management'
27.6 min.Example: 'Using IsChild() for testing ThisForm.ShowWindow property'
4.16 hrs.Example: 'URL: splitting into its component parts'
 Function: 'GetFileSizeEx'
4.38 hrs.Function: 'SetTextColor'
 Function: 'EnumDeviceDrivers'
Function group: 'Performance Monitoring'
5.62 hrs.Function: 'GetWindowInfo'
Function group: 'Window'
 Example: 'Moving shortcut to a specified position on the Windows Desktop'
Google
Advertise here!