Microsoft 64 bit MASM > MASM64 SDK

lpCustColors element in CHOOSECOLOR struct

(1/2) > >>

bluedevil:
Hello =)

You can see CHOOSECOLOR struct in our latest MASM64 SDK Beta2

--- Code: ---  CHOOSECOLORA STRUCT QWORD
    lStructSize     dd ?
    hwndOwner       dq ?
    hInstance       dq ?
    rgbResult       dd ?
    lpCustColors    dd ?
    Flags           dd ?
    lCustData       dq ?
    lpfnHook        dq ?
    lpTemplateName  dq ?
  CHOOSECOLORA ENDS

  CHOOSECOLORW STRUCT QWORD
    lStructSize     dd ?
    hwndOwner       dq ?
    hInstance       dq ?
    rgbResult       dd ?
    lpCustColors    dd ?
    Flags           dd ?
    lCustData       dq ?
    lpfnHook        dq ?
    lpTemplateName  dq ?
  CHOOSECOLORW ENDS

  IFDEF __UNICODE__
    CHOOSECOLOR equ <CHOOSECOLORW>
  ELSE
    CHOOSECOLOR equ <CHOOSECOLORA>
  ENDIF

--- End code ---

Pay attention to the lpCustColors element; it is DWORD. Now let's look in M$ docs :


--- Code: ---typedef struct tagCHOOSECOLORA {
  DWORD        lStructSize;
  HWND         hwndOwner;
  HWND         hInstance;
  COLORREF     rgbResult;
  COLORREF     *lpCustColors;
  DWORD        Flags;
  LPARAM       lCustData;
  LPCCHOOKPROC lpfnHook;
  LPCSTR       lpTemplateName;
  LPEDITMENU   lpEditInfo;
} CHOOSECOLORA, *LPCHOOSECOLORA;

--- End code ---

As you can see above lpCustColors element is a pointer to a dword value COLORREF. Also the name indicates that it is a long pointer.

@hutch-- we should update sdk and change lpCustColors type from dd to dq. Otherwise ChooseColor function does not work!

hutch--:
Sorry to be slow but I have much to do.

Is this the form you are after ? I don't have a test piece set up to test it.

  CHOOSECOLORA STRUCT QWORD
    lStructSize dd ?
    hwndOwner dq ?
    hInstance dq ?
    rgbResult dd ?
    lpCustColors dq ?           ; pointer to lpCustColors
    Flags dd ?
    lCustData dq ?
    lpfnHook dq ?
    lpTemplateName dq ?
  CHOOSECOLORA ENDS

  CHOOSECOLORW STRUCT QWORD
    lStructSize dd ?
    hwndOwner dq ?
    hInstance dq ?
    rgbResult dd ?
    lpCustColors dq ?           ; pointer to lpCustColors
    Flags dd ?
    lCustData dq ?
    lpfnHook dq ?
    lpTemplateName dq ?
  CHOOSECOLORW ENDS

bluedevil:
Exactly hutch, and you have shared the corrected ones  :thumbsup:

C3:
Hi,

Yes I can confirm that changing pointer to 64bit's works. Just figured out that and I didn't remember this post at time. After that calling ChooseColor works.


--
Petter

hutch--:
What happened is that Vasily used my old 32 bit WINDOWS.INC file for his own 64 bit file but this one got past him. When I reused Vasily's include file, I missed it as well as I did not have a test piece to test this structure. Most of the rest has been fed through a multitude of test pieces to get them right and I added a lot of stuff to the include file.

Like any include file, there can always be more, especially as Microsoft keep adding things to their includes.

Navigation

[0] Message Index

[#] Next page

Go to full version