Home Image-Pro Plus Automation with Macros

Declare image "saved"

(Originally posted by gnunesjr on 1/8/2006)

In my macros, I often create temporary images, and under some circumstances it is best if the user closes them manually by clicking the "X" in the upper right corner.

Is there a way to programmatically suppress the pop-up dialog that warns that the image has not been saved? Ideally, I'd like to set something that declares the image as saved without actually saving it.

 

Comments

  • (Originally posted by YuriG on 1/9/2006)

    The above mentioned dialog is shown only on images, which have the Modified flag set to True. You can pragmatically reset this flag using the following macro (the macro uses IPP SDK functions):
    '**************************************
    'declarations (from Hil.bas)
    Declare Function HilImControl Lib "HILIMG32" (ByVal ihImage _
    As Long, ByVal icCommand As Long, ByVal sParam As _
    Integer, ByVal lParam As Long, pParam As Long) As Long
    Public Const IMCMD_SETMODIFIED = 24

    Sub ResetModifyFlag()
    Dim bModified As Boolean, hImage As Long
    'get active image handle
    ret = IpDocGet(GETDOCVRI, DOCSEL_ACTIVE, hImage)
    'set Modify flag to False
    bModified=False
    ret = HilImControl(hImage, IMCMD_SETMODIFIED, bModified, _
    0, IPNULL)
    End Sub
    '**************************************

  • (Originally posted by KevinR on 1/9/2006)

    You could also go to "Edit | Preferences", and uncheck "Prompt before closing modified images". This must be manually done, however, as we don't have a programming interface for that preference.

Sign In or Register to comment.