StatusDlg.Hide

StatusDlg.Hide ( 

)

Example 1

StatusDlg.Hide();

Hides the built-in status dialog that is currently displayed.

Example 2

-- Allow the user to select a directory to unzip the files.
target_folder = Dialog.FolderBrowse("Select a Folder", "C:\\");


-- Check to see if the user cancelled or an error occurred.
if (target_folder ~= "CANCEL") and (target_folder ~= "") then
    -- Gets a list of the contents of a zip file.
    zip_contents = Zip.GetContents("AutoPlay\\Docs\\Info.zip", true);

    -- Get the error code of the last action.
    error = Application.GetLastError();

    -- If an error occurred, display the error code message.
    if (error ~= 0) then
        Dialog.Message("Error", _tblErrorMessages[error], MB_OK, MB_ICONEXCLAMATION);
    else
        -- Take the table and turn it into a string with newlines for displaying.
        zip_contents_display = Table.Concat(zip_contents, "\r\n", 1, TABLE_ALL);

        -- Ask the user if they are sure they would like to unzip the contents.
        result = Dialog.Message("Information", "The following files will be unzipped:\r\nClick the Cancel button to abort the process.\r\n\r\n"..zip_contents_display, MB_OKCANCEL)

        -- If the user clicked Ok, unzip the files.
        if (result == IDOK) then
            -- Show the status dialog.
            StatusDlg.Show();
            -- Extract the contents of the Zip file.
            Zip.Extract("AutoPlay\\Docs\\Info.zip", {"*.*"}, target_folder, true, true, "", ZIP_OVERWRITE_NEVER, nil);

            -- Check the error code for the last action.
            error = Application.GetLastError();

            -- Hide the status dialog.
            StatusDlg.Hide();

            -- If an error occurred, display the error code message.
            if (error ~= 0) then
                Dialog.Message("Errror", tblErrorMessages[error], MB_OK, MB_ICONEXCLAMATION);
            else
                Dialog.Message("Success", "The unzipping was successful.", MB_OK, MB_ICONINFORMATION);
            end
        end
    end
end

This example first prompts the user to select a folder using the Dialog.FolderBrowse action. This folder will be used to unzip the files to. The user is then presented with a dialog containing the names of the files that will be unzipped and allows them to abort the process. If the user clicks Ok, the files are unzipped to the folder they selected. Notification will be given at the end of the process as to whether or not the procedure was successful.

See also:  Related Actions