17#define WIN_PREVIEW_CLASS L"WinPreview"
75 if (
pData->siVirtScr.cx *
pData->rcMaxArea.bottom >=
pData->siVirtScr.cy *
pData->rcMaxArea.right)
116#define RescaleCX(pData, len) \
117 MulDiv((len), (pData)->siPreview.cx, (pData)->siVirtScr.cx)
119#define RescaleCY(pData, len) \
120 MulDiv((len), (pData)->siPreview.cy, (pData)->siVirtScr.cy)
122#define RescaleRect(pData, rect) \
124 (rect).left = RescaleCX((pData), (rect).left); \
125 (rect).right = RescaleCX((pData), (rect).right); \
126 (rect).top = RescaleCY((pData), (rect).top); \
127 (rect).bottom = RescaleCY((pData), (rect).bottom); \
145 SIZE siFrame, siButton, siScroll;
167 siFrame.cx =
max(1, siFrame.cx);
173 siFrame.cy =
max(1, siFrame.cy);
179 siButton.cx =
max(1, siButton.cx);
183 siButton.cy =
max(1, siButton.cy);
192 siScroll.cx =
max(1, siScroll.cx);
196 siScroll.cy =
max(1, siScroll.cy);
219 rcWin.bottom += siScroll.cy;
230 rcWin.right += siScroll.cx;
240 rcWin.top -= siButton.cy - 1;
243 resize.cx = (siFrame.cx > 0 ? 1 + siFrame.cx : 0);
244 resize.cy = (siFrame.cy > 0 ? 1 + siFrame.cy : 0);
247 ++resize.cx, ++resize.cy;
288 SetRect(&fRect, rcWin.left, rcWin.top, rcWin.left + siFrame.cx, rcWin.bottom);
290 SetRect(&fRect, rcWin.right - siFrame.cx, rcWin.top, rcWin.right, rcWin.bottom);
297 SetRect(&fRect, rcWin.left, rcWin.top, rcWin.right, rcWin.top + siFrame.cy);
299 SetRect(&fRect, rcWin.left, rcWin.bottom - siFrame.cy, rcWin.right, rcWin.bottom);
306 if (siFrame.cx > 0 || siFrame.cy > 0)
309 SetRect(&fRect, rcWin.left, rcWin.top, rcWin.right, rcWin.bottom);
312 InflateRect(&rcWin, (siFrame.cx > 0 ? -1 : 0), (siFrame.cy > 0 ? -1 : 0));
319 SetRect(&fRect, rcWin.left, rcWin.top, rcWin.left + siButton.cx, rcWin.top + siButton.cy - 2);
325 SetRect(&fRect, fRect.right, fRect.top, rcWin.right - 2 * (siButton.cx + 1), fRect.bottom);
330 SetRect(&fRect, fRect.right, fRect.top, fRect.right + siButton.cx, fRect.bottom);
336 SetRect(&fRect, fRect.right, fRect.top, fRect.right + siButton.cx, fRect.bottom);
340 rcWin.top += siButton.cy - 1;
343 if (siScroll.cy > 0 || siScroll.cx > 0)
354 if (siScroll.cy > 0 && siScroll.cx > 0)
356 right -= (1 + siScroll.cx);
357 bottom -= (1 + siScroll.cy);
365 SetRect(&fRect, rcWin.left, rcWin.bottom - siScroll.cy,
right, rcWin.bottom);
372 SetRect(&fRect, rcWin.right - siScroll.cx, rcWin.top, rcWin.right,
bottom);
380 if (siScroll.cy > 0 && siScroll.cx > 0)
382 SetRect(&fRect, rcWin.right - siScroll.cx, rcWin.bottom - siScroll.cy, rcWin.right, rcWin.bottom);
387 rcWin.right -= siScroll.cx;
388 rcWin.bottom -= siScroll.cy;
430 case WM_DISPLAYCHANGE:
461 L"C:\\ReactOS>dir\n" \
462 L"SYSTEM <DIR> 13-04-15 5:00a\n" \
463 L"SYSTEM32 <DIR> 13-04-15 5:00a\n" \
464 L"readme txt 1739 13-04-15 5:00a\n" \
465 L"explorer exe 3329536 13-04-15 5:00a\n" \
466 L"vgafonts cab 18736 13-04-15 5:00a\n" \
467 L"setuplog txt 313 13-04-15 5:00a\n" \
468 L"win ini 7005 13-04-15 5:00a\n" ;
483 CurrentAttrib = pConInfo->ScreenAttributes;
484 else if (TextMode ==
Popup)
485 CurrentAttrib = pConInfo->PopupAttributes;
512 pbkColor =
SetBkColor(drawItem->hDC, nbkColor);
535 LONG xVirtScr, yVirtScr;
536 LONG cxVirtScr, cyVirtScr;
537 LONG cxFrame , cyFrame ;
557 (
LPARAM)
MAKELONG(xVirtScr + cxVirtScr - cxFrame, xVirtScr - cxFrame));
559 (
LPARAM)
MAKELONG(yVirtScr + cyVirtScr - cyFrame, yVirtScr - cyFrame));
577 case WM_DISPLAYCHANGE:
592 DWORD wheight, wwidth;
593 DWORD sheight, swidth;
653 if (wwidth >= swidth)
658 if (wheight >= sheight)
666 swidth =
min(
max(swidth , 1), 0xFFFF);
667 sheight =
min(
max(sheight, 1), 0xFFFF);
677 if (wheight > sheight)
705 DWORD swidth, wwidth;
711 swidth =
min(
max(swidth, 1), 0xFFFF);
730 DWORD swidth, wwidth;
736 if (wwidth >= swidth)
741 swidth =
min(
max(swidth, 1), 0xFFFF);
756 DWORD sheight, wheight;
762 sheight =
min(
max(sheight, 1), 0xFFFF);
765 if (wheight > sheight)
781 DWORD sheight, wheight;
787 if (wheight >= sheight)
792 sheight =
min(
max(sheight, 1), 0xFFFF);
PCONSOLE_STATE_INFO ConInfo
VOID RefreshFontPreview(IN FONT_PREVIEW *Preview, IN PCONSOLE_STATE_INFO pConInfo)
enum _TEXT_TYPE TEXT_TYPE
#define IDC_CHECK_SYSTEM_POS_WINDOW
#define IDC_EDIT_WINDOW_SIZE_WIDTH
#define IDC_UPDOWN_WINDOW_SIZE_WIDTH
#define IDC_EDIT_WINDOW_POS_LEFT
#define IDC_UPDOWN_WINDOW_SIZE_HEIGHT
#define IDC_STATIC_LAYOUT_WINDOW_PREVIEW
#define IDC_EDIT_WINDOW_POS_TOP
#define IDC_UPDOWN_SCREEN_BUFFER_WIDTH
#define IDC_UPDOWN_SCREEN_BUFFER_HEIGHT
#define IDC_EDIT_SCREEN_BUFFER_HEIGHT
#define IDC_EDIT_SCREEN_BUFFER_WIDTH
#define IDC_EDIT_WINDOW_SIZE_HEIGHT
#define IDC_UPDOWN_WINDOW_POS_LEFT
#define IDC_UPDOWN_WINDOW_POS_TOP
#define HeapFree(x, y, z)
#define EnableDlgItem(hDlg, nID, bEnable)
GLdouble GLdouble GLdouble GLdouble top
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
static VOID WinPrev_OnDisplayChange(IN PWINPREV_DATA pData)
VOID PaintText(IN LPDRAWITEMSTRUCT drawItem, IN PCONSOLE_STATE_INFO pConInfo, IN TEXT_TYPE TextMode)
BOOL UnRegisterWinPrevClass(IN HINSTANCE hInstance)
#define WIN_PREVIEW_CLASS
struct _WINPREV_DATA * PWINPREV_DATA
#define RescaleCY(pData, len)
const WCHAR szPreviewText[]
BOOL RegisterWinPrevClass(IN HINSTANCE hInstance)
#define RescaleCX(pData, len)
struct _WINPREV_DATA WINPREV_DATA
static LRESULT CALLBACK WinPrevProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
static VOID WinPrev_OnDraw(IN HDC hDC, IN PWINPREV_DATA pData)
INT_PTR CALLBACK LayoutProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
#define RescaleRect(pData, rect)
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
INT WINAPI MulDiv(INT nNumber, INT nNumerator, INT nDenominator)
INT WINAPI DrawTextW(HDC hdc, LPCWSTR str, INT count, LPRECT rect, UINT flags)
#define PropSheet_Changed(d, w)
struct _PSHNOTIFY * LPPSHNOTIFY
struct _NM_UPDOWN * LPNMUPDOWN
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
struct _CONSOLE_STATE_INFO * PCONSOLE_STATE_INFO
#define TextAttribFromAttrib(Attribute)
#define BkgdAttribFromAttrib(Attribute)
HGDIOBJ WINAPI GetStockObject(_In_ int)
COLORREF WINAPI SetBkColor(_In_ HDC, _In_ COLORREF)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
COLORREF WINAPI SetTextColor(_In_ HDC, _In_ COLORREF)
HBRUSH WINAPI CreateSolidBrush(_In_ COLORREF)
int WINAPI FrameRect(_In_ HDC, _In_ LPCRECT, _In_ HBRUSH)
#define SM_CYVIRTUALSCREEN
#define GetWindowLongPtrW
#define COLOR_WINDOWFRAME
BOOL WINAPI CheckDlgButton(_In_ HWND, _In_ int, _In_ UINT)
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI AdjustWindowRect(_Inout_ LPRECT, _In_ DWORD, _In_ BOOL)
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
HBRUSH WINAPI GetSysColorBrush(_In_ int)
ATOM WINAPI RegisterClassW(_In_ CONST WNDCLASSW *)
#define COLOR_ACTIVECAPTION
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
LRESULT WINAPI SendDlgItemMessageW(_In_ HWND, _In_ int, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
UINT WINAPI IsDlgButtonChecked(_In_ HWND, _In_ int)
#define SM_CXVIRTUALSCREEN
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI SetDlgItemInt(_In_ HWND, _In_ int, _In_ UINT, _In_ BOOL)
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
BOOL WINAPI UpdateWindow(_In_ HWND)
#define COLOR_ACTIVEBORDER
HWND WINAPI GetParent(_In_ HWND)
BOOL WINAPI OffsetRect(_Inout_ LPRECT, _In_ int, _In_ int)
BOOL WINAPI UnregisterClassW(_In_ LPCWSTR, HINSTANCE)
UINT WINAPI GetDlgItemInt(_In_ HWND, _In_ int, _Out_opt_ PBOOL, _In_ BOOL)
#define SM_XVIRTUALSCREEN
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
#define SetWindowLongPtrW
BOOL WINAPI InflateRect(_Inout_ LPRECT, _In_ int, _In_ int)
int WINAPI GetSystemMetrics(_In_ int)
#define SM_YVIRTUALSCREEN
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)