#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.
Back to Article