Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
Moving shortcut to a specified position on the Windows Desktop
Obtaining names and positions for shortcuts located on the Windows Desktop
..msdn    Add comment     W32 Constants      Translate this page
Writes data to an area of memory in a specified process.
Code examples:
Obtaining names and positions for shortcuts located on the Windows Desktop
Moving shortcut to a specified position on the Windows Desktop
BOOL WINAPI WriteProcessMemory(
  __in   HANDLE hProcess,
  __in   LPVOID lpBaseAddress,
  __in   LPCVOID lpBuffer,
  __in   SIZE_T nSize,
  __out  SIZE_T *lpNumberOfBytesWritten
FoxPro declaration:
DECLARE INTEGER WriteProcessMemory IN kernel32;
    INTEGER hProcess,;
    INTEGER lpBaseAddress,;
    INTEGER lpBuffer,;
    LONG nSize,;
    LONG @ lpNumberOfBytesWritten

hProcess [in]
A handle to the process memory to be modified. The handle must have PROCESS_VM_WRITE and PROCESS_VM_OPERATION access to the process.

lpBaseAddress [in]
A pointer to the base address in the specified process to which data is written.

lpBuffer [in]
A pointer to the buffer that contains data to be written in the address space of the specified process.

nSize [in]
The number of bytes to be written to the specified process.

lpNumberOfBytesWritten [out]
A pointer to a variable that receives the number of bytes transferred into the specified process.
Return value:
If the function succeeds, the return value is nonzero.
My comment:
The entire area to be written to must be accessible or the operation fails.

See also: ReadProcessMemory, VirtualAllocEx
Word Index links for the WriteProcessMemory :
Translate this page:
  Spanish    Portuguese    German    French    Italian offers instant, free translations of text or web pages.
Created: 2012-02-07 20:22:22
Modified: 2012-02-07 20:24:34
Visited in last 7 days: 27
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 (
8 sec.Function: 'MessageBox'
16 sec.Function: 'WinHttpOpenRequest'
25 sec.Function: 'GetKBCodePage'
33 sec.Function: 'SetConsoleTextAttribute'
42 sec.Function: 'GetIpStatistics'
50 sec.
58 sec.Example: 'Locking mouse and keyboard input for the VFP application'
1.15 min.Function: 'GetTcpStatistics'
1.28 min.Function: 'ScreenToClient'
1.45 min.Function: 'GetComputerName'
Advertise here!