Using Win32 functions in Visual FoxPro Image Gallery
Process and Thread
..msdn
AssignProcessToJobObject
CommandLineToArgvW
CreateJobObject
CreateProcess
CreateProcessAsUser
CreateProcessWithLogonW
ExitProcess
FreeEnvironmentStrings
GetCommandLine
GetCurrentProcess
GetCurrentProcessId
GetCurrentThread
GetCurrentThreadId
GetEnvironmentStrings
GetEnvironmentVariable
GetPriorityClass
GetProcessIoCounters
GetProcessTimes
GetProcessVersion
GetStartupInfo
GetThreadPriority
IsWow64Process
OpenProcess
RegisterServiceProcess
SetEnvironmentVariable
SetPriorityClass
SetThreadPriority
Sleep
TerminateJobObject
TerminateProcess
WinExec
Code examples:
Converting command-line string to a set of Unicode argument strings (WinNT only)
Retrieving the command line for the VFP session
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: 101  
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.242.233.11)
49.95 min.Example: 'How to copy the image of a form to the Clipboard using Bitmap API functions'
50.02 min.Example: 'Splash Screen for the VFP application'
50.05 min.Function: 'WNetAddConnection2'
1.86 hrs.Function: 'RpcStringFree'
Function group: 'Remote Procedure Call (RPC)'
 Function: 'PlaySound'
3.21 hrs.Function: 'SQLTables'
 Example: 'How to print picture stored in enhanced-format metafile (*.emf)'
 Example: 'Displaying bitmap using the AlphaBlend function'
3.55 hrs.Example: 'Splash Screen for the VFP application'
 Example: 'How to create a service object'
Google
Advertise here!