Announcement

Collapse
No announcement yet.

MakePoints

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • MakePoints

    Temporarily I am using
    Code:
    MACRO MAKEPOINTS(lParam, pt)
        pt.x = BITS%(LOWRD(lParam))
        pt.y = BITS%(HIWRD(lParam))
    END MACRO
    But since docs state for WM_MOUSEMOVE
    Remarks

    The MAKEPOINTS macro can be used to convert the lParam parameter to a POINTS structure.
    My compiler says MakePoints is undefined unless I use the macro above. So I have to ask if this is an oversight in the Win32Api.Inc file???? or am I missing an Inc that already has this macro??/
    Engineer's Motto: If it aint broke take it apart and fix it

    "If at 1st you don't succeed... call it version 1.0"

    "Half of Programming is coding"....."The other 90% is DEBUGGING"

    "Document my code????" .... "WHYYY??? do you think they call it CODE? "

  • #2
    It is not an oversight. It simply can't be translated because it returns an structure and neither PB macros nor PB functions can currently do it.

    Code:
    POINTS MAKEPOINTS(
        DWORD dwValue
    );
    You are using a workaround, not a straight conversion.
    Forum: http://www.jose.it-berater.org/smfforum/index.php

    Comment


    • #3
      Probably NOT an oversight...
      From Windef.h
      Code:
      typedef struct tagPOINTS
      {
      #ifndef _MAC
          SHORT   x;
          SHORT   y;
      #else
          SHORT   y;
          SHORT   x;
      #endif
      } POINTS, *PPOINTS, *LPPOINTS;

      from wingdi.h
      Code:
      #define MAKEPOINTS(l)       (*((POINTS FAR *)&(l)))
      I think your conversion is fine.
      Michael Mattias
      Tal Systems (retired)
      Port Washington WI USA
      [email protected]
      http://www.talsystems.com

      Comment


      • #4
        Just do this
        Code:
        MACRO MAKEPOINTS(lParam, pt)
            pt.x = LOINT(lParam)
            pt.y = HIINT(lParam)
        END MACRO
        The result is the same.
        Why did you use loword?
        Dominic Mitchell
        Phoenix Visual Designer
        http://www.phnxthunder.com

        Comment


        • #5
          Common mistake with mouse coordinates and control ID
          Patrice Terrier
          www.zapsolution.com
          www.objreader.com
          Addons: GDImage.DLL 32/64-bit (Graphic library), WinLIFT.DLL 32/64-bit (Skin Engine).

          Comment


          • #6
            I had not thought about choice of format.

            one of those "lil things" that could cause "Such Problems" later

            maybe LO should be match with LONG rather than DWORD so negative values match???
            Engineer's Motto: If it aint broke take it apart and fix it

            "If at 1st you don't succeed... call it version 1.0"

            "Half of Programming is coding"....."The other 90% is DEBUGGING"

            "Document my code????" .... "WHYYY??? do you think they call it CODE? "

            Comment

            Working...
            X
            😀
            🥰
            🤢
            😎
            😡
            👍
            👎