Advertisement
Guest User

Untitled

a guest
Apr 25th, 2013
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     std::string GetFlagString(const unsigned int flags)
  2.     {
  3.         std::string str;
  4.  
  5.         if (flags & SWP_DRAWFRAME) /*SWP_FRAMECHANGED*/
  6.             str += " SWP_DRAWFRAME or SWP_FRAMECHANGED ";
  7.  
  8.         if (flags &  SWP_HIDEWINDOW)
  9.             str += " SWP_HIDEWINDOW";
  10.    
  11.         if (flags &  SWP_NOACTIVATE)
  12.             str += " SWP_NOACTIVATE";
  13.            
  14.  
  15.         if (flags &  SWP_NOCOPYBITS)
  16.             str += " SWP_NOCOPYBITS ";
  17.            
  18.  
  19.         if (flags &  SWP_NOMOVE)
  20.             str += " SWP_NOMOVE ";
  21.            
  22.  
  23.         if (flags &  SWP_NOOWNERZORDER) /*SWP_NOREPOSITION*/
  24.             str += " SWP_NOOWNERZORDER or SWP_NOREPOSITION";
  25.            
  26.  
  27.         if (flags &  SWP_NOREDRAW)
  28.             str += " SWP_NOREDRAW ";
  29.            
  30.  
  31.         if (flags &  SWP_NOSENDCHANGING)
  32.             str += " SWP_NOSENDCHANGING ";
  33.            
  34.  
  35.         if (flags &  SWP_NOSIZE)
  36.             str += " SWP_NOSIZE ";
  37.            
  38.  
  39.         if (flags &  SWP_NOZORDER)
  40.             str += " SWP_NOZORDER ";
  41.            
  42.  
  43.         if (flags &  SWP_SHOWWINDOW)
  44.             str += " SWP_SHOWWINDOW ";
  45.            
  46.  
  47.         return str;
  48.     }
  49.  
  50.         void dbgPrintPosition(const int x, const int y, const int w, const int h, const int flags)
  51.         {
  52.             std::cout << "position = (" << x << ", = " << y;
  53.             std::cout << "), size = (" << w << ", " << h << ")," << std::endl;
  54.             if (flags)
  55.             {
  56.                 std::cout << "flags = " <<  GetFlagString(flags);
  57.             }
  58.             std::cout << std::endl;
  59.         }
  60.  
  61.         void dbgPrintPositionCurrent()
  62.         {
  63.             RECT r = {0};
  64.             GetWindowRect(m_hWnd, &r);
  65.             dbgPrintPosition(r.left, r.top, r.right - r.left, r.bottom - r.top, 0);
  66.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement