FREE Subscription to Dr. Dobb’s Digest: Same Great Content, New Digital Edition
Site Archive (Complete)
Dobbs M-Dev
Email
Print
Reprint

add to:
Del.icio.us
Digg
Google
Furl
Slashdot
Y! MyWeb
Blink
August 01, 2004

Building a Callout Control

(Page 4 of 9)
August, 2004: Building a Callout Control

#include "callout.h"

LoadLibrary("callout.dll");
HWND hwndCallout = CreateWindow(CALLOUT_CLASS,
                     "Everything is gone;\n"
                     "Your life's work has been destroyed.\n"
                     "Squeeze trigger?", /* David Carlson */
                     WS_POPUP, 0, 0, 0, 0,
                     NULL, 0, hInstance, NULL);
Callout_SetMinWidth(hwndCallout, 180, FALSE);
Callout_SetExtraHeight(hwndCallout, 44, FALSE);
LPRECT rc = Callout_GetRect(hwndCallout);

HWND buttons[3];
buttons[0] = CreateWindow("Button", "Do not ask me this again",
                      WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX,
                      rc->left, rc->bottom - 16, 180, 16,
                      hwndCallout, 0, hInstance, NULL);
buttons[1] = CreateWindow("Button", "Yes",
                      WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON,
                      rc->left, rc->bottom - 38, 70, 20,
                      hwndCallout, 0, hInstance, NULL);
buttons[2] = CreateWindow("Button", "No",
                      WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON,
                      rc->left + 110, rc->bottom - 38, 70, 20,
                      hwndCallout, 0, hInstance, NULL);
hfont = (HFONT)SendMessage(hwnd, WM_GETFONT, 0, 0);
for (i = 0; i < 3; i++)
  SendMessage(buttons[i], WM_SETFONT, (WPARAM)hfont, TRUE);

Example 3: Positioning controls relative to a rectangle.

Previous Page | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 Next Page
TOP 5 ARTICLES
No Top Articles.



MICROSITES
FEATURED TOPIC

ADDITIONAL TOPICS

INFO-LINK