
/* To force WindowPictures validating your modifications in windpict.ini,
 or *.sub   */
/* For a correct display, select tab space to 2 characters. */

/* Pour forcer WindowPictures à prendre en compte des modifications
 que vous avez faites directement dans windpict.ini, ou *.sub     */
/* Pour obtenir un bon affichage, selectionnez un espacement tabulaire
 de 2 caractères. */





#include <windows.h>
#include <stdio.h>

#include "wm_wp.h"

main()
{

  const BOOL  Force_BMP_Loading=FALSE; // Please, do not try other value.

  char WPnom_ini[512];

  /*  1) ****** Find the WINDPICT.INI place. ********************** */
  /*     ****** Trouve l'emplacement de WINDPICT.INI. ************* */

  if ( GetProfileString("Window Pictures","INI file","",
          WPnom_ini,sizeof(WPnom_ini) )    != 0)
  {
    HWND WPhwnd;

  /*  2) ****** Find the window handle of WindowPictures.exe. ******************** */
  /*     ****** Trouve le 'handle' de fenetre de WindowPictures.exe. ************* */

    WPhwnd=GetPrivateProfileInt("","Current hwnd",0xffffU,WPnom_ini);
    if (WPhwnd != 0xffffU)
    {

  /*  3) ****** Send the order to WindowPictures.exe. ******************** */
  /*     ****** Envoit l'ordre à WindowPictures.exe. ********************* */

      SendMessage(WPhwnd,WM_WP_USE_INI,Force_BMP_Loading,0);
      printf("WindowPictures is updated. \n");
      return TRUE;
    }
    else
      printf("WindowPictures is not running. \n");
  }
  else
    printf("WindowPictures is not installed. \n");

  return FALSE;
}
