Главная страница
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.016 c
1-48016
Brand
2002-07-31 00:53
2002.08.15
RichEdit + Memo


4-48363
tretmike
2002-06-10 12:28
2002.08.15
Как опредилить имя файла приложения, зная хендл окна


1-48052
der
2002-08-01 08:15
2002.08.15
Как объявить процедуру, чтоб ее было видно из другого юнита?


7-48325
ЗГ
2002-05-23 07:32
2002.08.15
Люди не подскажите как в виндах и в ХР прописать прогу, которая


7-48347
IIS
2002-05-31 11:01
2002.08.15
Как програмно раздовать права на реестр?