Hi,
I'm using CreateDialogIndirect() to display a dialog, and using the code below to set up a button.
I'd like to specify the colour of the button - does anyone know how?
This would really help me, so thanks in advance to anyone who can help.
Cheers,
Daih
AlignToDblWordBoundary (&p);
Style = WS_VISIBLE | WS_TABSTOP;
*p++ = LOWORD (Style);
*p++ = HIWORD (Style);
/* Specify lo-word and hi-word of the extended style of the button, which we won't use. */
*p++ = 0;
*p++ = 0;
/* Then coordinates. */
*p++ = x;
*p++ = y;
*p++ = width;
*p++ = height;
/* Then the id of the button, e.g. IDC_ABORT, so when it's pressed we know which one it was. */
*p++ = Id;
*p++ = 0xFFFF; /* Specifies that the next value will specify what this item is, e.g. button, text etc. */
*p++ = 0x0080; /* Specifies this item is a button. */
/* The text on the button, e.g. "Abort". */
WriteWideCharsAndInc (wpp, Caption);
/* Set a value specifying some extra stuff which we don't use. */
*p++ = 0;
I'm using CreateDialogIndirect() to display a dialog, and using the code below to set up a button.
I'd like to specify the colour of the button - does anyone know how?
This would really help me, so thanks in advance to anyone who can help.
Cheers,
Daih
AlignToDblWordBoundary (&p);
Style = WS_VISIBLE | WS_TABSTOP;
*p++ = LOWORD (Style);
*p++ = HIWORD (Style);
/* Specify lo-word and hi-word of the extended style of the button, which we won't use. */
*p++ = 0;
*p++ = 0;
/* Then coordinates. */
*p++ = x;
*p++ = y;
*p++ = width;
*p++ = height;
/* Then the id of the button, e.g. IDC_ABORT, so when it's pressed we know which one it was. */
*p++ = Id;
*p++ = 0xFFFF; /* Specifies that the next value will specify what this item is, e.g. button, text etc. */
*p++ = 0x0080; /* Specifies this item is a button. */
/* The text on the button, e.g. "Abort". */
WriteWideCharsAndInc (wpp, Caption);
/* Set a value specifying some extra stuff which we don't use. */
*p++ = 0;