Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualStrewya

Posted 05 February 2013 - 01:54 AM

i had the exact same problem as you did, and after some time, this is what solved it for me. might not work for you, but worth the shot, i guess smile.png

 

RECT rc = {0,0,_xSize, _ySize};
AdjustWindowRectEx(&rc, _style, false, _extendedStyle);
//in the above call, _style is WS_POPUPWINDOW | WS_CAPTION | WS_MINIMIZEBOX
//and _extendedStyle is WS_EX_APPWINDOW | WS_EX_WINDOWEDGE
_xSize = rc.right - rc.left;
_ySize = rc.bottom - rc.top;

_hwnd = CreateWindowEx(
	_extendedStyle,
	_class.c_str(),
	_title.c_str(),
	_style,
	_xPos, //defaults to CW_USEDEFAULT
	_yPos, //defaults to CW_USEDEFAULT
	_xSize,
	_ySize,
	_hwndParent,
	_hMenu,
	_hInstance,
	this
);

...

POINT cursor;
GetCursorPos(&cursor);
ScreenToClient(_hwnd, &cursor);
//do stuff with cursor.x and .y

 

 


#2Strewya

Posted 05 February 2013 - 01:52 AM

i had the exact same problem as you did, and after some time, this is what solved it for me. might not work for you, but worth the shot, i guess smile.png
 

RECT rc = {0,0,_xSize, _ySize};
AdjustWindowRectEx(&rc, _style, false, _extendedStyle);
//in the above call, _style is WS_POPUPWINDOW | WS_CAPTION | WS_MINIMIZEBOX
//and _extendedStyle is WS_EX_APPWINDOW | WS_EX_WINDOWEDGE
_xSize = rc.right - rc.left;
_ySize = rc.bottom - rc.top;

_hwnd = CreateWindowEx(
	_extendedStyle,
	_class.c_str(),
	_title.c_str(),
	_style,
	_xPos, //defaults to CW_USEDEFAULT
	_yPos, //defaults to CW_USEDEFAULT
	_xSize,
	_ySize,
	_hwndParent,
	_hMenu,
	_hInstance,
	this
);

...

POINT cursor;
GetCursorPos(&cursor);
ScreenToClient(_hwnd, &cursor);
//do stuff with cursor.x and .y

 

 


#1Strewya

Posted 05 February 2013 - 01:51 AM

i had the exact same problem as you did, and after some time, this is what solved it for me. might not work for you, but worth the shot, i guess <img data-cke-saved-src="http://public.gamedev.net//public/style_emoticons/default/smile.png" src="http://public.gamedev.net//public/style_emoticons/default/smile.png" class="bbc_emoticon" title=":)" /><pre class="_prettyXprint _lang-auto _linenums:0">RECT rc = {0,0,_xSize, _ySize};
AdjustWindowRectEx(&amp;rc, _style, false, _extendedStyle);
//in the above call, _style is WS_POPUPWINDOW | WS_CAPTION | WS_MINIMIZEBOX
//and _extendedStyle is WS_EX_APPWINDOW | WS_EX_WINDOWEDGE
_xSize = rc.right - rc.left;
_ySize = rc.bottom - rc.top;

_hwnd = CreateWindowEx(
_extendedStyle,
_class.c_str(),
_title.c_str(),
_style,
_xPos, //defaults to CW_USEDEFAULT
_yPos, //defaults to CW_USEDEFAULT
_xSize,
_ySize,
_hwndParent,
_hMenu,
_hInstance,
this
);

...

POINT cursor;
GetCursorPos(&amp;cursor);
ScreenToClient(_hwnd, &amp;cursor);
//do stuff with cursor.x and .y
</pre>

PARTNERS