Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2002.08.15;
Скачать: 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 вся ветка

Текущий архив: 2002.08.15;
Скачать: CL | DM;

Наверх




Память: 0.46 MB
Время: 0.198 c
7-48335
xAlex
2002-06-03 12:22
2002.08.15
Простой вопрос по реестру (+)


14-48286
BKV
2002-07-19 12:21
2002.08.15
Как скрыть IP адрес?


6-48220
Sergic
2002-05-29 12:44
2002.08.15
Сетевой ресурс


1-48155
ZEE
2002-08-01 16:00
2002.08.15
Проблема с Word.Application


1-48167
Дельфятник
2002-08-02 11:31
2002.08.15
Освобождение памяти из-под объектов.