   Reading the Absolute Mouse Position
  I have read a GD article I found about mouse input with DirectInput and it worked great. However the only snag is that the mouse position is only given in relative to the last time you updated the mouse position. It would be far more useful for me to know the absolute position of the cursor hotspot in pixels.Eg. DarkBasic''s MOUSEPOSITIONX() and MOUSEPOSITIONY() functions.Is there an answer within DirectInput or must I use the API instead?    >>>>>>>>>>>>>>>>>Ilthigore<<<<<<<<<<<<<<<<<  
  Your best bet is to use the Win32 function, GetCursorPos().  DInput doesn''t support what you want yet.  ;  tweak it, change it by yourself. good thing, it''s still in pixel format, not some kind of freakin mouse coordinate.this is what I do:POINT mousepos;mousepos.x = 0;   // just an initial positionmousepos.y = 0; mousepos.x += mousedata.lX;mousepos.y += mousedata.lY;if (mousepos.x < 0) mousepos.x = 0;if (mousepos.x > 639) mousepos.x = 639;// assuming it''s 640x480 resolution// and do the same with y coordinatenot hard to do.    My compiler generates one error message: "does not compile.";  Thanks mate, that worked fine!!! However I now have another problem (sigh, one thing leads to another). I can get the absolute mouse input but I need to get the exact size and top left corner position of my window (when in windowed mode). If I cannot do this I will have to restrict it to fullscreen which would be a bit of a blow. I am currently experimenting with lParam of WM_MOVE, and WM_SIZE but could anyone tell me the way to use them (experimenting doesn''t always turn out the right way).  ;  there is an API to get your window position, is it GetWindowPos()? I forget. If it's windowed app, I suggest to use WinAPI instead. Much easier. Beware of the weirdness of screen and client coordinates (this is your problem). I did this once, but I don't really remember how.I'm sure you need one call to get the mouse position relative to the screen. And then, call another function to convert it to client coordinate (which is coordinate relative to your window).My compiler generates one error message: "does not compile."  [edited by - alnite on November 21, 2002 3:14:25 PM];  POINT cursorpoint;GetCursorPos( &cursorpoint );if( cursorpoint.x == 0 )if( cursorpoint.y == 0 )return MessageBox( NULL, "0*0", "Exit On Point", MB_OK );Does this work?!    .lick;  My experimenting with lParam worked. I found out that in WM_MOVE:LOWORD(lParam) == TopLeftCornerPositionXHIWORD(lParam) == TopLeftCornerPositionYSimilarly in WM_SIZE:LOWORD(lParam) == WidthOfWindowHIWORD(lParam) == HeightOfWindowThanks for the advice anyway, maybe I shouldn''t have bothered posting about that one but oh well, thanks anyway.    >>>>>>>>>>>>>>>>>Ilthigore<<<<<<<<<<<<<<<<<  