Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
How to change display settings: screen resolution, screen refresh rate
Adding and deleting Scheduled Tasks using NetScheduleJob API functions
Custom GDI+ class
Converting Unicode data from the Clipboard to a character string using a given code page
Enumerating data formats currently available on the clipboard
Winsock: sending email messages (SMTP, port 25)
Capturing keyboard activity of another application with the Raw Input API (VFP9)
Custom FTP Class for Visual FoxPro application
Detecting changes in connections to removable drives (VFP9)
How to download a file from the FTP server using FtpGetFile
Splash Screen for the VFP application
Enumerating raw input devices attached to the system (keyboard, mouse, human interface device)
How to activate Windows Calculator
Using Font and Text functions
Custom HttpRequest class (WinINet)
Mapping and disconnecting network drives
Establishing connection using the SQLDriverConnect
Custom HttpRequest class (WinHTTP)
How to convert a bitmap file to monochrome format (1 bpp)
Displaying bitmap using the AlphaBlend function
Using EnumPrinters function to enumerate locally installed printers
How to play AVI file on the _screen
Testing serial ports
Using WM_COPYDATA for interprocess communication (VFP9)
Simple MAPI: how to resolve a name to unique address list entry

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
 
#DEFINE SUCCESS_SUCCESS  0
#DEFINE MAPI_DIALOG      0x00000008
#DEFINE MAPI_AB_NOMODIFY 0x00000400 
DO decl
 
PRIVATE hRecip
hRecip = 0
 
LOCAL nResult, cPath, nFlags, cSearch
cPath = SYS(5) + SYS(2003)
nFlags = MAPI_DIALOG + MAPI_AB_NOMODIFY
cSearch = "Peter"
 
nResult = MAPIResolveName(0, 0, cSearch, nFlags,0, @hRecip)
 
IF nResult = SUCCESS_SUCCESS
    DO ShowRecip
ELSE
* MAPI_E_FAILURE              2
* MAPI_E_LOGIN_FAILURE        3
* MAPI_E_INSUFFICIENT_MEMORY  5
* MAPI_E_UNKNOWN_RECIPIENT    14
* MAPI_E_AMBIGUOUS_RECIPIENT  21
* MAPI_E_NOT_SUPPORTED        26
    ? "Error code:", nResult
ENDIF
 
= MAPIFreeBuffer(hRecip)
SET DEFAULT TO (cPath)
* end of main
 
PROCEDURE ShowRecip
*|typedef struct {
*|     ULONG ulReserved      0:4
*|     ULONG ulRecipClass;   4:4
*|     LPTSTR lpszName;      8:4
*|     LPTSTR lpszAddress;  12:4
*|     ULONG ulEIDSize;     16:4
*|     LPVOID lpEntryID;    20:4
*|} MapiRecipDesc, FAR *lpMapiRecipDesc; total 24 bytes
#DEFINE MapiRecipDesc_SIZE  24
#DEFINE DefNameSize         32
 
    LOCAL cRecip, hNamePtr, hAddrPtr, nEIDSize,;
        hEntryIDPtr, nEntryID, cName, cAddress
 
    cRecip = Repli(Chr(0), MapiRecipDesc_SIZE)
    = CopyMemory(@cRecip, hRecip, MapiRecipDesc_SIZE)
 
    nEIDSize = buf2dword(SUBSTR(cRecip, 17,4))
    hEntryIDPtr = buf2dword(SUBSTR(cRecip, 21,4))
 
    IF nEIDSize <> 0
        nEntryID = Repli(Chr(0), nEIDSize)
        = CopyMemory(@nEntryID, hEntryIDPtr, nEIDSize)
        nEntryId = buf2dword(nEntryID)
    ENDIF
 
    hNamePtr = buf2dword(SUBSTR(cRecip, 9,4))
    cName = Repli(Chr(0), DefNameSize)
    = CopyMemory(@cName, hNamePtr, DefNameSize)
    cName = SUBSTR(cName, 1,AT(Chr(0),cName)-1)
 
    hAddrPtr = buf2dword(SUBSTR(cRecip, 13,4))
    cAddress = Repli(Chr(0), DefNameSize)
    = CopyMemory(@cAddress, hAddrPtr, DefNameSize)
    cAddress = SUBSTR(cAddress, 1,AT(Chr(0),cAddress)-1)
 
    ? "Recipient:", cName
    ? "Email:", cAddress
    ? "Address Book ID:", nEntryId
 
PROCEDURE decl
    DECLARE INTEGER MAPIResolveName IN mapi32;
        INTEGER lhSession, INTEGER ulUIParam, STRING lpszName,;
        INTEGER flFlags, INTEGER ulReserved, INTEGER @lppRecip  
 
    DECLARE INTEGER MAPIFreeBuffer IN mapi32 INTEGER pv  
 
    DECLARE RtlMoveMemory IN kernel32 As CopyMemory; 
        STRING @Destination, INTEGER Source, INTEGER nLength 
 
FUNCTION buf2dword(lcBuffer)
RETURN Asc(SUBSTR(lcBuffer, 1,1)) + ;
    BitLShift(Asc(SUBSTR(lcBuffer, 2,1)),  8) +;
    BitLShift(Asc(SUBSTR(lcBuffer, 3,1)), 16) +;
    BitLShift(Asc(SUBSTR(lcBuffer, 4,1)), 24)
 
 
 

User rating: 0/10 (0 votes)
Rate this code sample:
  • ~
2505 bytes  
Created: 2003-05-27 08:16:21  
Modified: 2004-09-12 16:59:33  
Visits in 7 days: 72  
Listed functions:
MAPIFreeBuffer
MAPIResolveName
Printer friendly API declarations
My comment:


#kwd: sln_reademail.
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.17.109.248)
1.48 hrs.Function: 'RealGetWindowClass'
Function group: 'Window'
2.29 hrs.Function: 'PostMessage'
Function group: 'Message and Message Queue'
 Function: 'EnumJobs'
9.72 hrs.Example: 'Retrieving information about the specified icon'
9.96 hrs.Example: 'Creating a file, then moving it to another destination'
 Function: 'SQLDriverConnect'
Function group: 'ODBC API'
12.44 hrs.Function: 'CeRegDeleteKey'
 Example: 'How to enable the SE_SHUTDOWN_NAME privilege for the application'
 Example: 'GDI+: sending image of FoxPro form to printer'
17.67 hrs.Function: 'GdipGetImageDecodersSize'
Function group: 'GDI+'
Google
Advertise here!