Вниз
Скачать: CL | DM;

API   Найти похожие ветки 

← →
dubel   (2002-06-05 17:30) [0]

Подскажите пожалуйста РЕАЛЬНЫЙ пример создания окна параметров страницы с помощью функции PAGESETUPDLG с примером заполнения структуры PAGESETUPDLG


← →
Alexander Vorobyov   (2002-06-10 13:52) [1]

Если поможет, вот пример из WIN32.HLP:
void DoPage(HWND hwnd, RECT rcMarg, RECT rcMinMarg, POINT ptPaperSize)
{
PAGESETUPDLG psd = {0};

psd.lStructSize = sizeof(PAGESETUPDLG);
psd.hwndOwner = hwnd;
psd.hDevMode = hDevMode;
psd.hDevNames = hDevNames;
psd.Flags = PSD_INTHOUSANDTHSOFINCHES | PSD_MARGINS |
PSD_MINMARGINS | PSD_ENABLEPAGEPAINTHOOK;
psd.ptPaperSize = ptPaperSize;
psd.rtMargin = rcMarg;
psd.rtMinMargin = rcMinMarg;
psd.hInstance= g_hinst;

psd.lCustData = 0;
psd.lpfnPagePaintHook = PaintHook;

PageSetupDlg(&psd);
}

BOOL CALLBACK PaintHook(HWND hwndDlg, UINT uMsg, WPARAM wParam,
LPARAM lParam)
{
LPRECT lprc;
COLORREF crMargRect;
HDC hdc, hdcOld;

switch (uMsg) {

// Drawing the margin rectangle.
case WM_PSD_MARGINRECT:
hdc = (HDC) wParam;
lprc = (LPRECT) lParam;

// Get the system highlight color.

crMargRect = GetSysColor(COLOR_HIGHLIGHT);

// Create a dash-dot pen of the system highlight color and
// select it into the DC of the sample page.
hdcOld = SelectObject(hdc, CreatePen(PS_DASHDOT, .5,
crMargRect));

// Draw the margin rectangle.
Rectangle(hdc, lprc->left, lprc->top, lprc->right,
lprc->bottom);

// Restore the previous pen to the DC.

SelectObject(hdc, hdcOld);
return TRUE;

default:
return FALSE;
}
return TRUE;
}


P.S. из статьи "Displaying the Page Setup Dialog Box" в WIN32.HLP



Страницы: 1 вся ветка

Скачать: CL | DM;



Память: 0.45 MB
Время: 0.014 c
6-48237
mifi
2002-06-02 22:11
2002.08.15
получение IP адреса


14-48274
mvg_first
2002-07-19 17:19
2002.08.15
Кто как использует UML в своей работе? Опять же опрос :)


1-48075
Are you want a tea?
2002-08-04 16:06
2002.08.15
TThread


1-48150
Man-In-Red
2002-08-01 15:39
2002.08.15
Помогите пожалуйста!


3-47940
Дмитрий Жуков
2002-07-23 11:59
2002.08.15
Почему может виснуть многопоточный сервер приложений?




   Наверх