SUBS.C
上传用户:bangxh
上传日期:2007-01-31
资源大小:42235k
文件大小:2k
源码类别:

Windows编程

开发平台:

Visual C++

  1. /**********************************************************************/
  2. /*                                                                    */
  3. /*      SUBS.C                                                        */
  4. /*                                                                    */
  5. /*      Copyright (c) 1995-1997  Microsoft Corporation                */
  6. /*                                                                    */
  7. /**********************************************************************/
  8. #include "windows.h"
  9. #include "commctrl.h"
  10. #include "imm.h"
  11. #include "resource.h"
  12. #include "imeapps.h"
  13. void MoveCompCandWindow(HWND hWnd)
  14. {
  15.     RECT rc,rcClient;
  16.     int cx;
  17.     GetClientRect(hWnd, &rcClient);
  18.     GetWindowRect(hWndToolBar,&rc);
  19.     ScreenToClient(hWnd,(LPPOINT)&rc.right);
  20.     rcClient.top = rc.bottom;
  21.     GetWindowRect(hWndStatus,&rc);
  22.     ScreenToClient(hWnd,(LPPOINT)&rc.left);
  23.     rcClient.bottom = rc.top;
  24.     if (fShowCand)
  25.     {
  26.         if (rcClient.right >= CAND_CX * 3)
  27.             cx = rcClient.right-rcClient.left - CAND_CX;
  28.         else
  29.             cx = (rcClient.right-rcClient.left) * 2 / 3;
  30.         MoveWindow(hWndCompStr,
  31.                    rcClient.left,
  32.                    rcClient.top,
  33.                    cx,
  34.                    rcClient.bottom-rcClient.top,
  35.                    TRUE);
  36.         MoveWindow(hWndCandList,
  37.                    cx,
  38.                    rcClient.top,
  39.                    rcClient.right-rcClient.left - cx,
  40.                    rcClient.bottom-rcClient.top,
  41.                    TRUE);
  42.     }
  43.     else
  44.     {
  45.         MoveWindow(hWndCompStr,
  46.                    rcClient.left,
  47.                    rcClient.top,
  48.                    rcClient.right-rcClient.left,
  49.                    rcClient.bottom-rcClient.top,
  50.                    TRUE);
  51.         MoveWindow(hWndCandList,0,0,0,0,TRUE);
  52.     }
  53. }