Главная страница
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
7-48339
Timon
2002-02-05 14:32
2002.08.15
Как заморозить всех?


3-47982
MsGuns
2002-07-24 16:59
2002.08.15
СРОЧНО !!!


1-48128
-=Prior=-
2002-08-01 10:34
2002.08.15
Господа помогите!


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


14-48319
Alexandr
2002-07-11 12:43
2002.08.15
Блондинка за рулем