gTestNum = 1;
if(LOWORD(param) == COMPTST) gTestNum = 1;
WndProc(HWND hWnd, UINT msg, WPARAM param, LPARAM lparam){  HMENU hMenu;  char szFile[256];  switch (msg)     {    case WM_COMMAND:      hMenu = GetMenu(hWnd);      switch (LOWORD(param))         {        case TIMER_OPEN:           {          if (!OpenFileDialog(szFile, 256))              return 0L;          MyLoadImage(szFile,PR_FALSE,NULL);          break;          }        case TIMER_EXIT:          ::DestroyWindow(hWnd);          exit(0);          break;        case RDMSK:            if (gMaskImage!=nsnull)               {              NS_RELEASE(gMaskImage);              gMaskImage = nsnull;              }            if (OpenFileDialog(szFile, 256))              MyLoadImage(szFile,PR_TRUE,&gMaskImage);          break;        case COMPTST:          gTestNum = 1;        case COMPTSTSPEED:          if(LOWORD(param) == COMPTSTSPEED)            gTestNum = 2;          IsImageLoaded();          if(gImage)            {               if (gBlendImage!=nsnull)               {              NS_RELEASE(gBlendImage);              gBlendImage = nsnull;              }            gXOff = 100;            gYOff = 100;            if (OpenFileDialog(szFile, 256))              MyLoadImage(szFile,PR_TRUE,&gBlendImage);            }          break;        case BSTNOOPT:        case BSTOPT:          IsImageLoaded();          if(gImage)            {            PRBool opt;            nsIRenderingContext *drawCtx = gWindow->GetRenderingContext();            if(LOWORD(param) == BSTNOOPT)              opt = PR_FALSE;            else              opt = PR_TRUE;            speedtest(gImage,drawCtx, 0, 0, gImage->GetWidth(), gImage->GetHeight(),opt);            }          break;        case DRAWTEST:            if(gWindow)              {              nsIRenderingContext *drawCtx = gWindow->GetRenderingContext();              drawtest(drawCtx);              }          break;        case FILLTEST:            if(gWindow)              {              nsIRenderingContext *drawCtx = gWindow->GetRenderingContext();              filltest(drawCtx);              }          break;        case ARCTEST:            if(gWindow)              {              nsIRenderingContext *drawCtx = gWindow->GetRenderingContext();              arctest(drawCtx);              }          break;        default:            break;      }      break;    case WM_CREATE:      // Initialize image library      if (NS_NewImageManager(&gImageManager) != NS_OK||gImageManager->Init() != NS_OK)         {        ::MessageBox(NULL, "Can't initialize the image library",class1Name, MB_OK);        }	        gImageManager->SetCacheSize(1024*1024);      break;    case WM_DESTROY:      MyInterrupt();      MyReleaseImages();      if (gImageGroup != nsnull)         {        NS_RELEASE(gImageGroup);        }      if (gImageManager != nsnull)         {        NS_RELEASE(gImageManager);        }      if (gBlendImage)         {        NS_RELEASE(gBlendImage);        gBlendImage = NULL;        }      PostQuitMessage(0);      break;    default:      break;    }  return DefWindowProc(hWnd, msg, param, lparam);}