none
帮我完善一下截图程序,谢谢了 RRS feed

  • 问题

  • 1、我希望我的截图程序打开本地文件时,当鼠标移到图像上时,拦截左键消息,哪位指点下:

    2、对话框加载图像后运行缓慢,不知何因??

    INT_PTR CALLBACK About(HWND hDlg,UINT message,WPARAM wParam,LPARAM lParam)
    {
     HBITMAP bmp=LoadBitmap(hInst,MAKEINTRESOURCE(IDB_BITMAP1));
     static HBRUSH brush=CreatePatternBrush(bmp);
     UNREFERENCED_PARAMETER(lParam);
     static HBRUSH hbrushStatic=(HBRUSH)GetStockObject(NULL_BRUSH);
     switch(message)
     {
     case WM_CTLCOLORDLG:
      DeleteObject(bmp);//bmp
      SetBkMode((HDC)wParam,TRANSPARENT);
      SetWindowLong(hDlg,DWL_MSGRESULT,(LONG)brush);
      return (LONG)brush;
     case WM_CTLCOLORSTATIC:
      SetBkMode((HDC)wParam,TRANSPARENT);
      SetWindowLong(hDlg,DWL_MSGRESULT,(LONG)hbrushStatic);
      return(LONG)hbrushStatic;
     case WM_INITDIALOG:
      return (INT_PTR)TRUE;
     case WM_COMMAND:
      if(LOWORD(wParam)==IDOK||LOWORD(wParam)==IDCANCEL)
      {
       EndDialog(hDlg,LOWORD(wParam));
       return(INT_PTR)TRUE;
      }
      break;
     }
     return(INT_PTR)FALSE;
    }


    程学武

    2012年3月11日 4:41