Вниз
Скачать: 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.017 c
3-47993
SuperVK
2002-07-24 07:00
2002.08.15
TQuery : 9479 -


1-48175
Ivan Karikh
2002-07-31 14:56
2002.08.15
Events, procedures, dll


1-48154
shubin
2002-08-01 14:18
2002.08.15
Нужен компонентик


1-48015
777
2002-07-31 16:50
2002.08.15
hex


14-48254
kmc
2002-07-19 18:41
2002.08.15
Визуальное построение выражений




   Наверх