none
Visual Foxpro 6.0 with Windows Fax Viewer

    Question

  •  
    I am using Visual Foxpro 6.0 version. An image/picture is displayed in a form of Visual Foxpro. When we click the image, it will display in Windows Fax Viewer. What is the code and proceedures for to link with fax viewer.
     
    Roy MM
    Friday, July 13, 2007 7:51 AM

Answers

  • If the Fax Viewer is the default Windows program associated with the jpg extension, then you can use ShellExecute (or shell object) to run this program, e.g.:

     

    DECLARE INTEGER ShellExecute ;
    IN SHELL32.dll ;
    INTEGER nWinHandle, ;
    STRING cOperation, ;
    STRING cFileName, ;
    STRING cParameters, ;
    STRING cDirectory, ;
    INTEGER nShowWindow

    **retreive the main VFP window handle (this handle is used by ShellExecute)

    DECLARE INTEGER FindWindow ;
    IN WIN32API ;
    STRING cNull, ;
    STRING cWinName

    lnResult=ShellExecute(FindWindow( 0, _SCREEN.caption), "Open", tcDocument, "", "c:\temp\", 1)

    **Error messages if the return value is < 32
    IF lnResult < 32
    DO CASE
    CASE lnResult=2
    Wait wind "Invalid association or URL."
    CASE lnResult=31
    Wait wind "No association."
    CASE lnResult=29
    Wait wind "Can't start application."
    CASE lnResult=30
    Wait wind "Application already open."
    ENDCASE
    ENDIF

     

    tcDocument would be your picture with the full path. Code is taken from UT FAQ How to open any document.

    Monday, July 16, 2007 2:10 PM
    Moderator

All replies

  •  
    I am using Visual Foxpro 6.0 version. An image/picture which is displayed in a form. What is the code: when we click the image, it will display in Windows Fax Viewer. Please help me...............
     
    Roy MM
    Monday, July 16, 2007 12:21 PM
  • If you need only to view fax, you may put in click method of image a command like:

    RUN <faxviewer exe file>

    Monday, July 16, 2007 1:41 PM
  • If the Fax Viewer is the default Windows program associated with the jpg extension, then you can use ShellExecute (or shell object) to run this program, e.g.:

     

    DECLARE INTEGER ShellExecute ;
    IN SHELL32.dll ;
    INTEGER nWinHandle, ;
    STRING cOperation, ;
    STRING cFileName, ;
    STRING cParameters, ;
    STRING cDirectory, ;
    INTEGER nShowWindow

    **retreive the main VFP window handle (this handle is used by ShellExecute)

    DECLARE INTEGER FindWindow ;
    IN WIN32API ;
    STRING cNull, ;
    STRING cWinName

    lnResult=ShellExecute(FindWindow( 0, _SCREEN.caption), "Open", tcDocument, "", "c:\temp\", 1)

    **Error messages if the return value is < 32
    IF lnResult < 32
    DO CASE
    CASE lnResult=2
    Wait wind "Invalid association or URL."
    CASE lnResult=31
    Wait wind "No association."
    CASE lnResult=29
    Wait wind "Can't start application."
    CASE lnResult=30
    Wait wind "Application already open."
    ENDCASE
    ENDIF

     

    tcDocument would be your picture with the full path. Code is taken from UT FAQ How to open any document.

    Monday, July 16, 2007 2:10 PM
    Moderator