Using Win32 functions in Visual FoxPro Image Gallery
Handle and Object
..msdn
CloseHandle
DuplicateHandle
GetHandleInformation
SetHandleInformation
Code examples:
Running MSDOS Shell as a child process with redirected input and output (smarter RUN command)
DuplicateHandle
..msdn    Add comment     W32 Constants      Translate this page
The DuplicateHandle function duplicates an object handle.
Code examples:
Running MSDOS Shell as a child process with redirected input and output (smarter RUN command)
Declaration:
BOOL DuplicateHandle(
  HANDLE hSourceProcessHandle,
  HANDLE hSourceHandle,
  HANDLE hTargetProcessHandle,
  LPHANDLE lpTargetHandle,
  DWORD dwDesiredAccess,
  BOOL bInheritHandle,
  DWORD dwOptions
);

FoxPro declaration:
DECLARE INTEGER DuplicateHandle IN kernel32;
    INTEGER   hSourceProcessHandle,;
    INTEGER   hSourceHandle,;
    INTEGER   hTargetProcessHandle,;
    INTEGER @ lpTargetHandle,;
    INTEGER   dwDesiredAccess,;
    INTEGER   bInheritHandle,;
    INTEGER   dwOptions

Parameters:
hSourceProcessHandle
[in] Handle to the process with the handle to duplicate.

hSourceHandle
[in] Handle to duplicate. This is an open object handle that is valid in the context of the source process.

hTargetProcessHandle
[in] Handle to the process that is to receive the duplicated handle.

lpTargetHandle
[out] Pointer to a variable that receives the duplicate handle. This handle value is valid in the context of the target process.

dwDesiredAccess
[in] Access requested for the new handle.

bInheritHandle
[in] Indicates whether the handle is inheritable.

dwOptions
[in] Optional actions.
Return value:
If the function succeeds, the return value is nonzero.
My comment:
The duplicate handle refers to the same object as the original handle. Therefore, any changes to the object are reflected through both handles. For example, the current file mark for a file handle is always the same for both handles.
Word Index links for the DuplicateHandle :
Translate this page:
  Spanish    Portuguese    German    French    Italian  
FreeTranslation.com offers instant, free translations of text or web pages.
Created: 2004-12-18 09:27:34
Modified: 2004-12-18 09:30:40
Visited in last 7 days: 12
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.37), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
Last Topics Visited (54.81.237.159)
10 sec.Function: 'EnumPrintProcessors'
21 sec.Function: 'CeRegCreateKeyEx'
32 sec.Function: 'FlashWindowEx'
44 sec.Function: 'GdipSetPageUnit'
58 sec.
Function group: 'Resource'
1.2 min.Function: 'CeOidGetInfoEx'
1.4 min.Function: 'FindFirstFile'
1.57 min.
Function group: 'Memory Management'
1.78 min.Function: 'EnumForms'
1.97 min.Function: 'CryptEncrypt'
Google
Advertise here!