Diff for /np2/win9x/toolwin.cpp between versions 1.22 and 1.24

version 1.22, 2007/01/08 07:52:01 version 1.24, 2007/11/11 07:11:27
Line 153  static HBITMAP skinload(const OEMCHAR *p Line 153  static HBITMAP skinload(const OEMCHAR *p
 #else  #else
                 const TCHAR *tchr = fname;                  const TCHAR *tchr = fname;
 #endif  #endif
                 ret = (HBITMAP)LoadImage(hInst, tchr, IMAGE_BITMAP,                  ret = (HBITMAP)LoadImage(g_hInstance, tchr, IMAGE_BITMAP,
                                                                                                         0, 0, LR_LOADFROMFILE);                                                                                                          0, 0, LR_LOADFROMFILE);
                 if (ret != NULL) {                  if (ret != NULL) {
                         return(ret);                          return(ret);
                 }                  }
         }          }
         return(LoadBitmap(hInst, _T("NP2TOOL")));          return(LoadBitmap(g_hInstance, _T("NP2TOOL")));
 }  }
   
   
Line 457  static void toolwincreate(HWND hWnd) { Line 457  static void toolwincreate(HWND hWnd) {
 #endif  #endif
                         sub = CreateWindow(cls, ptext, WS_CHILD | WS_VISIBLE | style,                          sub = CreateWindow(cls, ptext, WS_CHILD | WS_VISIBLE | style,
                                                         p->posx, p->posy, p->width, p->height,                                                          p->posx, p->posy, p->width, p->height,
                                                         hWnd, (HMENU)(i + IDC_BASE), hInst, NULL);                                                          hWnd, (HMENU)(i + IDC_BASE), g_hInstance, NULL);
                 }                  }
                 toolwin.sub[i] = sub;                  toolwin.sub[i] = sub;
                 toolwin.subproc[i] = NULL;                  toolwin.subproc[i] = NULL;
Line 641  const OEMCHAR *p; Line 641  const OEMCHAR *p;
         DrawMenuBar(hWnd);          DrawMenuBar(hWnd);
         sysmng_update(SYS_UPDATEOSCFG);          sysmng_update(SYS_UPDATEOSCFG);
   
         wlex = np2_winlocexallwin(hWndMain);          wlex = np2_winlocexallwin(g_hWndMain);
         winlocex_setholdwnd(wlex, hWnd);          winlocex_setholdwnd(wlex, hWnd);
         toolwindestroy();          toolwindestroy();
         hbmp = skinload(np2tool.skin);          hbmp = skinload(np2tool.skin);
Line 668  static void openpopup(HWND hWnd, LPARAM  Line 668  static void openpopup(HWND hWnd, LPARAM 
   
         hMenu = CreatePopupMenu();          hMenu = CreatePopupMenu();
         if (!winui_en) {          if (!winui_en) {
                 mainmenu = np2class_gethmenu(hWndMain);                  mainmenu = np2class_gethmenu(g_hWndMain);
                 menu_addmenubar(hMenu, mainmenu);                  menu_addmenubar(hMenu, mainmenu);
         }          }
         AppendMenu(hMenu, MF_POPUP, (UINT)createskinmenu(), str_toolskin);          AppendMenu(hMenu, MF_POPUP, (UINT)createskinmenu(), str_toolskin);
Line 727  static LRESULT CALLBACK twproc(HWND hWnd Line 727  static LRESULT CALLBACK twproc(HWND hWnd
   
                                 case IDC_BASE + IDC_TOOLFDD1BROWSE:                                  case IDC_BASE + IDC_TOOLFDD1BROWSE:
                                         if (!winui_en) {                                          if (!winui_en) {
                                                 SendMessage(hWndMain, WM_COMMAND, IDM_FDD1OPEN, 0);                                                  SendMessage(g_hWndMain, WM_COMMAND, IDM_FDD1OPEN, 0);
                                         }                                          }
                                         break;                                          break;
   
Line 744  static LRESULT CALLBACK twproc(HWND hWnd Line 744  static LRESULT CALLBACK twproc(HWND hWnd
   
                                 case IDC_BASE + IDC_TOOLFDD2BROWSE:                                  case IDC_BASE + IDC_TOOLFDD2BROWSE:
                                         if (!winui_en) {                                          if (!winui_en) {
                                                 SendMessage(hWndMain, WM_COMMAND, IDM_FDD2OPEN, 0);                                                  SendMessage(g_hWndMain, WM_COMMAND, IDM_FDD2OPEN, 0);
                                         }                                          }
                                         break;                                          break;
   
Line 755  static LRESULT CALLBACK twproc(HWND hWnd Line 755  static LRESULT CALLBACK twproc(HWND hWnd
   
                                 case IDC_BASE + IDC_TOOLRESET:                                  case IDC_BASE + IDC_TOOLRESET:
                                         if (!winui_en) {                                          if (!winui_en) {
                                                 SendMessage(hWndMain, WM_COMMAND, IDM_RESET, 0);                                                  SendMessage(g_hWndMain, WM_COMMAND, IDM_RESET, 0);
                                                 SetForegroundWindow(hWndMain);                                                  SetForegroundWindow(g_hWndMain);
                                         }                                          }
                                         break;                                          break;
   
                                 case IDC_BASE + IDC_TOOLPOWER:                                  case IDC_BASE + IDC_TOOLPOWER:
                                         if (!winui_en) {                                          if (!winui_en) {
                                                 SendMessage(hWndMain, WM_CLOSE, 0, 0L);                                                  SendMessage(g_hWndMain, WM_CLOSE, 0, 0L);
                                         }                                          }
                                         break;                                          break;
   
                                 case IDM_SKINSEL:                                  case IDM_SKINSEL:
                                         soundmng_disable(SNDPROC_TOOL);                                          soundmng_disable(SNDPROC_TOOL);
                                         r = dlgs_selectfile(hWnd, &skinui, np2tool.skin,                                          r = dlgs_openfile(hWnd, &fpSkin, np2tool.skin,
                                                                                         NELEMENTS(np2tool.skin), NULL);                                                                                          NELEMENTS(np2tool.skin), NULL);
                                         soundmng_enable(SNDPROC_TOOL);                                          soundmng_enable(SNDPROC_TOOL);
                                         if (r) {                                          if (r) {
Line 797  static LRESULT CALLBACK twproc(HWND hWnd Line 797  static LRESULT CALLBACK twproc(HWND hWnd
   
                                 default:                                  default:
                                         if (!winui_en) {                                          if (!winui_en) {
                                                 return(SendMessage(hWndMain, msg, wp, lp));                                                  return(SendMessage(g_hWndMain, msg, wp, lp));
                                         }                                          }
                                         break;                                          break;
                         }                          }
Line 805  static LRESULT CALLBACK twproc(HWND hWnd Line 805  static LRESULT CALLBACK twproc(HWND hWnd
   
                 case WM_KEYDOWN:                                                // TABを押した時に復帰                  case WM_KEYDOWN:                                                // TABを押した時に復帰
                         if ((short)wp == VK_TAB) {                          if ((short)wp == VK_TAB) {
                                 idc = GetWindowLongPtr(hWnd, GTWLP_FOCUS);                                  idc = (UINT)GetWindowLongPtr(hWnd, GTWLP_FOCUS);
                                 if (idc < IDC_MAXITEMS) {                                  if (idc < IDC_MAXITEMS) {
                                         SetFocus(toolwin.sub[idc]);                                          SetFocus(toolwin.sub[idc]);
                                 }                                  }
                                 return(0);                                  return(0);
                         }                          }
                         return(SendMessage(hWndMain, msg, wp, lp));                          return(SendMessage(g_hWndMain, msg, wp, lp));
   
                 case WM_KEYUP:                  case WM_KEYUP:
                         if ((short)wp == VK_TAB) {                          if ((short)wp == VK_TAB) {
                                 return(0);                                  return(0);
                         }                          }
                         return(SendMessage(hWndMain, msg, wp, lp));                          return(SendMessage(g_hWndMain, msg, wp, lp));
   
                 case WM_PAINT:                  case WM_PAINT:
                         toolwinpaint(hWnd);                          toolwinpaint(hWnd);
                         break;                          break;
   
                 case WM_DRAWITEM:                  case WM_DRAWITEM:
                         tooldrawbutton(hWnd, wp, (LPDRAWITEMSTRUCT)lp);                          tooldrawbutton(hWnd, (UINT)wp, (LPDRAWITEMSTRUCT)lp);
                         break;                          break;
   
                 case WM_ENTERMENULOOP:                  case WM_ENTERMENULOOP:
Line 886  static LRESULT CALLBACK twproc(HWND hWnd Line 886  static LRESULT CALLBACK twproc(HWND hWnd
   
                 case WM_LBUTTONDBLCLK:                  case WM_LBUTTONDBLCLK:
                         np2tool.type ^= 1;                          np2tool.type ^= 1;
                         wlex = np2_winlocexallwin(hWndMain);                          wlex = np2_winlocexallwin(g_hWndMain);
                         winlocex_setholdwnd(wlex, hWnd);                          winlocex_setholdwnd(wlex, hWnd);
                         np2class_windowtype(hWnd, (np2tool.type & 1) << 1);                          np2class_windowtype(hWnd, (np2tool.type & 1) << 1);
                         winlocex_move(wlex);                          winlocex_move(wlex);
Line 917  BOOL toolwin_initapp(HINSTANCE hInstance Line 917  BOOL toolwin_initapp(HINSTANCE hInstance
         return(RegisterClass(&wc));          return(RegisterClass(&wc));
 }  }
   
 void toolwin_create(void) {  void toolwin_create(HINSTANCE hInstance) {
   
         HBITMAP hbmp;          HBITMAP hbmp;
         BITMAP  bmp;          BITMAP  bmp;
Line 937  void toolwin_create(void) { Line 937  void toolwin_create(void) {
                                                         WS_SYSMENU | WS_MINIMIZEBOX,                                                          WS_SYSMENU | WS_MINIMIZEBOX,
                                                         np2tool.posx, np2tool.posy,                                                          np2tool.posx, np2tool.posy,
                                                         bmp.bmWidth, bmp.bmHeight,                                                          bmp.bmWidth, bmp.bmHeight,
                                                         NULL, NULL, hInst, NULL);                                                          NULL, NULL, hInstance, NULL);
         winloc_setclientsize(hWnd, bmp.bmWidth, bmp.bmHeight);          winloc_setclientsize(hWnd, bmp.bmWidth, bmp.bmHeight);
         toolwin.hwnd = hWnd;          toolwin.hwnd = hWnd;
         if (hWnd == NULL) {          if (hWnd == NULL) {
Line 945  void toolwin_create(void) { Line 945  void toolwin_create(void) {
         }          }
         UpdateWindow(hWnd);          UpdateWindow(hWnd);
         ShowWindow(hWnd, SW_SHOWNOACTIVATE);          ShowWindow(hWnd, SW_SHOWNOACTIVATE);
         SetForegroundWindow(hWndMain);          SetForegroundWindow(g_hWndMain);
         return;          return;
   
 twope_err2:  twope_err2:
Line 1007  void toolwin_setfdd(UINT8 drv, const OEM Line 1007  void toolwin_setfdd(UINT8 drv, const OEM
                 sub = toolwin.sub[fddlist[drv]];                  sub = toolwin.sub[fddlist[drv]];
                 if (sub) {                  if (sub) {
                         remakefddlist(sub, fdd);                          remakefddlist(sub, fdd);
                         SetForegroundWindow(hWndMain);                          SetForegroundWindow(g_hWndMain);
                 }                  }
         }          }
 }  }

Removed from v.1.22  
changed lines
  Added in v.1.24


RetroPC.NET-CVS <cvs@retropc.net>