// info  nam="SAMPLE05D"  tit="ボタンアイコン"  dsc="16x16と32x32のビットマップイメージ作成"  pro=2

typedef struct {
  BYTE  B;
  BYTE  G;
  BYTE  R;
  BYTE  A;
} RGBQ;

RGBC BGR2RGB(BGRC cr)
{ // R⇔B交代色(COLORREF→RGBQUAD変換)
  int t;

  t = ((RGBQ *)&cr)->R;
  ((RGBQ *)&cr)->R = ((RGBQ *)&cr)->B;
  ((RGBQ *)&cr)->B = t;
  return cr;
}

typedef struct {
  BYTE  R;
  BYTE  G;
  BYTE  B;
  BYTE  A;
} PALI;
  // 既定のパレット
PALI PAL[64] = {
  { 0x00, 0x00, 0x00, 'K' }, { 0x00, 0x00, 0xff, 'B' }, { 0xff, 0x00, 0x00, 'R' }, { 0xff, 0x00, 0xff, 'F' },
  { 0x00, 0xff, 0x00, 'L' }, { 0x00, 0xff, 0xff, 'A' }, { 0xff, 0xff, 0x00, 'Y' }, { 0xff, 0xff, 0xff, 'W' },
  { 0xa0, 0xa0, 0xa0, 's' }, { 0x00, 0x00, 0xc0, 'b' }, { 0xc0, 0x00, 0x00, 'r' }, { 0xc0, 0x00, 0xc0, 'f' },
  { 0x00, 0xc0, 0x00, 'l' }, { 0x00, 0xc0, 0xc0, 'a' }, { 0xc0, 0xc0, 0x00, 'y' }, { 0xf0, 0xf0, 0xf0, ' ' },
  { 0x69, 0x69, 0x69, 'D' }, { 0x00, 0x00, 0x80, 'N' }, { 0x80, 0x00, 0x00, 'M' }, { 0x80, 0x00, 0x80, 'P' },
  { 0x00, 0x80, 0x00, 'G' }, { 0x00, 0x80, 0x80, 'T' }, { 0x80, 0x80, 0x00, 'O' }, { 0xff, 0xff, 0xff, 'H' },
  { 0xd0, 0xff, 0xe0, 'd' }, { 0x00, 0x00, 0x40, 'n' }, { 0x40, 0x00, 0x00, 'm' }, { 0x40, 0x00, 0x40, 'p' },
  { 0x00, 0x40, 0x00, 'g' }, { 0x00, 0x40, 0x40, 't' }, { 0x40, 0x40, 0x00, 'o' }, { 0xff, 0xe0, 0xd0, 'h' },
  { 0x00, 0x78, 0xd7, 'E' }, { 0xc0, 0xd0, 0xff, 'U' }, { 0xff, 0xc0, 0xd0, 'I' }, { 0xff, 0xd0, 0xff, 'V' },
  { 0xd0, 0xff, 0xd0, 'J' }, { 0xd0, 0xff, 0xff, 'C' }, { 0xff, 0xff, 0xd0, 'Z' }, { 0xff, 0xe0, 0xc0, 'Q' },
  { 0xff, 0xff, 0xff, 'e' }, { 0x90, 0xa0, 0xff, 'u' }, { 0xff, 0x90, 0xa0, 'i' }, { 0xff, 0xa0, 0xff, 'v' },
  { 0xa0, 0xff, 0xa0, 'j' }, { 0xa0, 0xff, 0xff, 'c' }, { 0xff, 0xff, 0xa0, 'z' }, { 0xff, 0xb0, 0x90, 'q' },
  { 0xe3, 0xe3, 0xe3, 'S' }, { 0x00, 0x00, 0x00, '0' }, { 0x20, 0x20, 0x20, '1' }, { 0x40, 0x40, 0x40, '!' },
  { 0x50, 0x50, 0x50, '2' }, { 0x60, 0x60, 0x60, '#' }, { 0x70, 0x70, 0x70, '3' }, { 0x80, 0x80, 0x80, '$' },
  { 0x90, 0x90, 0x90, '4' }, { 0xa0, 0xa0, 0xa0, '%' }, { 0xb0, 0xb0, 0xb0, '5' }, { 0xc0, 0xc0, 0xc0, '6' },
  { 0xd0, 0xd0, 0xd0, '7' }, { 0xe0, 0xe0, 0xe0, '8' }, { 0xf0, 0xf0, 0xf0, '9' }, { 0xff, 0xff, 0xff, 'w' },
};

HDIB CreateDIBFromSTR(int w, int h, const char *bi)
{ // 文字列コードでデバイス独立ビットマップを作成
  int i, j;
  RGBC *qd;
  HDIB bm;

  bm = CreateDIB(w, h, DIB_32B|DIB_TDN); if (!bm) return NULL;
  if (bi) {
    qd = (RGBC *)DIB_IMAGE(bm);
    for (i = 0; i < w * h; i++) {
      for (j = 0; j < NELEM(PAL); j++) {
        if (PAL[j].A == bi[i]) goto _L1;
      }
      j = 0;
     _L1:
      qd[i] = BGR2RGB(*(BGRC *)&PAL[j] & 0xffffff);
    }
  }
  return bm;
}

  // 16x16ビットマップイメージ
char MBI[35][16 * 16] = {
  //  0 BLANK
    "                " "                " "                " "                "
    "                " "                " "                " "                "
    "                " "                " "                " "                "
    "                " "                " "                " "                "
  ,
  //  1 NEW
    "                " "  $$$$$$$$$5    " "  $wwwwwww$!5   " "  $wwwwwww$9!5  "
    "  $wwwwwww$!!!  " "  $wwwwwww888!  " "  $wwwwwwwww8!  " "  $wwwwwwmmm8!  "
    "  $wwwwwwmQm8!  " "  $wwwwwwmQm8!  " "  $wwwwwwmQmmm  " "  $wwwwwmqQqqqm "
    "  $wwwwwmQQQQQQm" "  $wwwwwmQQQQQQm" "  $98888mQQQQQQm" "  $!!!!!!mQQQQm "
  ,
  //  2 OPEN
    "                " "                " "                " "OOOOOO5         "
    "OYYYYyO5        " "OYYYYYyOOOOOO   " "OYYYYYYYYYYY!   " "OYYYOOOOOOOOOOOO"
    "OYYyOYYYYYYYYYy!" "OYYOYYYYYYYYYY!5" "OYyOYYYYYYYYYy! " "OYOYYYYYYYYYY!5 "
    "OyOYYYYYYYYYy!  " "OOYYYYYYYYYY!5  " "O!!!!!!!!!!!!   " "                "
  ,
  //  3 CLOSE
    "                " "                " "                " "   15      51   "
    "   505    505   " "    505  505    " "     505505     " "      5005      "
    "      5005      " "     505505     " "    505  505    " "   505    505   "
    "   15      51   " "                " "                " "                "
  ,
  //  4 SAVE
    "                " " ####333333###u " " #uuu666666uuu# " " #uuu6666!6uuu! "
    " #uuu6666!6uuu! " " #uuu666666uuu! " " #uuuuuuuuuuuu! " " #uu########uu! "
    " #u#wwwwwwww#u! " " #u#wwwwwwww#u! " " #u#wwwwwwww#u! " " #u#wwwwwwww#u! "
    " #!#wwwwwwww#u! " " #u#wwwwwwww#u! " " #!!########!!! " "                "
  ,
  //  5 SAVEAS
    "                " " ####333333###u " " #uuu666666uuu# " " #uuu6666!6uuu! "
    " #uuu6666!6uuu! " " #uuu666666uuu! " " #uuuuuuuuuuuu! " " #uu#####mmmuu! "
    " #u#wwwwwmQm#u! " " #u#wwwwwmQm#u! " " #u#wwwwwmQmmm! " " #u#wwwwmqQqqqm "
    " #!#wwwwmQQQQQQm" " #u#wwwwmQQQQQQm" " #!!####mQQQQQQm" "         mQQQQm "
  ,
  //  6 PRINT
    "    %%%%%%%%    " "    %9999994    " "    %9999994    " "    %wwwwww4    "
    "    %wwwwww4    " " 53$$$$$$$$$$34 " "%37$$$$$$$$$$73$" "377##########77!"
    "366222222222266!" "35522222222225j!" "344888888888844!" "39914%#$22%$199!"
    "4!!0%wB83Tw40!!#" "    %wB5!Nw4    " "    %wwwwww4    " "    %4444444    "
  ,
  //  7 SETUP
    "                " "0  00000000000  " "                " "                "
    "0  00000000000  " "                " "                " "0  000000mmm00  "
    "         mQm    " "         mQm    " "0  000000mQm00  " "        mqQqqqm "
    "        mQQQQQQm" "        mQQQQQQm" "        mQQQQQQm" "         mQQQQm "
  ,
  //  8 CUT
    "   746    647   " "   6$4    4$6   " "   6$$6  6$$6   " "    5$$  $$5    "
    "     4$66$4     " "     5$$$$5     " "      4$$4      " "      5$#5      "
    "      63#6      " "     BB##BB     " "   ubBBBBBBbu   " "  BBBBBuuBBBBB  "
    " uB  Bb  bB  Bu " " uB uBu  uB uBu " "  BBBB    BBBB  " "                "
  ,
  //  9 COPY
    "                " " $$$$$$5        " " $wwww$!5       " " $wwww$9!5      "
    " $w%%7$NNNNNN5  " " $wwwwwNwwwwNn5 " " $w%%%%NwwwwN9n5" " $wwwwwNwuuUNnnn"
    " $w%%%%Nwwwwwwwn" " $wwwwwNwuuuuuwn" " $!!!!!Nwwwwwwwn" "       Nwuuuuuwn"
    "       Nwwwwwwwn" "       Nnnnnnnnn" "                " "                "
  ,
  // 10 PASTE
    "                " "     !11!       " " OOOO1OO1OOOO   " "Oyyy17!!71yyy!  "
    "Oyy17777771yy!  " "Oyy!111111!yy!  " "Oyyyyyyyyyyyy!  " "OyyyyyNNNNNNN!  "
    "OyyyyyNwwwwwNn5 " "OyyyyyNwwwwwN9n5" "OyyyyyNwuuuUNnnn" "OyyyyyNwwwwwwwwn"
    "OyyyyyNwuuuuuuwn" " !!!!!Nwwwwwwwwn" "      Nnnnnnnnnn" "                "
  ,
  // 11 SEARCH
    "                " "   !!!   !!!    " "   !$0   !$0    " "  !!!!! !!!!!   "
    "  !w430 !w430   " " !!!!!01!!!!!!  " " !%w4301!%w430  " " !%w430 !%w430  "
    "!!!!!0111!!!!!! " "!%w430   !%w430 " "!%w430   !%w430 " "!%w430   !%w430 "
    "!%w430   !%w430 " "!00000   !00000 " "                " "                "
  ,
  // 12 SORT
    "                " "             0  " "  NNN        0  " " NN NN       0  "
    "NN   NN      0  " "NNNNNNN      0  " "NN   NN      0  " "NN   NN      0  "
    "             0  " "MMMMMMM      0  " "    MM       0  " "   MM        0  "
    "  MM       05050" " MM         000 " "MMMMMMM      0  " "                "
  ,
  // 13 FILTER
    "                " "                " " !!!###!!!!!!!! " " !5788875555550 "
    "  !57887555550  " "   !578855550   " "    !5785550    " "     !68550     "
    "      !850      " "      !850      " "      !850      " "      !850      "
    "      !850      " "      !850      " "      !000      " "                "
  ,
  // 14 SUMMARY
    "                " "                " "   00000000000  " "   5005     50  "
    "    5005        " "     5005       " "      5005      " "       500      "
    "      5005      " "     5005       " "    5005        " "   5005     50  "
    "   00000000000  " "                " "                " "                "
  ,
  // 15 CHECK
    "                " "                " "              II" "             IMI"
    "            IMMI" "           IMMI " "          IMMI  " "  I      IMMI   "
    " IMI    IMMI    " "IMMMI  IMMI     " " IMMMIIMMI      " "  IMMMMMI       "
    "   IMMMI        " "    IMI         " "     I          " "                "
  ,
  // 16 PREV
    "                " "       44       " "      4nn4      " "     4nBBn4     "
    "    4nBBBBn4    " "   4nBBBBBBn4   " "  4nBBBBBBBBn4  " " 40000BBBB00004 "
    "     0BBBB0     " "     0BBBB0     " "     0BBBB0     " "     0BBBB0     "
    "     0BBBB0     " "     000000     " "                " "                "
  ,
  // 17 NEXT
    "                " "                " "     000000     " "     0BBBB0     "
    "     0BBBB0     " "     0BBBB0     " "     0BBBB0     " "     0BBBB0     "
    " 40000BBBB00004 " "  4nBBBBBBBBn4  " "   4nBBBBBBn4   " "    4nBBBBn4    "
    "     4nBBn4     " "      4nn4      " "       44       " "                "
  ,
  // 18 INVERT
    "                " "    bb          " "    BB      70  " "  bBBBBb   707  "
    "  bBBBBb  707   " "    BB   707    " "    bb  707     " "       707      "
    "      707       " "     707        " "    707         " "   707  bBBBBb  "
    "  707   bBBBBb  " "  07            " "                " "                "
  ,
  // 19 ZOOMIN
    "   5!11!5       " "  !4    4!      " " !7      7!     " "54   bb   45    "
    "!    BB    !    " "1  bBBBBb  1    " "1  bBBBBb  1    " "!    BB    !    "
    "54   bb   45    " " !7      7!     " "  !4    4!13    " "   5!11!5 303   "
    "           303  " "            303 " "             303" "              36"
  ,
  // 20 ZOOMOUT
    "   5!11!5       " "  !4    4!      " " !7      7!     " "54        45    "
    "!          !    " "1  bBBBBb  1    " "1  bBBBBb  1    " "!          !    "
    "54        45    " " !7      7!     " "  !4    4!13    " "   5!11!5 303   "
    "           303  " "            303 " "             303" "              36"
  ,
  // 21 SAME
    "   5!11!5       " "  !4wwww4!      " " !7wwwwww7!     " "54wwwwwwww45    "
    "!ww000000ww!    " "1wwwwwwwwww1    " "1wwwwwwwwww1    " "!ww000000ww!    "
    "54wwwwwwww45    " " !7wwwwww7!     " "  !4wwww4!13    " "   5!11!5 303   "
    "           303  " "            303 " "             303" "              36"
  ,
  // 22 WHOLE
    "                " " 00000000000000 " " 0wwwww55wwwww0 " " 0wwww0ww0wwww0 "
    " 0wwwwwwwwwwww0 " " 0wwwwwwwwwwww0 " " 0w0wwwwwwww0w0 " " 05wwwwwwwwww50 "
    " 05wwwwwwwwww50 " " 0w0wwwwwwww0w0 " " 0wwwwwwwwwwww0 " " 0wwwwwwwwwwww0 "
    " 0wwww0ww0wwww0 " " 0wwwww55wwwww0 " " 00000000000000 " "                "
  ,
  // 23 PREVWIN
    "      8!8       " "     817        " "    817         " "   817          "
    "  817           " " 817            " "817             " "100000000000001 "
    "817             " " 817            " "  817           " "   817          "
    "    817         " "     817        " "      8!8       " "                "
  ,
  // 24 NEXTWIN
    "      8!8       " "       718      " "        718     " "         718    "
    "          718   " "           718  " "            718 " "100000000000001 "
    "            718 " "           718  " "          718   " "         718    "
    "        718     " "       718      " "      8!8       " "                "
  ,
  // 25 VIEW
    "                " "wwwwwwwwwww  0  " "w0000000000  0  " "w0AA0ww0www  0  "
    "w00000000ww  0  " "w0ww0ww0www  0  " "w0ww0wwwwww  0  " "w!!##!!!!!w  0  "
    "w!57875550w  0  " "  !577550    0  " "   !6750     0  " "    !60      0  "
    "    !60    05050" "    !60     000 " "    !00      0  " "                "
  ,
  // 26 ARRANGE
    "                " "                " "wwwwwwwwwwwwwwww" "w000000000000000"
    "w0AAAA0wwww0wwww" "w0AAAA0wwww0wwww" "w000000000000www" "w0wwww0wwww0wwww"
    "w0wwww0wwwwwwwww" "w0wwww0wwwwwwwww" "w0wwww0wwwwwwwww" "w0wwwwwwwwwwwwww"
    "w0wwwwwwwwwwwwww" "w0wwwwwwwwwwwwww" "                " "                "
  ,
  // 27 EDIT
    "  !             " "  !!!!!!!!!!!!!!" "  !             " "  !             "
    "  00000000000000" "  0AAAAAAAAAAAAA" "  0AAAAAAAAAAAAA" "  0000000mmm0000"
    "  !      mQm    " "  !      mQm    " "  !!!!!!!mQmmm!!" "  !     mqQqqqm "
    "  !     mQQQQQQm" "  !!!!!!mQQQQQQm" "  !     mQQQQQQm" "  !      mQQQQm "
  ,
  // 28 ADD
    "  !             " "  !!!!!!!!!!!!!!" "  !             " "  !             "
    "  !!!!!!!!!!!!!!" "  !             " "  !      r      " "  !!!!!!rRr!!!!!"
    "  !    rRiRr    " "  !   rRiiiRr   " "  !!!rrrrirrrr!!" "        rir     "
    "00000000rir000  " "AAAAAAAArrrAA0  " "AAAAAAAAAAAAA0  " "00000000000000  "
  ,
  // 29 INSERT
    "  !             " "  !!!!!!!!!!!!!!" "  !             " "  !             "
    "  !!!!!!!!!!!!!!" "                " "0000000r000000  " "AAAAAAArrAAAA0  "
    "AAAAAAArRrAAA0  " "0000rrrriRr000  " "    riiiiiRr    " "  !!rrrriRr!!!!!"
    "  !    rRr      " "  !    rr       " "  !!!!!r!!!!!!!!" "  !             "
  ,
  // 30 DELETE
    "  !             " "  !!!!!!!!!!!!!!" "  ! rR    Rr    " "  ! RrR  RrR    "
    "  000RrRRrR00000" "  0AAARrrRAAAAAA" "  0AAARrrRAAAAAA" "  000RrRRrR00000"
    "  ! RrR  RrR    " "  ! rR    Rr    " "  !!!!!!!!!!!!!!" "  !             "
    "  !             " "  !!!!!!!!!!!!!!" "  !             " "  !             "
  ,
  // 31 COMPILE
    "                " "     000000     " "     0BBBB0     " "     0BBBB0     "
    "     0BBBB0     " "     0BBBB0     " "  4000BBBB0004  " "   4nBBBBBBn4   "
    "    4nBBBBn4    " "$$$$$$nBBn$$$$$!" "$wwwww%nn%wwwww!" "$wwwwww%%wwwwww!"
    "$wwwwwwwwwwwwww!" "$wwwwwwwwwwwwww!" "$!!!!!!!!!!!!!!!" "                "
  ,
  // 32 ZOOM
    "   5!11!5       " "  !4CCCC4!      " " !7CwwCCC7!     " "54CwwwCCCC45    "
    "!CCwwCCCCCC!    " "1CCCCCCCCCC1    " "1CCCCCCCCCC1    " "!CCCCCCCCCC!    "
    "54CCCCCCCC45    " " !7CCCCCC7!     " "  !4CCCC4!13    " "   5!11!5 303   "
    "           303  " "            303 " "             303" "              36"
  ,
  // 33 SETDATE
    "                " "                " "   0  0  0  0   " "$$$0$$0$$0$$0$$$"
    "$ww0ww0ww0ww0ww$" "$wwwwwwwwwwwwww$" "$wwwwwwwwwwwwww$" "$ww0ww0ww0ww0ww$"
    "$wwwwwwwwwwwwww$" "$ww0ww0ww0ww0ww$" "$wwwwwwwwwwwwww$" "$ww0ww0ww0ww0ww$"
    "$wwwwwwwwwwwwww$" "$wwwwwwwwwwwwww$" "$$$$$$$$$$$$$$$$" "                "
  ,
  //  34 NEW0
    "                " "  $$$$$$$$$5    " "  $wwwwwww$!5   " "  $wwwwwww$9!5  "
    "  $wwwwwww$!!!  " "  $wwwwwww888!  " "  $wwwwwwwww8!  " "  $wwwwwwwww8!  "
    "  $wwwwwwwww8!  " "  $wwwwwwwww8!  " "  $wwwwwwwww8!  " "  $wwwwwwwww8!  "
    "  $wwwwwwwww8!  " "  $wwwwwwwww8!  " "  $9888888888!  " "  $!!!!!!!!!!!  "
  ,
};

  // 32x32ビットマップイメージ
char OBI[9][32 * 32] = {
  //  0 DUMMY
    "                                " "                                " "                                "
    "                                " "                                " "                                "
    "                                " "                                " "                                "
    "                                " "                                " "                                "
    "                                " "                                " "                                "
    "                                " "                                " "                                "
    "                                " "                                " "                                "
    "                                " "                                " "                                "
    "                                " "                                " "                                "
    "                                " "                                " "                                "
    "                                " "                                "
  ,
  //  1 INPUT
    "    $$$$$$$$$$$$$$$$$$$         " "    $wwwwwwwwwwwwwwwww$0        " "    $wwwwwwwwwwwwwwwww$$0       "
    "    $wwwwwwwwwwwwwwwww$6$0      " "    $wwwwwwwwYwwwwwwww$w6$0     " "    $wwwwwwwwqwwwwwwww$ww6$0    "
    "    $wwwYwwwwYwwwwYwww$000000   " "    $wwwwqwwzqzwwqwwwwwwwww60   " "    $wwwwwqzqYqzqwwwwwwwwww60   "
    "    $wwwwwzqYqYqzwwwwwwwwww60   " "    $wwwwzqYmmqYqzwwwwwwwww60   " "    $wYqYqYmQQmqYqYqYwwwwww60   "
    "    $wwwwzqmQQmYqzwwwwwwwww60   " "    $wwwwwzmQQmqzwwwwwwwwww60   " "    $wwwwwqmQQmzqwwwwwwwwww60   "
    "    $wwwwqwmQQmmmqwwwwwwwww60   " "    $wwwYwwmQQmQQmmmwwwwwww60   " "    $wwwwwwmQQmQQmQQmmwwwww60   "
    "    $wwwwwwmQQmQQmQQmQmwwww60   " "    $wwmmmwmQQmQQmQQmQQmwww60   " "    $wwmQQmmQQQQQQQQmQQmwww60   "
    "    $wwmQQQmQQQQQQQQQQQmwww60   " "    $wwwmQQmQQQQQQQQQQQmwww60   " "    $wwwwmQmQQQQQQQQQQQmwww60   "
    "    $wwwwmQQQQQQQQQQQQQmwww60   " "    $wwwwwmQQQQQQQQQQQQmwww60   " "    $wwwwwmQQQQQQQQQQQmwwww60   "
    "    $wwwwwwmQQQQQQQQQQmwwww60   " "    $wwwwwwmQQQQQQQQQQmwwww60   " "    $wwwwwwwmQQQQQQQQmwwwww60   "
    "    $6666666mQQQQQQQQm6666660   " "    00000000mQQQQQQQQm0000000   "
  ,
  //  2 TABLE
    "    $$$$$$$$$$$$$$$$$$$         " "    $wwwwwwwwwwwwwwwww$0        " "    $wwwwwwwwwwwwwwwww$$0       "
    "    $wwwwwwwwwwwwwwwww$6$0      " "    $wwwwwwwwwwwwwwwww$w6$0     " "    $wwwwwwwwwwwwwwwww$ww6$0    "
    "    $wwwwwwwwwwwwwwwww$000000   " "    $wwwwwwwwwwwwwwwwwwwwww60   " "    $wwwwwwwwwwwwwwwwwwwwww60   "
    "    $wwbbbbbbbbbbbbbbbbbbww60   " "    $wwbwwwwwwwbwwwwwwwwbww60   " "    $wwbwwwwwwwbwwwwwwwwbww60   "
    "    $wwbwwwwwwwbwwwwwwwwbww60   " "    $wwbwwwwwwwbwwwwwwwwbww60   " "    $wwbwwwwwwwbwwwwwwwwbww60   "
    "    $wwbbbbbbbbbbbbbbbbbbww60   " "    $wwbwwwwwwwbwwwwwwwwbww60   " "    $wwbwwwwwwwbwwwwwwwwbww60   "
    "    $wwbwwwwwwwbwwwwwwwwbww60   " "    $wwbwwwwwwwbwwwwwwwwbww60   " "    $wwbwwwwwwwbwwwwwwwwbww60   "
    "    $wwbbbbbbbbbbbbbbbbbbww60   " "    $wwbwwwwwwwbwwwwwwwwbww60   " "    $wwbwwwwwwwbwwwwwwwwbww60   "
    "    $wwbwwwwwwwbwwwwwwwwbww60   " "    $wwbwwwwwwwbwwwwwwwwbww60   " "    $wwbwwwwwwwbwwwwwwwwbww60   "
    "    $wwbbbbbbbbbbbbbbbbbbww60   " "    $wwwwwwwwwwwwwwwwwwwwww60   " "    $wwwwwwwwwwwwwwwwwwwwww60   "
    "    $666666666666666666666660   " "    0000000000000000000000000   "
  ,
  //  3 EXECUTE
    "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%" "%wwwwwwwwwwwwwwwwwwwwwwwwwwwwww%" "%wwwwwwwwwwwwwwwwwwwwwwwwwwwwww%"
    "%wwwwwwwwwwwwwwwwww%%%wwwwwwwww%" "%wwwwwwwwwwwwwwwww%ww9owwwwwwww%" "%wwwwwwwwwwwwwwyy%%9%%o%y%wwwww%"
    "%wwwwwwwwwwwwwywYY%w9%oywYowwww%" "%wwwwwwwwwwwwwoyww%w%%owYyowwww%" "%wwwwwwwwwwwyyyyw%%w9%o%Y9oowww%"
    "%wwwwwwwwwwwywywY%%w%%oywYwYoww%" "%wwwwwwwwwwwoyyywYooooo9Yoyyoww%" "%wwwwwwwwwwwoyyoywwYYwYYyoyyoww%"
    "%wwwwwwwwwww%ooYYoyy9yoyw9oo9ww%" "%wwwwwwwwwwwwwyYoyyywoYyyyowwww%" "%wwwwwwwwwwwwwyYoyoyyoooyyowwww%"
    "%wwwwwwwww%%%w9oo9woYow9oowwwww%" "%wwwwwwww%ww9owwwwwooowwwwwwwww%" "%wwwwwyy%%9%%o%y%wwwwwwwwwwwwww%"
    "%wwwwywYY%w9%oywYowwwwwwwwwwwww%" "%wwwwoyww%w%%owYyowwwwwwwwwwwww%" "%wwyyyyw%%w9%o%Y9oowwwwwwwwwwww%"
    "%wwywywY%%w%%oywYwYowwwwwwwwwww%" "%wwoyyywYooooo9Yoyyowwwwwwwwwww%" "%wwoyyoywwYYwYYyoyyowwwwwwwwwww%"
    "%ww%ooYYoyy9yoyw9oo9wwwwwwwwwww%" "%wwwwyYoyyywoYyyyowwwwwwwwwwwww%" "%wwwwyYoyoyyoooyyowwwwwwwwwwwww%"
    "%wwww9oo9woYow9oowwwwwwwwwwwwww%" "%wwwwwwwwwooowwwwwwwwwwwwwwwwww%" "%wwwwwwwwwwwwwwwwwwwwwwwwwwwwww%"
    "%wwwwwwwwwwwwwwwwwwwwwwwwwwwwww%" "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
  ,
  //  4 REPORT
    "              3333              " "            33333333            " "       %%%%%%%%%%%%%%%%%%       "
    "       %wwwwwwwwwwwwwwww%       " "       %wwwwwwwwwwwwwwww%       " "       %wwwwwwwwwwwwwwww%       "
    "       %wwwwwwwwwwwwwwww%       " "       %wwwwwwwwwwwwwwww%       " "       %wwwwwwwwwwwwwwww%       "
    "       %wwwwwwwwwwwwwwww%       " "   5553%wwwwwwwwwwwwwwww%3555   " "   497$%9999999999999999%$794   "
    "   49%$344444444444444443$%94   " "  559$3$$$$$$$$$$$$$$$$$$3$955  " "  4883#222222222222222222#3884  "
    "  497#!!!!!!!!!!!!!!!!!!!!#794  " "  4972111111111111111111112794  " " 5597$#222222222222222222#$7955 "
    " 489987777777777777777777789984 " " 489999999999999999999999999984 " " 499999999999999999999999999994 "
    " 488888888888888888888888888884 " " 477777777777777777777777777774 " " 477777777777777777777777777774 "
    " 477775555555555555555555577774 " " 477757888888888888888888757774 " " 477758999999999999999999857774 "
    " 477758999999999999999999857774 " " 477758888888888888888888857774 " " 557757877777777777777778757755 "
    "  4444444444444444444444444444  " "                                "
  ,
  //  5 TEXT
    "    $$$$$$$$$$$$$$$$$$$         " "    $wwwwwwwwwwwwwwwww$0        " "    $wwwwwwwwwwwwwwwww$$0       "
    "    $wwwwwwwwwwwwwwwww$6$0      " "    $wwwwwwwwwwwwwwwww$w6$0     " "    $wwwwwwwwwwwwwwwww$ww6$0    "
    "    $wwwwwwwwwwwwwwwww$000000   " "    $wwwwwwwwwwwwwwwwwwwwww60   " "    $www000000000000wwwwwww60   "
    "    $wwwwwwwwwwwwwwwwwwwwww60   " "    $wwwwwwwwwwwwwwwwwwwwww60   " "    $www0000000000000000www60   "
    "    $wwwwwwwwwwwwwwwwwwwwww60   " "    $wwwwwwwwwwwwwwwwwwwwww60   " "    $www0000000000000000www60   "
    "    $wwwwwwwwwwwwwwwwwwwwww60   " "    $wwwwwwwwwwwwwwwwwwwwww60   " "    $www0000000000000000www60   "
    "    $wwwwwwwwwwwwwwwwwwwwww60   " "    $wwwwwwwwwwwwwwwwwwwwww60   " "    $www0000000000000000www60   "
    "    $wwwwwwwwwwwwwwwwwwwwww60   " "    $wwwwwwwwwwwwwwwwwwwwww60   " "    $www000000000000wwwwwww60   "
    "    $wwwwwwwwwwwwwwwwwwwwww60   " "    $wwwwwwwwwwwwwwwwwwwwww60   " "    $www000000000000wwwwwww60   "
    "    $wwwwwwwwwwwwwwwwwwwwww60   " "    $wwwwwwwwwwwwwwwwwwwwww60   " "    $wwwwwwwwwwwwwwwwwwwwww60   "
    "    $666666666666666666666660   " "    0000000000000000000000000   "
  ,
  //  6 SYSTEM
    "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%" "%aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa%" "%aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa%"
    "%aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa%" "%aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa%" "%aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa%"
    "%aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa%" "%aaaaaaCwwCaaaaaaaaaaaaaaaaaaaa%" "%aaaacwwwwwcaaaaaaaaaaaaaaaaaaa%"
    "%aaaCwwwwwwwaaaaaaaaaaaaaaaaaaa%" "%aacwwwwwwwwwaaaaaaaaaaaaaaaaaa%" "%aaaaaaawwwwwaaaaaaaaaaaaaaaaaa%"
    "%aaaaaaawwwwwwaaaaaaaaaaaaaaaaa%" "%aaaaaaawaatwwwaaaaaaaaaaaaaaaa%" "%aaaaaaawtaawwwwaaaaaaaaaaaaaaa%"
    "%aacwwwwwaatwwwwwaaaaaaaaaaaaaa%" "%aaaCwwwwtaawwwwwwwaaaaaaaaaaaa%" "%aaaacwwwwwwwwwwwwwwwaaaaaaaaaa%"
    "%aaaaacwwwaaaawwwwwwwwwaaaaaaaa%" "%aaaaaaaaaaaaaaawwwwwwwwwaaaaaa%" "%aaaaaaaaaaaaaaaaawwwwwwwwwcaaa%"
    "%aaaaaaaaaaaaaaaaaaawwwwwwCwCaa%" "%aaaaaaaaaaaaaaaaaaaaawwwCaCwaa%" "%aaaaaaaaaaaaaaaaaaaaaacwwCwCaa%"
    "%aaaaaaaaaaaaaaaaaaaaaaaaCwCaaa%" "%aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa%" "%aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa%"
    "%aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa%" "%aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa%" "%aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa%"
    "%aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa%" "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
  ,
  //  7 EXIT
    "      RRRRRRRRRRRRRRRRRRRR      " "     RRRRRRRRRRRRRRRRRRRRRR     " "    RRRRRRRRRRRRRRRRRRRRRRRR    "
    "   RRRRRRRRRRRRRRRRRRRRRRRRRR   " "  RRRRRRRRRRRRRRRRRRRRRRRRRRRR  " " RRRRRRRRRRRRRRRRRRRRRRRRRRRRRR "
    "RRRRRRRiwiRRRRRRRRRRRRiwiRRRRRRR" "RRRRRRiwwwiRRRRRRRRRRiwwwiRRRRRR" "RRRRRiwwwwwiRRRRRRRRiwwwwwiRRRRR"
    "RRRRRRiwwwwwiRRRRRRiwwwwwiRRRRRR" "RRRRRRRiwwwwwiRRRRiwwwwwiRRRRRRR" "RRRRRRRRiwwwwwiRRiwwwwwiRRRRRRRR"
    "RRRRRRRRRiwwwwwiiwwwwwiRRRRRRRRR" "RRRRRRRRRRiwwwwwwwwwwiRRRRRRRRRR" "RRRRRRRRRRRiwwwwwwwwiRRRRRRRRRRR"
    "RRRRRRRRRRRRiwwwwwwiRRRRRRRRRRRR" "RRRRRRRRRRRRiwwwwwwiRRRRRRRRRRRR" "RRRRRRRRRRRiwwwwwwwwiRRRRRRRRRRR"
    "RRRRRRRRRRiwwwwwwwwwwiRRRRRRRRRR" "RRRRRRRRRiwwwwwiiwwwwwiRRRRRRRRR" "RRRRRRRRiwwwwwiRRiwwwwwiRRRRRRRR"
    "RRRRRRRiwwwwwiRRRRiwwwwwiRRRRRRR" "RRRRRRiwwwwwiRRRRRRiwwwwwiRRRRRR" "RRRRRiwwwwwiRRRRRRRRiwwwwwiRRRRR"
    "RRRRRRiwwwiRRRRRRRRRRiwwwiRRRRRR" "RRRRRRRiwiRRRRRRRRRRRRiwiRRRRRRR" " RRRRRRRRRRRRRRRRRRRRRRRRRRRRRR "
    "  RRRRRRRRRRRRRRRRRRRRRRRRRRRR  " "   RRRRRRRRRRRRRRRRRRRRRRRRRR   " "    RRRRRRRRRRRRRRRRRRRRRRRR    "
    "     RRRRRRRRRRRRRRRRRRRRRR     " "      RRRRRRRRRRRRRRRRRRRR      "
  ,
  //  8 BACK
    "      llllllllllllllllllll      " "     llllllllllllllllllllll     " "    llllllllllllllllllllllll    "
    "   llllllllllllllllllllllllll   " "  llllllllllllllllllllllllllll  " " llllllllllllllllllllllllllllll "
    "llllllllllllllllllllllllllllllll" "llllllllllllllwwwlllllllllllllll" "lllllllllllllwwwwlllllllllllllll"
    "llllllllllllwwwwwlllllllllllllll" "lllllllllllwwwwwllllllllllllllll" "llllllllllwwwwwlllllllllllllllll"
    "lllllllllwwwwwllllllllllllllllll" "llllllllwwwwwlllllllllllllllllll" "lllllllwwwwwwwwwwwwwwwwwwwllllll"
    "llllllwwwwwwwwwwwwwwwwwwwwllllll" "llllllwwwwwwwwwwwwwwwwwwwwllllll" "lllllllwwwwwwwwwwwwwwwwwwwllllll"
    "llllllllwwwwwlllllllllllllllllll" "lllllllllwwwwwllllllllllllllllll" "llllllllllwwwwwlllllllllllllllll"
    "lllllllllllwwwwwllllllllllllllll" "llllllllllllwwwwwlllllllllllllll" "lllllllllllllwwwwlllllllllllllll"
    "llllllllllllllwwwlllllllllllllll" "llllllllllllllllllllllllllllllll" " llllllllllllllllllllllllllllll "
    "  llllllllllllllllllllllllllll  " "   llllllllllllllllllllllllll   " "    llllllllllllllllllllllll    "
    "     llllllllllllllllllllll     " "      llllllllllllllllllll      "
  ,
};

void CommandMain(HWND hwnd)
{ // ボタンアイコン
  int i, cn = 0;
  HDIB bm;

  if (YesNoBox(hwnd, "ボタンアイコンを作成します。よろしいですか？", NULL) != IDYES) return;  
  for (i = 0; i < NELEM(MBI); i++) {
    bm = CreateDIBFromSTR(16, 16, MBI[i]); if (!bm) break;
    TrimDIB(bm, -4, -4, 24, 24, 0xf0f0f0);
    if (SaveBMP(bm, format("T%02d.BMP", i))) cn++;
    DeleteDIB(bm);
  }
  for (i = 0; i < NELEM(OBI); i++) {
    bm = CreateDIBFromSTR(32, 32, OBI[i]); if (!bm) break;
    if (SaveBMP(bm, format("M%02d.BMP", i))) cn++;
    DeleteDIB(bm);
  }
  OkBox(hwnd, format("%d 個のファイルを作成しました。", cn), NULL);
}
