Editor_Compare

Compares two files. You can use this inline function or explicitly send the EE_COMPARE message.

Editor_Compare( HWND hwnd, UINT nFlags, LPCWSTR pszDocument1, LPCWSTR pszDocument2, LPCWSTR pszResultFileName );

Parameters

hwnd

Specifies the window handle of the view or frame of EmEditor.

nFlags

Specifies a combination of the following values.

COMPARE_GENERATE_REPORT

Generates a report file. A file path must be specified in strResultFileName.

COMPARE_IGNORE_CASE

Ignores case.

COMPARE_IGNORE_COMMENT

Ignores text marked as a comment by the configuration.

COMPARE_IGNORE_CRLF

Ignores differences in newline characters.

COMPARE_IGNORE_EMBEDDED_SPACE

Ignores spaces within the first and last non-whitespace characters within a line.

COMPARE_IGNORE_ENCODING

Ignores encoding difference.

COMPARE_IGNORE_LEAD_SPACE

Ignores spaces before the first non-whitespace character within a line.

COMPARE_IGNORE_TRAIL_SPACE

Ignores spaces after the last non-whitespace characters within a line.

COMPARE_OPEN_REPORT

Opens the report file. COMPARE_GENERATE_REPORT must also be specified.

COMPARE_REPORT_3_COL

Outputs report in a 3 column format.

COMPARE_REPORT_DIFF_ONLY

Reports non-identical lines only.

COMPARE_QUALITY_1

Fastest method that that searches nearby lines.

COMPARE_QUALITY_2

Faster method.

COMPARE_QUALITY_3

Medium speed.

COMPARE_QUALITY_4

More precise method.

COMPARE_QUALITY_5

Most precise method that searches the entire file (up to a certain limit).

COMPARE_QUICK

Quickly compares, and will not highlight differences. This flag cannot be combined with other options except COMPARE_QUIET.

COMPARE_QUIET

Does not display any output messages.

COMPARE_RESET

Resets comparison or synchronized scrolling mode and clears comparison results.

COMPARE_RESET_AFTER

Resets comparison or synchronized scrolling mode and clears comparison results after comparison and report generation. COMPARE_GENERATE_REPORT must also be specified.

COMPARE_RESTORE_POS

Restores window positions when finished.

COMPARE_SPLIT_VERT

Splits the window vertically to display documents.

COMPARE_SWITCH_NO_WRAP

Switches to no wrap.

COMPARE_SYNC_CARET

Synchronizes cursor positions.

COMPARE_SYNC_SCROLL_HORZ

Synchronizes horizontal scrolling.

COMPARE_SYNC_SCROLL_ONLY

Show compared documents without highlighting differences.

COMPARE_SYNC_SCROLL_VERT

Synchronizes vertical scrolling.

COMPARE_TILE_HORZ

Tiles documents horizontally.

COMPARE_TILE_VERT

Tiles documents vertically.

pszDocument1

Specifies the string to identify the first document. This value can be a file name, file name with the full path, or a colon (:) followed by the index of the document in the current group. For example, "filename.csv", "C:\data\filename.csv", or ":2".

pszDocument2

Specifies the string to identify the second document. The format of this value is the same as pszDocument1.

pszResultFileName

If COMPARE_GENERATE_REPORT is specified in the nFlags parameter, EmEditor saves a comparison report as the specified file name.

Return Values

The return value is a negative value if an error occurs. It can be one of the following values:

E_DOCUMENT_1_NOT_FOUND

Cannot find the first document.

E_DOCUMENT_2_NOT_FOUND

Cannot find the second document.

E_FAIL

Unspecified error.

E_NOT_MDI

Tabs must be enabled.

S_DIFF

Two documents are NOT identical..

S_MATCHED

Two documents are identical.

S_MATCHED_IGNORED

Two documents are identical except for ignored places.

Version

Supported on EmEditor Professional Version 17.7 or later.