   Mouse Position
  HiI want to write a class for UI using directx and C++.my problem is detecting mouse over state. I can get mouse position using Win32 function GetCursorPosition(...) or by extracting x,y from WM_MouseMove and etc...but they work only in fullscreen mode and even in fullscreen mode if user change the screen resolution , result will be wrong.absolutely they are not wrong,but I don't know how to calculate the correct state.if(mouseposition.x> ourcontrol.x && mouseposition.x < ourcontrol.x + ourcontrol.width){// do same for y{return true;}return false;}sorry for my english.   
  GetCursorPos() and the values from WM_MOUSEMOVE are in client area coordinates. You want to make sure that the client area is the same size as the backbuffer.When you create a window, you need to call AdjustWindowRectEx to get the size of the window based on the size of the client area. In fullscreen, with WS_POPUP, the client area size equals the window rectangle size, so it'll "just work" then.How do you change resolution in your game? In fullscreen, the mouse window rect should be the same size as the client rect, so mouse coordinates should be pixels.   ;  yes,back buffer must solve this problem.I am going to check that.thanks a lot.   