Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
Simulating DOEVENTS
Current System information
Hiding mouse cursor
Reading data from INI files
Running a regular FoxPro form while main VFP window is minimized
Starting a dialog box for connecting to network resources and passing input parameters
Using IsChild() for testing ThisForm.ShowWindow property
Using the Semaphore object
Winsock: how to retrieve a service information corresponding to a service name
Adding supplementary data to AVI files
An alternative way of setting Form.Closable to False
GetFileOwner - Get the owner of an NTFS file
Simple MAPI: how to resolve a name to unique address list entry
Building a tree of subdirectories for a given path using FindFile functions
Drawing a window caption using the DrawCaption routine
Enumerating MIDI output devices
How to enumerate terminal servers within the specified Windows domain
How to retrieve version information for the specified file
Retrieving geometrical parameters of the system desktop window
Copying files as a transacted operation (Vista)
How to generate UUID values
Reading STARTUPINFO structure for the current VFP session
Setting and retrieving the double-click time for the mouse
How to test file attributes (key method for FileExists and DirectoryExists routines)
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: 109  
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 (50.19.155.235)
4 sec.Function: 'EndUpdateResource'
1.5 hrs.Function: 'PaintDesktop'
Function group: 'Painting and Drawing'
3.37 hrs.Function: 'GetVersion'
Function group: 'System Information'
 Example: 'Custom HttpRequest class (WinHTTP)'
3.48 hrs.Example: 'Subclassing CommandButton control to create BackColor property'
14.72 hrs.Function: 'OpenService'
 Function: 'PathGetShortPath'
17.6 hrs.Example: 'Hiding mouse cursor'
18.77 hrs.Example: 'Moving shortcut to a specified position on the Windows Desktop'
18.87 hrs.Function: 'GetPrivateProfileSectionNames'
Function group: 'Registry'
Google
Advertise here!