home *** CD-ROM | disk | FTP | other *** search
/ Practical Internet 2002 February / Practical Internet February 2002.iso / pc / Software / Browsing / httrack-3.09e2.exe / {app} / src_win / WinHTTrack / inprogress.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  2001-10-19  |  29.3 KB  |  1,050 lines

  1. // inprogress.cpp : implementation file
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "Shell.h"
  6. #include "inprogress.h"
  7. #include "about.h"
  8. #include "iplog.h"
  9.  
  10. #include "NewProj.h"
  11. //#include "option.h"
  12.  
  13. /* Externe C */
  14. extern "C" {
  15.   #include "htscore.h"
  16. }
  17.  
  18. #include "Wid1.h"
  19. #include "EasyDropTarget.h"
  20.  
  21. #include "InfoUrl.h"
  22.  
  23. extern CNewProj* dialog0;
  24. extern CMainTab* maintab;
  25.  
  26. extern int INPROGRESS_LOCKED;
  27. extern int termine_requested;
  28. extern int termine;
  29. extern int soft_term_requested;
  30. extern int INPROGRESS_LOCKED;
  31. extern int INREFRESH_LOCKED;
  32. extern HICON httrack_icon;
  33. //extern int fexist(char*);
  34. //extern char* fconcat(char*,char*);
  35. extern char choixdeb[3];
  36. // PATCH-->
  37. extern int termine;
  38.  
  39. /* interrupted!! */
  40. extern "C" int exit_xh;
  41.  
  42. // Helper
  43. extern LaunchHelp* HtsHelper;
  44.  
  45. // InfoUrl
  46. extern CInfoUrl* _Cinprogress_inst;
  47.  
  48. #ifdef _DEBUG
  49. #define new DEBUG_NEW
  50. #undef THIS_FILE
  51. static char THIS_FILE[] = __FILE__;
  52. #endif
  53.  
  54. // Refresh
  55. extern int INFILLMEM_LOCKED;     // refresh mΘmoire en cours
  56. extern InpInfo SInfo;
  57. int inprogress_refresh();
  58.  
  59. // this app
  60. #include "Winhttrack.h"
  61. extern CWinHTTrackApp* this_app;
  62.  
  63.  
  64. // objet
  65. extern Cinprogress* inprogress;
  66.  
  67.  
  68. /* pour la fin */
  69. #include "DialogContainer.h"
  70. #include "splitter.h"
  71. extern CSplitterFrame* this_CSplitterFrame;
  72. #include "infoend.h"
  73. extern Cinfoend* this_Cinfoend;
  74.  
  75. /* Main WizTab frame */
  76. #include "WizTab.h"
  77. extern CWizTab* this_CWizTab;
  78. extern CWizTab* this_intCWizTab;
  79.  
  80. // Pour la fin
  81. char end_mirror_msg[8192]="";
  82.  
  83. extern t_StatsBuffer StatsBuffer[NStatsBuffer];
  84.  
  85.  
  86. /////////////////////////////////////////////////////////////////////////////
  87. // Cinprogress dialog
  88. IMPLEMENT_DYNCREATE(Cinprogress, CPropertyPage)
  89.  
  90.  
  91. Cinprogress::Cinprogress()
  92.     : CPropertyPage(Cinprogress::IDD)
  93. {
  94.   timer=0;
  95.   //{{AFX_DATA_INIT(Cinprogress)
  96.     m_inphide = FALSE;
  97.     //}}AFX_DATA_INIT
  98. }
  99.  
  100. void Cinprogress::DoDataExchange(CDataExchange* pDX)
  101. {
  102.     CPropertyPage::DoDataExchange(pDX);
  103.     //{{AFX_DATA_MAP(Cinprogress)
  104.     DDX_Control(pDX, IDC_nn9, m_nn9);
  105.     DDX_Control(pDX, IDC_nn8, m_nn8);
  106.     DDX_Control(pDX, IDC_nn7, m_nn7);
  107.     DDX_Control(pDX, IDC_nn6, m_nn6);
  108.     DDX_Control(pDX, IDC_nn5, m_nn5);
  109.     DDX_Control(pDX, IDC_nn4, m_nn4);
  110.     DDX_Control(pDX, IDC_nn3, m_nn3);
  111.     DDX_Control(pDX, IDC_nn2, m_nn2);
  112.     DDX_Control(pDX, IDC_nn13, m_nn13);
  113.     DDX_Control(pDX, IDC_nn12, m_nn12);
  114.     DDX_Control(pDX, IDC_nn11, m_nn11);
  115.     DDX_Control(pDX, IDC_nn10, m_nn10);
  116.     DDX_Control(pDX, IDC_nn1, m_nn1);
  117.     DDX_Control(pDX, IDC_nn0, m_nn0);
  118.     DDX_Control(pDX, IDC_nm13, m_nm13);
  119.     DDX_Control(pDX, IDC_nm12, m_nm12);
  120.     DDX_Control(pDX, IDC_nm11, m_nm11);
  121.     DDX_Control(pDX, IDC_nm10, m_nm10);
  122.     DDX_Control(pDX, IDC_nm9, m_nm9);
  123.     DDX_Control(pDX, IDC_nm8, m_nm8);
  124.     DDX_Control(pDX, IDC_nm7, m_nm7);
  125.     DDX_Control(pDX, IDC_nm6, m_nm6);
  126.     DDX_Control(pDX, IDC_nm5, m_nm5);
  127.     DDX_Control(pDX, IDC_nm4, m_nm4);
  128.     DDX_Control(pDX, IDC_nm3, m_nm3);
  129.     DDX_Control(pDX, IDC_nm2, m_nm2);
  130.     DDX_Control(pDX, IDC_nm1, m_nm1);
  131.     DDX_Control(pDX, IDC_nm0, m_nm0);
  132.     DDX_Control(pDX, IDC_st13, m_st13);
  133.     DDX_Control(pDX, IDC_st12, m_st12);
  134.     DDX_Control(pDX, IDC_st11, m_st11);
  135.     DDX_Control(pDX, IDC_st10, m_st10);
  136.     DDX_Control(pDX, IDC_st9, m_st9);
  137.     DDX_Control(pDX, IDC_st8, m_st8);
  138.     DDX_Control(pDX, IDC_st7, m_st7);
  139.     DDX_Control(pDX, IDC_st6, m_st6);
  140.     DDX_Control(pDX, IDC_st5, m_st5);
  141.     DDX_Control(pDX, IDC_st4, m_st4);
  142.     DDX_Control(pDX, IDC_st3, m_st3);
  143.     DDX_Control(pDX, IDC_st2, m_st2);
  144.     DDX_Control(pDX, IDC_st1, m_st1);
  145.     DDX_Control(pDX, IDC_st0, m_st0);
  146.     DDX_Control(pDX, IDC_sk0, m_sk0);
  147.     DDX_Control(pDX, IDC_sk1, m_sk1);
  148.     DDX_Control(pDX, IDC_sk2, m_sk2);
  149.     DDX_Control(pDX, IDC_sk3, m_sk3);
  150.     DDX_Control(pDX, IDC_sk4, m_sk4);
  151.     DDX_Control(pDX, IDC_sk5, m_sk5);
  152.     DDX_Control(pDX, IDC_sk6, m_sk6);
  153.     DDX_Control(pDX, IDC_sk7, m_sk7);
  154.     DDX_Control(pDX, IDC_sk8, m_sk8);
  155.     DDX_Control(pDX, IDC_sk9, m_sk9);
  156.     DDX_Control(pDX, IDC_sk10, m_sk10);
  157.     DDX_Control(pDX, IDC_sk11, m_sk11);
  158.     DDX_Control(pDX, IDC_sk12, m_sk12);
  159.     DDX_Control(pDX, IDC_sk13, m_sk13);
  160.     DDX_Control(pDX, IDC_sl0, m_sl0);
  161.     DDX_Control(pDX, IDC_sl1, m_sl1);
  162.     DDX_Control(pDX, IDC_sl2, m_sl2);
  163.     DDX_Control(pDX, IDC_sl3, m_sl3);
  164.     DDX_Control(pDX, IDC_sl4, m_sl4);
  165.     DDX_Control(pDX, IDC_sl5, m_sl5);
  166.     DDX_Control(pDX, IDC_sl6, m_sl6);
  167.     DDX_Control(pDX, IDC_sl7, m_sl7);
  168.     DDX_Control(pDX, IDC_sl8, m_sl8);
  169.     DDX_Control(pDX, IDC_sl9, m_sl9);
  170.     DDX_Control(pDX, IDC_sl10, m_sl10);
  171.     DDX_Control(pDX, IDC_sl11, m_sl11);
  172.     DDX_Control(pDX, IDC_sl12, m_sl12);
  173.     DDX_Control(pDX, IDC_sl13, m_sl13);
  174.     DDX_Check(pDX, IDC_inphide, m_inphide);
  175.     //}}AFX_DATA_MAP
  176. }
  177.  
  178. //const UINT wm_IcnRest = RegisterWindowMessage( FINDMSGSTRING );
  179. #define wm_CEasyDropTargetCallback (WM_USER + 2)
  180. #define wm_Timer (WM_USER + 3)
  181. #define wm_MirrorFinished (WM_USER + 4)
  182. BEGIN_MESSAGE_MAP(Cinprogress, CPropertyPage)
  183.     //{{AFX_MSG_MAP(Cinprogress)
  184.     ON_WM_CLOSE()
  185.     ON_BN_CLICKED(IDC_sk0, Onsk0)
  186.     ON_BN_CLICKED(IDC_sk1, Onsk1)
  187.     ON_BN_CLICKED(IDC_sk2, Onsk2)
  188.     ON_BN_CLICKED(IDC_sk3, Onsk3)
  189.     ON_BN_CLICKED(IDC_sk4, Onsk4)
  190.     ON_BN_CLICKED(IDC_sk5, Onsk5)
  191.     ON_BN_CLICKED(IDC_sk6, Onsk6)
  192.     ON_BN_CLICKED(IDC_sk7, Onsk7)
  193.     ON_BN_CLICKED(IDC_sk8, Onsk8)
  194.     ON_BN_CLICKED(IDC_sk9, Onsk9)
  195.     ON_BN_CLICKED(IDCANCEL, OnEscape)
  196.     ON_BN_CLICKED(IDC_ipabout, Onipabout)
  197.     ON_WM_DESTROY()
  198.     ON_WM_HELPINFO()
  199.     ON_BN_CLICKED(IDC_sk10, Onsk10)
  200.     ON_BN_CLICKED(IDC_sk11, Onsk11)
  201.     ON_BN_CLICKED(IDC_sk12, Onsk12)
  202.     ON_BN_CLICKED(IDC_sk13, Onsk13)
  203.     ON_WM_CREATE()
  204.     ON_BN_CLICKED(IDC_nm0, Onnm0)
  205.     ON_BN_CLICKED(IDC_nm1, Onnm1)
  206.     ON_BN_CLICKED(IDC_nm2, Onnm2)
  207.     ON_BN_CLICKED(IDC_nm3, Onnm3)
  208.     ON_BN_CLICKED(IDC_nm4, Onnm4)
  209.     ON_BN_CLICKED(IDC_nm5, Onnm5)
  210.     ON_BN_CLICKED(IDC_nm6, Onnm6)
  211.     ON_BN_CLICKED(IDC_nm7, Onnm7)
  212.     ON_BN_CLICKED(IDC_nm8, Onnm8)
  213.     ON_BN_CLICKED(IDC_nm9, Onnm9)
  214.     ON_BN_CLICKED(IDC_nm10, Onnm10)
  215.     ON_BN_CLICKED(IDC_nm11, Onnm11)
  216.     ON_BN_CLICKED(IDC_nm12, Onnm12)
  217.     ON_BN_CLICKED(IDC_nm13, Onnm13)
  218.     ON_BN_CLICKED(IDC_nn0, Onnm0)
  219.     ON_BN_CLICKED(IDC_nn1, Onnm1)
  220.     ON_BN_CLICKED(IDC_nn2, Onnm2)
  221.     ON_BN_CLICKED(IDC_nn3, Onnm3)
  222.     ON_BN_CLICKED(IDC_nn4, Onnm4)
  223.     ON_BN_CLICKED(IDC_nn5, Onnm5)
  224.     ON_BN_CLICKED(IDC_nn6, Onnm6)
  225.     ON_BN_CLICKED(IDC_nn7, Onnm7)
  226.     ON_BN_CLICKED(IDC_nn8, Onnm8)
  227.     ON_BN_CLICKED(IDC_nn9, Onnm9)
  228.     ON_BN_CLICKED(IDC_nn10, Onnm10)
  229.     ON_BN_CLICKED(IDC_nn11, Onnm11)
  230.     ON_BN_CLICKED(IDC_nn12, Onnm12)
  231.     ON_BN_CLICKED(IDC_nn13, Onnm13)
  232.   ON_BN_CLICKED(IDC_st0, Onst0)
  233.     ON_BN_CLICKED(IDC_st1, Onst1)
  234.     ON_BN_CLICKED(IDC_st2, Onst2)
  235.     ON_BN_CLICKED(IDC_st3, Onst3)
  236.     ON_BN_CLICKED(IDC_st4, Onst4)
  237.     ON_BN_CLICKED(IDC_st5, Onst5)
  238.     ON_BN_CLICKED(IDC_st6, Onst6)
  239.     ON_BN_CLICKED(IDC_st7, Onst7)
  240.     ON_BN_CLICKED(IDC_st8, Onst8)
  241.     ON_BN_CLICKED(IDC_st9, Onst9)
  242.     ON_BN_CLICKED(IDC_st10, Onst10)
  243.     ON_BN_CLICKED(IDC_st11, Onst11)
  244.     ON_BN_CLICKED(IDC_st12, Onst12)
  245.     ON_BN_CLICKED(IDC_st13, Onst13)
  246.     ON_WM_TIMER()
  247.     ON_BN_CLICKED(IDC_inphide, Oninphide)
  248.     //}}AFX_MSG_MAP
  249.   ON_MESSAGE( wm_CEasyDropTargetCallback, DragDropText)
  250.   ON_NOTIFY_EX( TTN_NEEDTEXT, 0, OnToolTipNotify )
  251.   ON_BN_CLICKED(ID_ABOUT,Onipabout)
  252.   ON_BN_CLICKED(ID_FILE_EXIT,OnStopall)
  253.   ON_BN_CLICKED(ID_LOG_VIEWLOG,OniplogLog)
  254.   ON_BN_CLICKED(ID_LOG_VIEWERRORLOG,OniplogErr)
  255.   ON_BN_CLICKED(ID_LOG_VIEWTRANSFERS,OnViewTransfers)
  256.   ON_BN_CLICKED(ID_FILE_PAUSE,OnPause)
  257.   ON_BN_CLICKED(ID_OPTIONS_MODIFY,OnModifyOpt)
  258.   ON_COMMAND(ID_HELP_FINDER,OnHelpInfo2)
  259.   ON_COMMAND(ID_HELP,OnHelpInfo2)
  260.     ON_COMMAND(ID_DEFAULT_HELP,OnHelpInfo2)
  261.   // Fin du miroir
  262.   ON_MESSAGE( wm_MirrorFinished, OnEndMirror)
  263.   END_MESSAGE_MAP()
  264. //ON_REGISTERED_MESSAGE( wm_IcnRest, IconRestore )
  265. /////////////////////////////////////////////////////////////////////////////
  266. // Cinprogress message handlers
  267.  
  268. void Cinprogress::OnClose() 
  269. {
  270.   OnStopall();
  271. }
  272.  
  273. void Cinprogress::Onsk0()  {
  274.   if (hts_is_parsing(-1)) {  // parsing
  275.     if (hts_is_testing())
  276.       hts_cancel_test();     // cancel test
  277.     /*else*/
  278.     hts_cancel_parsing();  // cancel parsing
  279.   } else
  280.     StatsBuffer_cancel(0);
  281. }
  282. void Cinprogress::Onsk1()  {
  283.   StatsBuffer_cancel(1);
  284. }
  285. void Cinprogress::Onsk2()  {
  286.   StatsBuffer_cancel(2);
  287. }
  288. void Cinprogress::Onsk3()  {
  289.   StatsBuffer_cancel(3);
  290. }
  291. void Cinprogress::Onsk4()  {
  292.   StatsBuffer_cancel(4);
  293. }
  294. void Cinprogress::Onsk5()  {
  295.   StatsBuffer_cancel(5);
  296. }
  297. void Cinprogress::Onsk6()  {
  298.   StatsBuffer_cancel(6);
  299. }
  300. void Cinprogress::Onsk7()  {
  301.   StatsBuffer_cancel(7);
  302. }
  303. void Cinprogress::Onsk8()  {
  304.   StatsBuffer_cancel(8);
  305. }
  306. void Cinprogress::Onsk9()  {
  307.   StatsBuffer_cancel(9);
  308. }
  309. void Cinprogress::Onsk10()  {
  310.   StatsBuffer_cancel(10);
  311. }
  312. void Cinprogress::Onsk11()  {
  313.   StatsBuffer_cancel(11);
  314. }
  315. void Cinprogress::Onsk12()  {
  316.   StatsBuffer_cancel(12);
  317. }
  318. void Cinprogress::Onsk13()  {
  319.   StatsBuffer_cancel(13);
  320. }
  321.  
  322.  
  323. // Capture des static
  324. void Cinprogress::Onnm0()  { StatsBuffer_info(0); }
  325. void Cinprogress::Onnm1()  { StatsBuffer_info(1); }
  326. void Cinprogress::Onnm2()  { StatsBuffer_info(2); }
  327. void Cinprogress::Onnm3()  { StatsBuffer_info(3); }
  328. void Cinprogress::Onnm4()  { StatsBuffer_info(4); }
  329. void Cinprogress::Onnm5()  { StatsBuffer_info(5); }
  330. void Cinprogress::Onnm6()  { StatsBuffer_info(6); }
  331. void Cinprogress::Onnm7()  { StatsBuffer_info(7); }
  332. void Cinprogress::Onnm8()  { StatsBuffer_info(8); }
  333. void Cinprogress::Onnm9()  { StatsBuffer_info(9); }
  334. void Cinprogress::Onnm10() { StatsBuffer_info(10); }
  335. void Cinprogress::Onnm11() { StatsBuffer_info(11); }
  336. void Cinprogress::Onnm12() { StatsBuffer_info(12); }
  337. void Cinprogress::Onnm13() { StatsBuffer_info(13); }
  338.  
  339. void Cinprogress::Onst0()  { StatsBuffer_info(0); }
  340. void Cinprogress::Onst1()  { StatsBuffer_info(1); }
  341. void Cinprogress::Onst2()  { StatsBuffer_info(2); }
  342. void Cinprogress::Onst3()  { StatsBuffer_info(3); }
  343. void Cinprogress::Onst4()  { StatsBuffer_info(4); }
  344. void Cinprogress::Onst5()  { StatsBuffer_info(5); }
  345. void Cinprogress::Onst6()  { StatsBuffer_info(6); }
  346. void Cinprogress::Onst7()  { StatsBuffer_info(7); }
  347. void Cinprogress::Onst8()  { StatsBuffer_info(8); }
  348. void Cinprogress::Onst9()  { StatsBuffer_info(9); }
  349. void Cinprogress::Onst10() { StatsBuffer_info(10); }
  350. void Cinprogress::Onst11() { StatsBuffer_info(11); }
  351. void Cinprogress::Onst12() { StatsBuffer_info(12); }
  352. void Cinprogress::Onst13() { StatsBuffer_info(13); }
  353.  
  354. // touche escape
  355. void Cinprogress::OnEscape() { 
  356.   OnStopall();
  357. }
  358.  
  359. void Cinprogress::OnStopall() 
  360. {
  361.   this_CSplitterFrame->CheckRestore();
  362.   if (AfxMessageBox(
  363.     LANG(LANG_H1 /*"Stop WinHTTrack?",
  364.            "Stopper WinHTTrack?"*/)
  365.     ,MB_OKCANCEL+MB_ICONQUESTION)==IDOK) {
  366.     if (soft_term_requested)
  367.       termine_requested=1;
  368.     else {
  369.       soft_term_requested=1;
  370.       hts_request_stop(0);
  371.     }
  372.   }
  373. }
  374.  
  375. void Cinprogress::Onipabout() 
  376. {
  377.   Cabout about;
  378.   about.DoModal();
  379. }
  380.  
  381. void Cinprogress::OnDestroy() 
  382. {
  383.   //((CWnd*)this)->m_pCtrlCont->OnUIActivate(NULL);
  384.   StopTimer();
  385.   if (BackAffLog)
  386.   if (form.m_hWnd)
  387.     form.EndDialog(IDOK);       // terminer!
  388.   termine_requested=1;    // quit!
  389.   this_CSplitterFrame->CheckRestore();
  390.   Sleep(150);             // Θvite les problΦmes d'accΦs α m_hWnd juste avant le destroy
  391.   CPropertyPage::OnDestroy();
  392. }
  393.  
  394. BOOL Cinprogress::OnInitDialog() 
  395. {
  396.   m_inphide=TRUE;
  397.   UpdateData(false);      // force to call DoDataExchange
  398.   inprogress=this;
  399.  
  400.   bzero((char*) &(SInfo), sizeof(SInfo));
  401.  
  402.   BackAffLog=NULL;
  403.   strcpy(pathlog,"");
  404.  
  405.     //CPropertyPage::OnInitDialog();
  406.   EnableToolTips(true);     // TOOL TIPS
  407.  
  408.   // initialisation des champs pour les redraws en boucle
  409.   element[0][0]=&m_st0;
  410.   element[0][1]=&m_st1;
  411.   element[0][2]=&m_st2;
  412.   element[0][3]=&m_st3;
  413.   element[0][4]=&m_st4;
  414.   element[0][5]=&m_st5;
  415.   element[0][6]=&m_st6;
  416.   element[0][7]=&m_st7;
  417.   element[0][8]=&m_st8;
  418.   element[0][9]=&m_st9;
  419.   element[0][10]=&m_st10;
  420.   element[0][11]=&m_st11;
  421.   element[0][12]=&m_st12;
  422.   element[0][13]=&m_st13;
  423.  
  424.   element[1][0]=&m_nm0;
  425.   element[1][1]=&m_nm1;
  426.   element[1][2]=&m_nm2;
  427.   element[1][3]=&m_nm3;
  428.   element[1][4]=&m_nm4;
  429.   element[1][5]=&m_nm5;
  430.   element[1][6]=&m_nm6;
  431.   element[1][7]=&m_nm7;
  432.   element[1][8]=&m_nm8;
  433.   element[1][9]=&m_nm9;
  434.   element[1][10]=&m_nm10;
  435.   element[1][11]=&m_nm11;
  436.   element[1][12]=&m_nm12;
  437.   element[1][13]=&m_nm13;
  438.  
  439.   // rajoutΘ
  440.   element[4][0]=&m_nn0;
  441.   element[4][1]=&m_nn1;
  442.   element[4][2]=&m_nn2;
  443.   element[4][3]=&m_nn3;
  444.   element[4][4]=&m_nn4;
  445.   element[4][5]=&m_nn5;
  446.   element[4][6]=&m_nn6;
  447.   element[4][7]=&m_nn7;
  448.   element[4][8]=&m_nn8;
  449.   element[4][9]=&m_nn9;
  450.   element[4][10]=&m_nn10;
  451.   element[4][11]=&m_nn11;
  452.   element[4][12]=&m_nn12;
  453.   element[4][13]=&m_nn13;
  454.  
  455.   element[2][0]=&m_sl0;
  456.   element[2][1]=&m_sl1;
  457.   element[2][2]=&m_sl2;
  458.   element[2][3]=&m_sl3;
  459.   element[2][4]=&m_sl4;
  460.   element[2][5]=&m_sl5;
  461.   element[2][6]=&m_sl6;
  462.   element[2][7]=&m_sl7;
  463.   element[2][8]=&m_sl8;
  464.   element[2][9]=&m_sl9;
  465.   element[2][10]=&m_sl10;
  466.   element[2][11]=&m_sl11;
  467.   element[2][12]=&m_sl12;
  468.   element[2][13]=&m_sl13;
  469.  
  470.   element[3][0]=&m_sk0;
  471.   element[3][1]=&m_sk1;
  472.   element[3][2]=&m_sk2;
  473.   element[3][3]=&m_sk3;
  474.   element[3][4]=&m_sk4;
  475.   element[3][5]=&m_sk5;
  476.   element[3][6]=&m_sk6;
  477.   element[3][7]=&m_sk7;
  478.   element[3][8]=&m_sk8;
  479.   element[3][9]=&m_sk9;
  480.   element[3][10]=&m_sk10;
  481.   element[3][11]=&m_sk11;
  482.   element[3][12]=&m_sk12;
  483.   element[3][13]=&m_sk13;
  484.  
  485.   // Patcher l'interface pour les Franτais ;-)
  486.   if (LANG_T(-1)) {    // Patcher en franτais
  487.     //SetDlgItemText(,"");
  488.     SetDlgItemText(IDC_STATIC_bytes,LANG(LANG_H8) /*"Octets sauvΘs:"*/);
  489.     SetDlgItemText(IDC_STATIC_scanned,LANG(LANG_H9) /*"Liens parcourus:"*/);
  490.     SetDlgItemText(IDC_STATIC_time,LANG(LANG_H10) /*"Temps:"*/);
  491.     SetDlgItemText(IDC_STATIC_sockets,LANG(LANG_H11) /*"Connexions:"*/);
  492.     SetDlgItemText(IDC_inphide,LANG(LANG_H12) /*"En cours:"*/);
  493.     SetDlgItemText(IDC_STATIC_informations,LANG_H16);   
  494.     SetDlgItemText(IDC_STATIC_written,LANG_H17);   
  495.     SetDlgItemText(IDC_STATIC_updated,LANG_H18);   
  496.     SetDlgItemText(IDC_STATIC_errors,LANG_H19);    
  497.     SetDlgItemText(IDC_STATIC_inprog,LANG_H20);    
  498.     //SetDlgItemText(IDC_hide,LANG(LANG_H13) /*"Cacher"*/);
  499.     SetDlgItemText(IDC_STATIC_trate,LANG(LANG_H14) /*"Taux transfert"*/);
  500.     for(int i=0;i<NStatsBuffer;i++)
  501.       element[3][i]->SetWindowText(LANG(LANG_H15));
  502.  
  503.     // patch menu
  504.     /*
  505.     CMenu* menu = GetMenu();
  506.     if (menu) {
  507.       menu->ModifyMenu(0,MF_BYPOSITION,0,LANG(LANG_O1));
  508.       menu->ModifyMenu(1,MF_BYPOSITION,1,LANG(LANG_O2));
  509.       menu->ModifyMenu(2,MF_BYPOSITION,2,LANG(LANG_O3));
  510.       menu->ModifyMenu(3,MF_BYPOSITION,3,LANG(LANG_O4));
  511.       menu->ModifyMenu(4,MF_BYPOSITION,4,LANG(LANG_O5));
  512.       //
  513.       menu->ModifyMenu(ID_FILE_PAUSE,MF_BYCOMMAND,ID_FILE_PAUSE,LANG(LANG_O10));
  514.       menu->ModifyMenu(ID_FILE_EXIT,MF_BYCOMMAND,ID_FILE_EXIT,LANG(LANG_O11));
  515.       menu->ModifyMenu(ID_OPTIONS_MODIFY,MF_BYCOMMAND,ID_OPTIONS_MODIFY,LANG(LANG_O12));
  516.       menu->ModifyMenu(ID_LOG_VIEWLOG,MF_BYCOMMAND,ID_LOG_VIEWLOG,LANG(LANG_O13));
  517.       menu->ModifyMenu(ID_LOG_VIEWERRORLOG,MF_BYCOMMAND,ID_LOG_VIEWERRORLOG,LANG(LANG_O14));
  518.       menu->ModifyMenu(ID_LOG_VIEWTRANSFERS,MF_BYCOMMAND,ID_LOG_VIEWTRANSFERS,LANG(LANG_O14b));
  519.       menu->ModifyMenu(ID_WINDOW_HIDE,MF_BYCOMMAND,ID_WINDOW_HIDE,LANG(LANG_O15));
  520.       menu->ModifyMenu(ID_ABOUT,MF_BYCOMMAND,ID_ABOUT,LANG(LANG_O16));
  521.       DrawMenuBar();
  522.     }
  523.     */
  524.   }
  525.  
  526.   /*
  527.   {
  528.     LOGFONT lf;
  529.     if (element[0][0]->GetFont()->GetLogFont(&lf)) {
  530.       CFont* fnt = new CFont();
  531.       if (fnt->CreateFont(lf.lfHeight,0,0,0,FW_DONTCARE,0,0,0,DEFAULT_CHARSET,OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY,DEFAULT_PITCH,"Fixedsys")) {
  532.         int i;
  533.         for (i=0;i<NStatsBuffer; i++) {
  534.           element[0][i]->SetFont(fnt,true);
  535.           element[1][i]->SetFont(fnt,true);
  536.         }
  537.       }
  538.     }
  539.   }
  540.   */
  541.  
  542.   SetIcon(httrack_icon,false);
  543.   SetIcon(httrack_icon,true);  
  544.  
  545.   if (choixdeb[0]=='!')
  546.     Oniplog(0);           // ouvrir log
  547.  
  548.   // Lancer timer!
  549.   StartTimer();
  550.  
  551.     return TRUE;  // return TRUE unless you set the focus to a control
  552.                   // EXCEPTION: OCX Property Pages should return FALSE
  553. }
  554.  
  555. void Cinprogress::StartTimer() {
  556.   if (!timer) {
  557.     timer=SetTimer(WM_TIMER,HTS_SLEEP_WIN,NULL);
  558.   }
  559. }
  560. void Cinprogress::StopTimer() {
  561.   if (timer) {
  562.     KillTimer(timer);
  563.     timer=0;
  564.   }
  565. }
  566.  
  567. UINT AffLog( LPVOID pP ) {
  568.   Cinprogress* inp = (Cinprogress*) pP;
  569.   if (inp != NULL) {
  570.     inp->form.m_iplog=(CString) "No log report";
  571.     inp->form.DoModal();
  572.     inp->BackAffLog = NULL;
  573.   }
  574.   return 0;    // thread completed successfully
  575. }
  576.  
  577. // log pour fichiers d'erreur et de log
  578. void Cinprogress::OniplogLog() {
  579.   Oniplog(0);
  580. }
  581. void Cinprogress::OniplogErr() {
  582.   Oniplog(1);
  583. }
  584.  
  585. void Cinprogress::Oniplog(int mode)  {
  586.   if (!BackAffLog) {  // pas encore lancΘ
  587.     strcpy(pathlog,dialog0->GetPath());
  588.     if (strlen(pathlog)>0)
  589.     if ((pathlog[strlen(pathlog)-1]!='/') && (pathlog[strlen(pathlog)-1]!='\\'))
  590.       strcat(pathlog,"/");
  591.     // fichier log existe ou on est tΘlΘcommandΘ par un !
  592.     if ( (fexist(fconcat(pathlog,"hts-err.txt"))) || (fexist(fconcat(pathlog,"hts-log.txt"))) || (choixdeb[0]=='!') ) {
  593.       if (mode)
  594.         form.type_log=0;
  595.       else
  596.         form.type_log=1;
  597.       strcpy(form.pathlog,pathlog);
  598.       BackAffLog = AfxBeginThread(AffLog,this);
  599.     } else {
  600.       char s[1024];
  601.       sprintf(s,LANG(LANG_H2 /*"No log files in %s!","Aucun fichier d'audit dans %s!"*/),pathlog);
  602.       AfxMessageBox(s,MB_OK+MB_ICONEXCLAMATION);
  603.     }
  604.   }
  605. }
  606.  
  607. void Cinprogress::OnViewTransfers() 
  608. {
  609.   StatsBuffer_info(0);
  610. }
  611.  
  612. void Cinprogress::OnPause() 
  613. {
  614.   int m;
  615.   if (!hts_setpause(-1))
  616.     m=AfxMessageBox(LANG(LANG_H3 /*"Pause Transfer?","Placer le transfert sur pause?"*/),MB_OKCANCEL+MB_ICONQUESTION);
  617.   else
  618.     m=IDOK;
  619.   if (m==IDOK) {
  620.     hts_setpause(!hts_setpause(-1));
  621.     CMenu* m;
  622.     if (m = AfxGetApp()->GetMainWnd()->GetMenu()) {
  623.       if (hts_setpause(-1))
  624.         m->CheckMenuItem(ID_FILE_PAUSE,MF_CHECKED);
  625.       else
  626.         m->CheckMenuItem(ID_FILE_PAUSE,MF_UNCHECKED);
  627.     }
  628.   }
  629. }
  630.  
  631. // modif options
  632. void Cinprogress::OnModifyOpt() 
  633. {
  634.   static httrackp opt;
  635.   //
  636.   maintab->m_option1.modify=
  637.     maintab->m_option2.modify=
  638.     maintab->m_option3.modify=
  639.     maintab->m_option7.modify=
  640.     maintab->m_option8.modify=
  641.     maintab->m_option9.modify=
  642.     maintab->m_option11.modify=
  643.     maintab->m_option10.modify=1;    // mode modification
  644.   if (maintab->DoModal() == IDOK) {
  645.     int n;
  646.  
  647.     // dΘvalider champs (non modifiΘs)
  648.     opt.maxsite = -1;
  649.     opt.maxfile_nonhtml = -1;
  650.     opt.maxfile_html = -1;
  651.     opt.maxsoc = -1;
  652.     opt.nearlink = -1;
  653.     opt.timeout = -1;
  654.     opt.rateout = -1;
  655.     opt.maxtime = -1;
  656.     opt.maxrate = -1;
  657.     strcpy(opt.user_agent , "");
  658.     opt.retry = -1;
  659.     opt.hostcontrol = -1;
  660.     opt.errpage = -1;
  661.     opt.travel = -1;
  662.     opt.external = -1;
  663.     opt.delete_old=-1;
  664.     opt.parseall=-1;
  665.     opt.delete_old=-1;
  666.  
  667.     opt.travel=0;         // NOTE: NE SERA PRIS EN COMPTE QUE LE BIT 8
  668.     if(maintab->m_option1.m_testall)
  669.       opt.travel|=256;     
  670.  
  671.     if(maintab->m_option1.m_parseall)
  672.       opt.parseall=1;     
  673.     else
  674.       opt.parseall=0;     
  675.  
  676.     // near link,err page
  677.     if (maintab->m_option1.m_link)
  678.       opt.nearlink=1;
  679.     else
  680.       opt.nearlink=0;
  681.  
  682.     if (maintab->m_option2.m_errpage)
  683.       opt.errpage=1;
  684.     else
  685.       opt.errpage=0;
  686.  
  687.     if (maintab->m_option2.m_external)
  688.       opt.external=1;
  689.     else
  690.       opt.external=0;
  691.  
  692.     if (maintab->m_option2.m_nopurge)
  693.       opt.delete_old=1;
  694.     else
  695.       opt.delete_old=0;
  696.  
  697.  
  698.     // host control
  699.     {
  700.       int a=0;
  701.       if (maintab->m_option4.m_remt)
  702.         a+=1;
  703.       if (maintab->m_option4.m_rems)
  704.         a+=2;
  705.       opt.hostcontrol=a;
  706.     }
  707.  
  708.     // sockets
  709.     if (strcmp(maintab->m_option4.m_connexion,"")!=0) {
  710.       if (sscanf(maintab->m_option4.m_connexion,"%d",&n) == 1)
  711.         opt.maxsoc = n;
  712.     } 
  713.  
  714.     // maxfile_nonhtml
  715.     if (strcmp(maintab->m_option5.m_othermax,"")!=0) {
  716.       if (sscanf(maintab->m_option5.m_othermax,"%d",&n) == 1)
  717.         opt.maxfile_nonhtml = n;
  718.     } else
  719.       opt.maxfile_nonhtml = -1;
  720.  
  721.     // maxfile_html
  722.     if (strcmp(maintab->m_option5.m_maxhtml,"")!=0) {
  723.       if (sscanf(maintab->m_option5.m_maxhtml,"%d",&n) == 1)
  724.         opt.maxfile_html = n;
  725.     } else
  726.       opt.maxfile_html = -1;
  727.  
  728.     // maxsite
  729.     if (strcmp(maintab->m_option5.m_sizemax,"")!=0) {
  730.       if (sscanf(maintab->m_option5.m_sizemax,"%d",&n) == 1)
  731.         opt.maxsite = n;
  732.     } else
  733.       opt.maxsite = -1;
  734.  
  735.     // fragment
  736.     if (strcmp(maintab->m_option5.m_pausebytes,"")!=0) {
  737.       if (sscanf(maintab->m_option5.m_pausebytes,"%d",&n) == 1)
  738.         opt.fragment = n;
  739.     } else
  740.       opt.fragment = -1;
  741.  
  742.     // timeout
  743.     if (strcmp(maintab->m_option4.m_timeout,"")!=0) {
  744.       if (sscanf(maintab->m_option4.m_timeout,"%d",&n) == 1)
  745.         opt.timeout = n;
  746.     } else
  747.       opt.timeout = -1;
  748.  
  749.     // rateout
  750.     if (strcmp(maintab->m_option4.m_rate,"")!=0) {
  751.       if (sscanf(maintab->m_option4.m_rate,"%d",&n) == 1)
  752.         opt.rateout = n;
  753.     } else
  754.       opt.rateout = -1;
  755.  
  756.     // maxtime
  757.     if (strcmp(maintab->m_option5.m_maxtime,"")!=0) {
  758.       if (sscanf(maintab->m_option5.m_maxtime,"%d",&n) == 1)
  759.         opt.maxtime = n;
  760.     } else
  761.       opt.maxtime = -1;
  762.  
  763.     // maxrate
  764.     if (strcmp(maintab->m_option5.m_maxrate,"")!=0) {
  765.       if (sscanf(maintab->m_option5.m_maxrate,"%d",&n) == 1)
  766.         opt.maxrate = n;
  767.     } else
  768.       opt.maxrate = -1;
  769.  
  770.     // max. connect
  771.     if (strcmp(maintab->m_option5.m_maxconn,"")!=0) {
  772.       if (sscanf(maintab->m_option5.m_maxconn,"%d",&n) == 1)
  773.         opt.maxconn = n;
  774.     } else
  775.       opt.maxconn = -1;
  776.  
  777.     // retry
  778.     if (strcmp(maintab->m_option4.m_retry,"")!=0) {
  779.       if (sscanf(maintab->m_option4.m_retry,"%d",&n) == 1)
  780.         opt.retry = n;
  781.     } else
  782.       opt.retry = -1;
  783.  
  784.     // user_agent
  785.     if (strcmp(maintab->m_option6.m_user,"")!=0) {
  786.       strcpy(opt.user_agent,maintab->m_option6.m_user);
  787.     }
  788.  
  789.     hts_setopt(&opt);
  790.   }
  791.   maintab->m_option1.modify=
  792.     maintab->m_option2.modify=
  793.     maintab->m_option3.modify=
  794.     maintab->m_option7.modify=
  795.     maintab->m_option8.modify=
  796.     maintab->m_option9.modify=
  797.     maintab->m_option11.modify=
  798.     maintab->m_option10.modify=0;
  799. }
  800.  
  801.  
  802.  
  803. // canceller un lien manuellement
  804. void Cinprogress::StatsBuffer_cancel(int id) {
  805.   hts_cancel_file(StatsBuffer[id].url_sav);
  806. }
  807. void Cinprogress::StatsBuffer_info(int id) {
  808.   if (SInfo.stat_time>0) {
  809.     if (StatsBuffer[id].etat[0]) {
  810.       CInfoUrl box;
  811.       box.id=StatsBuffer[id].back;
  812.       _Cinprogress_inst=&box;
  813.       box.DoModal();
  814.       _Cinprogress_inst=NULL;
  815.     }
  816.   }
  817. }
  818.  
  819.  
  820.  
  821.  
  822.  
  823.  
  824.  
  825. // ------------------------------------------------------------
  826. // TOOL TIPS
  827. //
  828. // ajouter dans le .cpp:
  829. // remplacer les deux Wid1:: par le nom de la classe::
  830. // dans la message map, ajouter
  831. // ON_NOTIFY_EX( TTN_NEEDTEXT, 0, OnToolTipNotify )
  832. // dans initdialog ajouter
  833. // EnableToolTips(true);     // TOOL TIPS
  834. //
  835. // ajouter dans le .h:
  836. // char* GetTip(int id);
  837. // et en generated message map
  838. // afx_msg BOOL OnToolTipNotify( UINT id, NMHDR * pNMHDR, LRESULT * pResult );
  839. BOOL Cinprogress::OnToolTipNotify( UINT id, NMHDR * pNMHDR, LRESULT * pResult )
  840. {
  841.   TOOLTIPTEXT *pTTT = (TOOLTIPTEXT *)pNMHDR;
  842.   UINT nID =pNMHDR->idFrom;
  843.   if (pTTT->uFlags & TTF_IDISHWND)
  844.   {
  845.     // idFrom is actually the HWND of the tool
  846.     nID = ::GetDlgCtrlID((HWND)nID);
  847.     if(nID)
  848.     {
  849.       char* st=GetTip(nID);
  850.       if (st != "") {
  851.         pTTT->lpszText = st;
  852.         pTTT->hinst = AfxGetResourceHandle();
  853.         return(TRUE);
  854.       }
  855.     }
  856.   }
  857.   return(FALSE);
  858. }
  859. char* Cinprogress::GetTip(int ID)
  860. {
  861.   switch(ID) {
  862.     //case IDC_STOPALL: return LANG(LANG_H4); break; // "Stop the mirror","Stopper le miroir"); break;
  863.     //case IDC_hide:    return LANG(LANG_H5); break; // "Hide this window behind the system tray","Cacher la fenΩtre dans la barre systΦme"); break;
  864.     case IDC_sk0:     return LANG(LANG_H6); break; // "Click to skip a link or interrupt parsing","Clic pour sauter un lien ou interrompre"); break;
  865.     case IDC_sk1: case IDC_sk2: case IDC_sk3: case IDC_sk4:
  866.     case IDC_sk5: case IDC_sk6: case IDC_sk7: case IDC_sk8: case IDC_sk9:
  867.                       return LANG(LANG_H7); break; // "Click to skip a link","Clic pour sauter un lien"); break;
  868.                       //
  869.   }
  870.   return "";
  871. }
  872. // TOOL TIPS
  873. // ------------------------------------------------------------
  874.  
  875.  
  876.  
  877. // Appel aide
  878. BOOL Cinprogress::OnHelpInfo2() {
  879.   return OnHelpInfo(NULL);
  880. }
  881.  
  882. BOOL Cinprogress::OnHelpInfo(HELPINFO* dummy) 
  883. {
  884.   //return CPropertyPage::OnHelpInfo(pHelpInfo);
  885.   HtsHelper->Help();
  886.   return true;
  887.   //AfxGetApp()->WinHelp(0,HELP_FINDER);    // Index du fichier Hlp
  888.   //return true;
  889. }
  890.  
  891.  
  892. int Cinprogress::OnCreate(LPCREATESTRUCT lpCreateStruct) 
  893. {
  894.     if (CPropertyPage::OnCreate(lpCreateStruct) == -1)
  895.         return -1;
  896.  
  897.   // Drag&Drop
  898.   drag=new CEasyDropTarget(this);
  899.   if (drag->IsRegistered()) {
  900.     drag->SetTextCallback(wm_CEasyDropTargetCallback);
  901.   }
  902.     
  903.     return 0;
  904. }
  905.  
  906.  
  907. // Message from CEasyDropTarget
  908. LRESULT Cinprogress::DragDropText(WPARAM wParam,LPARAM lParam) {
  909.   if (lParam) {
  910.     CString st=*((CString*) lParam);
  911.     CLIPFORMAT cfFormat=wParam;
  912.     st=Wid1::TextToUrl(st,cfFormat);
  913.     if (st=="")
  914.       AfxMessageBox(LANG(LANG_DIAL11),MB_SYSTEMMODAL);
  915.     else {
  916.       CString aff=LANG(LANG_DIAL12);
  917.       if (AfxMessageBox(aff+st,MB_SYSTEMMODAL|MB_YESNO|MB_ICONQUESTION)==IDYES) {
  918.         int pause=0;
  919.         char** tab=CEasyDropTarget::StringToArray(st);
  920.         hts_addurl(tab);
  921.         if (pause=hts_setpause(-1))
  922.           hts_setpause(0);      // enlever pause
  923.         {
  924.           int i=0;
  925.           while((hts_addurl(NULL)) && (i<100)) {
  926.             Sleep(100);
  927.             i++;
  928.           }
  929.           if (!(i<100)) {
  930.             hts_resetaddurl();
  931.             AfxMessageBox(LANG(LANG_DIAL13));
  932.           }
  933.           hts_setpause(pause);      // remettre pause Θventuelle
  934.         }
  935.         CEasyDropTarget::ReleaseStringToArray(tab);
  936.         tab=NULL;
  937.       }
  938.     }
  939.   }
  940.   return 0;
  941. }
  942.  
  943. // Refresh
  944. void Cinprogress::OnTimer(UINT nIDEvent) 
  945. {
  946.   if (SInfo.refresh) {
  947.     hts_is_parsing(0);        // refresh demandΘ si en mode parsing
  948.     while(INFILLMEM_LOCKED) Sleep(10);    // attendre au cas o∙
  949.     if (!termine)
  950.       inprogress_refresh();        // on refresh!
  951.   }
  952.   SInfo.ask_refresh=1;
  953.   CPropertyPage::OnTimer(nIDEvent);
  954. }
  955.  
  956. BOOL Cinprogress::DestroyWindow() 
  957. {
  958.   StopTimer();
  959.   inprogress=NULL;
  960.   delete drag;
  961.     return CPropertyPage::DestroyWindow();
  962. }
  963.  
  964. // Fin
  965.  
  966. void Cinprogress::OnEndMirror() {
  967.   //this_CSplitterFrame->SetNewView(0,1,RUNTIME_CLASS(Cinfoend));
  968.  
  969.   // Copie de trans.cpp
  970.   this_CWizTab->ModifyStyle(WS_VISIBLE,0,0);
  971.   this_CWizTab->RedrawWindow();
  972.   //
  973.   //{
  974.   //  CWizTab* tmp;
  975.   //  tmp=this_CWizTab;
  976.   this_CWizTab=this_intCWizTab;
  977.   //  this_CWizTab2=tmp;
  978.   //}
  979.   //
  980.   this_CWizTab->ModifyStyle(0,WS_VISIBLE,0);
  981.   this_CWizTab->ModifyStyle(WS_DISABLED,0,0);
  982.   this_CSplitterFrame->RedrawWindow();
  983.   // Fin de Copie de trans.cpp
  984.  
  985.   this_CWizTab->EndInProgress();
  986.   if (IsWindow(this_Cinfoend->m_hWnd))
  987.     this_Cinfoend->SetDlgItemText(IDC_infoend,end_mirror_msg);
  988.  
  989.   if (exit_xh == 1) {     /* Interrupted mirror! */
  990.     char pathlog[HTS_URLMAXSIZE*2];
  991.     strcpy(pathlog,dialog0->GetPath());
  992.     if (strlen(pathlog)>0) {
  993.       if ((pathlog[strlen(pathlog)-1]!='/') && (pathlog[strlen(pathlog)-1]!='\\'))
  994.         strcat(pathlog,"/");
  995.     }
  996.     // Aborted updated.. restore old cache?!
  997.     if ( (fexist(fconcat(pathlog,"hts-cache/old.dat"))) && (fexist(fconcat(pathlog,"hts-cache/old.ndx"))) ) {
  998.       if (AfxMessageBox(LANG_F22b,MB_YESNO|MB_DEFBUTTON2) == IDYES) {
  999.         if (remove(fconcat(pathlog,"hts-cache/new.dat"))) {
  1000.           AfxMessageBox(LANG_F24 );
  1001.         }
  1002.         if (remove(fconcat(pathlog,"hts-cache/new.ndx"))) {
  1003.           AfxMessageBox(LANG_F24 );
  1004.         }
  1005.         if (remove(fconcat(pathlog,"hts-cache/new.lst"))) {
  1006.           AfxMessageBox(LANG_F24 );
  1007.         }
  1008.         rename(fconcat(pathlog,"hts-cache/old.dat"),fconcat(pathlog,"hts-cache/new.dat"));
  1009.         rename(fconcat(pathlog,"hts-cache/old.ndx"),fconcat(pathlog,"hts-cache/new.ndx"));
  1010.         rename(fconcat(pathlog,"hts-cache/old.lst"),fconcat(pathlog,"hts-cache/new.lst"));
  1011.       }
  1012.     }
  1013.   } else if (exit_xh == 2) {     /* No connection! */
  1014.     AfxMessageBox(LANG_F22c );
  1015.   }
  1016. }
  1017.  
  1018. BOOL Cinprogress::OnQueryCancel( ) {
  1019.   OnStopall();
  1020.   //this_CSplitterFrame->SetNewView(0,1,RUNTIME_CLASS(CDialogContainer));
  1021.   return FALSE;
  1022. }
  1023.  
  1024.  
  1025. void Cinprogress::Oninphide() 
  1026. {
  1027.   int status=IsDlgButtonChecked(IDC_inphide);
  1028.   if (status) {
  1029.     GetDlgItem(IDC_STATIC_actions)->ModifyStyle(WS_DISABLED,0);  // disabled
  1030.     GetDlgItem(IDC_STATIC_actions)->ModifyStyle(0,WS_VISIBLE);   // not visible
  1031.   } else {
  1032.     GetDlgItem(IDC_STATIC_actions)->ModifyStyle(0,WS_DISABLED);  // not disabled
  1033.     GetDlgItem(IDC_STATIC_actions)->ModifyStyle(WS_VISIBLE,0);   // visible
  1034.   }
  1035.   int i;
  1036.   for(i=0;i<NStatsBuffer;i++) {
  1037.     int j;
  1038.     for(j=0;j<5;j++) {
  1039.       if (status) {
  1040.         inprogress->element[j][i]->ModifyStyle(WS_DISABLED,0);  // disabled
  1041.         inprogress->element[j][i]->ModifyStyle(0,WS_VISIBLE);   // not visible
  1042.       } else {
  1043.         inprogress->element[j][i]->ModifyStyle(0,WS_DISABLED);  // not disabled
  1044.         inprogress->element[j][i]->ModifyStyle(WS_VISIBLE,0);   // visible
  1045.       }
  1046.     }
  1047.   }
  1048.   RedrawWindow();
  1049. }
  1050.