;@echo off

@rem ***************************************************************************
@rem *                                                                         *
@rem * Make map file from Microsoft Visual C++ generated resource.h            *
@rem * & resource.hm files.                                                    *
@rem *                                                                         *
@rem ***************************************************************************

@setlocal
@rem %1 <projdirs>
@rem %2 <help.hm>

echo // %0 generated help map file.  Used by WAN Links config. >%2
echo. >>%2

echo // Commands (ID_* and IDM_*) >>%2
for /F "eol=; tokens=1,2 delims=, " %%i in (%1) do if exist %%i\%%j.h makehm ID_,HID_,0x10000 IDM_,HIDM_,0x10000 %%i\%%j.h >>%2
echo. >>%2

echo // Prompts (IDP_*) >>%2
for /F "eol=; tokens=1,2 delims=, " %%i in (%1) do if exist %%i\%%j.h makehm IDP_,HIDP_,0x30000 %%i\%%j.h >>%2
echo. >>%2

echo // Resources (IDR_*) >>%2
for /F "eol=; tokens=1,2 delims=, " %%i in (%1) do if exist %%i\%%j.h makehm IDR_,HIDR_,0x20000 %%i\%%j.h >>%2
echo. >>%2

echo // Dialogs (IDD_*) >>%2
for /F "eol=; tokens=1,2 delims=, " %%i in (%1) do if exist %%i\%%j.h makehm IDD_,HIDD_,0x20000 %%i\%%j.h >>%2
echo. >>%2

echo // Frame Controls (IDW_*) >>%2
for /F "eol=; tokens=1,2 delims=, " %%i in (%1) do if exist %%i\%%j.h makehm IDW_,HIDW_,0x50000 %%i\%%j.h >>%2
echo. >>%2

echo // Custom Help IDs (IDH_*) >>%2
for /F "eol=; tokens=1,2 delims=, " %%i in (%1) do if exist %%i\%%j.h makehm IDH_,HIDH_,0x20000 %%i\%%j.h >>%2
echo. >>%2

echo // Dialog Controls (IDC_*) >>%2
for /F "eol=; tokens=1,2 delims=, " %%i in (%1) do if exist %%i\%%j.hm makehm HIDC_,HIDC_,0x00000 %%i\%%j.hm >>%2
echo. >>%2

@endlocal
