Menu

#202 Close CHM before building

Next Release
open
nobody
5
2005-09-05
2005-09-05
Nimmzo
No

Goal: avoid the message.
"The compiled HTML Help file is probably open."
"Please close it and try again."

File:
SourceStable\src\Documenter\Msdn\MsdnDocumenter.c
s

Function: CanBuild(...)

Source code in the block try:

if (File.Exists(path))
{
#if !CLOSE_CHM // Do not define this conditional
variable. Add or remove the "!" prefix
Process[] arrProc =
Process.GetProcessesByName("hh"); // (H)TML (H)elp
viewer.exe
int iNbrProc = arrProc.GetLength(0);
if (iNbrProc > 0)
for (int indProc = 0; indProc <
iNbrProc; indProc++)
if (arrProc
[indProc].MainWindowTitle.StartsWith
(MyConfig.HtmlHelpName))
{ // Under
WinXP, the title of the window begin by the chm title
arrProc
[indProc].CloseMainWindow(); // Close the correct .chm
break;
}
#else // original code
//if we can move the file, then it is not open...
File.Move(path, temp);
File.Move(temp, path);
#endif
}

Discussion


Log in to post a comment.