// info  nam="SAMPLE01A"  tit="占い"  dsc="説明用サンプル"  pro=2

void CommandMain(HWND hwnd)
{ // 占い
  int sr, re;
  HBUF rb;
  char msg[64];
  static char un[6][6] = { "大吉", "中吉", "小吉", "吉", "末吉", "凶" };
  static COLI ci[1] = { { TID_YMD, 0, "sr", "生年月日", } };
  static COLS cs = { ci, NELEM(ci) };
  static TBLI ti = { &cs, };

  sr = today();
  rb = CreateRowBufX(&sr, &ti);
  re = EditRowDlgBox(hwnd, rb, "占い");
  DeleteRowBuf(rb);
  if (!re) return;
  sprintf(msg, "あなたの本日の運勢は、「%s」です。", un[(sr + today()) % 6]);
  OkBox(hwnd, msg, NULL);
}