7 Replies - 558 Views - Last Post: 19 September 2009 - 08:59 AM Rate Topic: -----

#1 ShadowRayz  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 28-August 09

cast POINT struct to an int

Post icon  Posted 19 September 2009 - 06:49 AM

Trying to get the X, Y of my window using GetWindowPlacment.

				
				WINDOWPLACEMENT wPos;
				wPos.length = sizeof(WINDOWPLACEMENT);

				GetWindowPlacement(hwnd,&wPos);

				int X = reinterpret_cast<int>(wPos.ptMinPosition);




Problem is i can't manage to cast POINT struct to an int so i can use it in SetWindowPos.


debugger tell's me my reinternet cating is invalid...

thx :)

Is This A Good Question/Topic? 0
  • +

Replies To: cast POINT struct to an int

#2 poncho4all  Icon User is offline

  • D.I.C Head!
  • member icon

Reputation: 123
  • View blog
  • Posts: 1,405
  • Joined: 15-July 09

Re: cast POINT struct to an int

Posted 19 September 2009 - 07:08 AM

Can you post the entire error?
Was This Post Helpful? 0
  • +
  • -

#3 ShadowRayz  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 28-August 09

Re: cast POINT struct to an int

Posted 19 September 2009 - 08:19 AM

 int X = reinterpret_cast<int>(wPos.ptMinPosition);

gives "invalid reinterpret_cast from type `POINT' to type `int'"
Was This Post Helpful? 0
  • +
  • -

#4 poncho4all  Icon User is offline

  • D.I.C Head!
  • member icon

Reputation: 123
  • View blog
  • Posts: 1,405
  • Joined: 15-July 09

Re: cast POINT struct to an int

Posted 19 September 2009 - 08:35 AM

Im guessing that for the error you are trying to cast an entire Structure, have you seen if you can go further in? wPos.ptMinPosition.x or y or something similar?
Was This Post Helpful? 0
  • +
  • -

#5 ShadowRayz  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 28-August 09

Re: cast POINT struct to an int

Posted 19 September 2009 - 08:40 AM

http://msdn.microsof...611(VS.85).aspx

ptMinPosition
Specifies the coordinates of the window's upper-left corner when the window is minimized.

ptMaxPosition
Specifies the coordinates of the window's upper-left corner when the window is maximized.

Not according to MSDN i guess

On the other hand Codeblocks doesn't always show if you can go deeper into something

This post has been edited by ShadowRayz: 19 September 2009 - 08:41 AM

Was This Post Helpful? 0
  • +
  • -

#6 poncho4all  Icon User is offline

  • D.I.C Head!
  • member icon

Reputation: 123
  • View blog
  • Posts: 1,405
  • Joined: 15-July 09

Re: cast POINT struct to an int

Posted 19 September 2009 - 08:52 AM

Yea i was reading that, that's why i suggested it take a look here
http://msdn.microsof...y33(VS.80).aspx

Hope that helps
Was This Post Helpful? 1
  • +
  • -

#7 ShadowRayz  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 28-August 09

Re: cast POINT struct to an int

Posted 19 September 2009 - 08:55 AM

Solved :D thx
Was This Post Helpful? 0
  • +
  • -

#8 poncho4all  Icon User is offline

  • D.I.C Head!
  • member icon

Reputation: 123
  • View blog
  • Posts: 1,405
  • Joined: 15-July 09

Re: cast POINT struct to an int

Posted 19 September 2009 - 08:59 AM

Anytime xD
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1