Diff for /np2/win9x/winloc.cpp between versions 1.3 and 1.4

version 1.3, 2003/11/01 22:23:04 version 1.4, 2003/11/04 19:23:03
Line 209  WINLOCEX winlocex_create(HWND base, cons Line 209  WINLOCEX winlocex_create(HWND base, cons
         }          }
         ret = NULL;          ret = NULL;
         list = NULL;          list = NULL;
           inlist = 0;
         if (count) {          if (count) {
                 list = (HWND *)_MALLOC(count * sizeof(HWND *), "wnd list");                  list = (HWND *)_MALLOC(count * sizeof(HWND *), "wnd list");
                 if (list == NULL) {                  if (list == NULL) {
                         goto wlecre_err1;                          goto wlecre_err1;
                 }                  }
                 inlist = 0;  
                 for (i=0; i<count; i++) {                  for (i=0; i<count; i++) {
                         hwnd = child[i];                          hwnd = child[i];
                         if ((hwnd != NULL) && (hwnd != base) &&                          if ((hwnd != NULL) && (hwnd != base) &&
Line 307  void winlocex_destroy(WINLOCEX wle) { Line 307  void winlocex_destroy(WINLOCEX wle) {
         }          }
 }  }
   
   void winlocex_setholdwnd(WINLOCEX wle, HWND hold) {
   
           RECT    workrc;
           RECT    rect;
           UINT    flag;
   
           if ((wle == NULL) || (hold == NULL)) {
                   return;
           }
           SystemParametersInfo(SPI_GETWORKAREA, 0, &workrc, 0);
           GetWindowRect(hold, &rect);
           flag = 0;
           if (workrc.left == rect.left) {
                   flag = 1;
           }
           else if (workrc.right == rect.right) {
                   flag = 2;
           }
           if (workrc.top == rect.top) {
                   flag += 1 << 4;
           }
           else if (workrc.bottom == rect.bottom) {
                   flag += 2 << 4;
           }
           wle->hold = hold;
           wle->holdflag = flag;
   }
   
 static BOOL gravityx(WINLOCEX wle, RECT *rect) {  static BOOL gravityx(WINLOCEX wle, RECT *rect) {
   
         UINT    i;  
         WLEXWND *wnd;  
         int             d;          int             d;
           WLEXWND *wnd;
           UINT    i;
         RECT    workrc;          RECT    workrc;
   
           d = SNAPDOTPULL;
         wnd = (WLEXWND *)(wle + 1);          wnd = (WLEXWND *)(wle + 1);
         for (i=0; i<wle->count; i++, wnd++) {          for (i=0; i<wle->count; i++, wnd++) {
                 if (!wnd->connect) {                  if (!wnd->connect) {
Line 392  static BOOL gravityx(WINLOCEX wle, RECT  Line 421  static BOOL gravityx(WINLOCEX wle, RECT 
   
 static BOOL gravityy(WINLOCEX wle, RECT *rect) {  static BOOL gravityy(WINLOCEX wle, RECT *rect) {
   
         UINT    i;  
         WLEXWND *wnd;  
         int             d;          int             d;
           WLEXWND *wnd;
           UINT    i;
         RECT    workrc;          RECT    workrc;
   
           d = SNAPDOTPULL;
         wnd = (WLEXWND *)(wle + 1);          wnd = (WLEXWND *)(wle + 1);
         for (i=0; i<wle->count; i++, wnd++) {          for (i=0; i<wle->count; i++, wnd++) {
                 if (!wnd->connect) {                  if (!wnd->connect) {
Line 548  void winlocex_moving(WINLOCEX wle, RECT  Line 578  void winlocex_moving(WINLOCEX wle, RECT 
   
 void winlocex_move(WINLOCEX wle) {  void winlocex_move(WINLOCEX wle) {
   
           RECT    workrc;
         WLEXWND *wnd;          WLEXWND *wnd;
         RECT    baserect;  
         int             dx;  
         int             dy;  
         UINT    i;          UINT    i;
         RECT    rect;          RECT    rect;
         int             cx;          int             cx;
         int             cy;          int             cy;
           RECT    baserect;
           int             dx;
           int             dy;
         UINT    num;          UINT    num;
         RECT    *rc;          RECT    *rc;
   
         if ((wle == NULL) || (wle->base == NULL)) {          if ((wle == NULL) || (wle->base == NULL)) {
                 return;                  return;
         }          }
   
           wnd = (WLEXWND *)(wle + 1);
           for (i=0; i<wle->count; i++) {
                   if ((wle->hold == wnd->hwnd) && (wnd->connect)) {
                           break;
                   }
           }
           if ((i >= wle->count) && (wle->holdflag)) {
                   SystemParametersInfo(SPI_GETWORKAREA, 0, &workrc, 0);
                   GetWindowRect(wle->hold, &rect);
                   cx = rect.right - rect.left;
                   cy = rect.bottom - rect.top;
                   switch(wle->holdflag & 0x0f) {
                           case 1:
                                   rect.left = workrc.left;
                                   break;
   
                           case 2:
                                   rect.left = workrc.right - cx;
                                   break;
                   }
                   switch(wle->holdflag >> 4) {
                           case 1:
                                   rect.top = workrc.top;
                                   break;
   
                           case 2:
                                   rect.top = workrc.bottom - cy;
                                   break;
                   }
                   MoveWindow(wle->hold, rect.left, rect.top, cx, cy, TRUE);
           }
   
         GetWindowRect(wle->base, &baserect);          GetWindowRect(wle->base, &baserect);
         dx = baserect.left - wle->rect.left;          dx = baserect.left - wle->rect.left;
         dy = baserect.top - wle->rect.top;          dy = baserect.top - wle->rect.top;
   
         wnd = (WLEXWND *)(wle + 1);          wnd = (WLEXWND *)(wle + 1);
         for (i=0; i<wle->count; i++) {          for (i=0; i<wle->count; i++, wnd++) {
                 if (wnd->connect) {                  if (wnd->connect) {
                         GetWindowRect(wnd->hwnd, &rect);                          GetWindowRect(wnd->hwnd, &rect);
                         cx = rect.right - rect.left;                          cx = rect.right - rect.left;
Line 621  void winlocex_move(WINLOCEX wle) { Line 684  void winlocex_move(WINLOCEX wle) {
                         wnd->rect.right = rect.left + cx;                          wnd->rect.right = rect.left + cx;
                         wnd->rect.bottom = rect.top + cy;                          wnd->rect.bottom = rect.top + cy;
                 }                  }
                 wnd++;  
         }          }
 }  }
   

Removed from v.1.3  
changed lines
  Added in v.1.4


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