ReactOS 0.4.15-dev-7918-g2a2556c
console.c File Reference
#include "console.h"
#include <debug.h>
Include dependency graph for console.c:

Go to the source code of this file.

Macros

#define NDEBUG
 

Functions

INT_PTR CALLBACK OptionsProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
INT_PTR CALLBACK FontProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
INT_PTR CALLBACK LayoutProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
INT_PTR CALLBACK ColorsProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static VOID InitPropSheetPage (PROPSHEETPAGEW *psp, WORD idDlg, DLGPROC DlgProc)
 
static VOID InitDefaultConsoleInfo (PCONSOLE_STATE_INFO pConInfo)
 
static INT_PTR CALLBACK ApplyProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
VOID ApplyConsoleInfo (HWND hwndDlg)
 
static int CALLBACK PropSheetProc (HWND hwndDlg, UINT uMsg, LPARAM lParam)
 
static LONG APIENTRY InitApplet (HANDLE hSectionOrWnd)
 
LONG CALLBACK CPlApplet (HWND hwndCPl, UINT uMsg, LPARAM lParam1, LPARAM lParam2)
 
INT WINAPI DllMain (HINSTANCE hinstDLL, DWORD dwReason, LPVOID lpvReserved)
 

Variables

HINSTANCE hApplet = NULL
 
PCONSOLE_STATE_INFO ConInfo = NULL
 
static BOOL SetConsoleInfo = FALSE
 
static BOOL SaveConsoleInfo = FALSE
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 12 of file console.c.

Function Documentation

◆ ApplyConsoleInfo()

VOID ApplyConsoleInfo ( HWND  hwndDlg)

Definition at line 88 of file console.c.

89{
90 static BOOL ConsoleInfoAlreadySaved = FALSE;
91
92 /*
93 * We already applied all the console properties (and saved if needed).
94 * Nothing more needs to be done.
95 */
96 if (ConsoleInfoAlreadySaved)
97 goto Done;
98
99 /*
100 * If we are setting the default parameters, just save them,
101 * otherwise display the confirmation & apply dialog.
102 */
103 if (ConInfo->hWnd == NULL)
104 {
107 }
108 else
109 {
111
114
115 if (!SetConsoleInfo)
116 {
117 /* Don't destroy when the user presses cancel */
119 return;
120 }
121 }
122
123 /*
124 * We applied all the console properties (and saved if needed).
125 * Set the flag so that if this function is called again, we won't
126 * need to redo everything again.
127 */
128 ConsoleInfoAlreadySaved = TRUE;
129
130Done:
131 /* Options have been applied */
133 return;
134}
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
PCONSOLE_STATE_INFO ConInfo
Definition: console.c:23
static BOOL SaveConsoleInfo
Definition: console.c:26
static INT_PTR CALLBACK ApplyProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: console.c:51
static BOOL SetConsoleInfo
Definition: console.c:25
HINSTANCE hApplet
Definition: console.c:20
#define IDD_APPLYOPTIONS
Definition: resource.h:16
#define IDC_RADIO_APPLY_ALL
Definition: resource.h:34
unsigned int BOOL
Definition: ntddk_ex.h:94
GLuint res
Definition: glext.h:9613
#define PSNRET_INVALID_NOCHANGEPAGE
Definition: prsht.h:131
#define PSNRET_NOERROR
Definition: prsht.h:129
#define SetWindowLongPtr
Definition: treelist.c:70
int32_t INT_PTR
Definition: typedefs.h:64
#define IDCANCEL
Definition: winuser.h:831
#define DialogBoxW(i, t, p, f)
Definition: winuser.h:4399
#define DWLP_MSGRESULT
Definition: winuser.h:870
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582

Referenced by ColorsProc(), FontProc(), and OptionsProc().

◆ ApplyProc()

static INT_PTR CALLBACK ApplyProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 51 of file console.c.

55{
57
58 switch (uMsg)
59 {
60 case WM_INITDIALOG:
61 {
63 return TRUE;
64 }
65 case WM_COMMAND:
66 {
67 if (LOWORD(wParam) == IDOK)
68 {
71 else
73 }
74 else if (LOWORD(wParam) == IDCANCEL)
75 {
76 EndDialog(hwndDlg, IDCANCEL);
77 }
78 break;
79 }
80 default:
81 break;
82 }
83
84 return FALSE;
85}
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define IDC_RADIO_APPLY_CURRENT
Definition: resource.h:35
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
#define LOWORD(l)
Definition: pedump.c:82
BOOL WINAPI CheckDlgButton(_In_ HWND, _In_ int, _In_ UINT)
#define WM_COMMAND
Definition: winuser.h:1740
#define WM_INITDIALOG
Definition: winuser.h:1739
#define IDOK
Definition: winuser.h:830
UINT WINAPI IsDlgButtonChecked(_In_ HWND, _In_ int)
#define BST_CHECKED
Definition: winuser.h:197
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)

Referenced by ApplyConsoleInfo().

◆ ColorsProc()

INT_PTR CALLBACK ColorsProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 37 of file colors.c.

41{
42 DWORD colorIndex;
44
45 switch (uMsg)
46 {
47 case WM_INITDIALOG:
48 {
49 /* Set the valid range of the colour indicators */
53
54 /* Select by default the screen background option */
57
58 return TRUE;
59 }
60
61 case WM_DRAWITEM:
62 {
64
65 if (IDC_STATIC_COLOR1 <= drawItem->CtlID && drawItem->CtlID <= IDC_STATIC_COLOR16)
67 else if (drawItem->CtlID == IDC_STATIC_SCREEN_COLOR)
68 PaintText(drawItem, ConInfo, Screen);
69 else if (drawItem->CtlID == IDC_STATIC_POPUP_COLOR)
70 PaintText(drawItem, ConInfo, Popup);
71
72 return TRUE;
73 }
74
75 case WM_NOTIFY:
76 {
77 switch (((LPNMHDR)lParam)->code)
78 {
79 case PSN_APPLY:
80 {
81 ApplyConsoleInfo(hDlg);
82 return TRUE;
83 }
84
85 case UDN_DELTAPOS:
86 {
88
89 /* Get the current color */
90 colorIndex = ActiveStaticControl;
91 color = ConInfo->ColorTable[colorIndex];
92
93 if (lpnmud->hdr.idFrom == IDC_UPDOWN_COLOR_RED)
94 {
95 lpnmud->iPos = min(max(lpnmud->iPos + lpnmud->iDelta, 0), 255);
97 }
98 else if (lpnmud->hdr.idFrom == IDC_UPDOWN_COLOR_GREEN)
99 {
100 lpnmud->iPos = min(max(lpnmud->iPos + lpnmud->iDelta, 0), 255);
101 color = RGB(GetRValue(color), lpnmud->iPos, GetBValue(color));
102 }
103 else if (lpnmud->hdr.idFrom == IDC_UPDOWN_COLOR_BLUE)
104 {
105 lpnmud->iPos = min(max(lpnmud->iPos + lpnmud->iDelta, 0), 255);
106 color = RGB(GetRValue(color), GetGValue(color), lpnmud->iPos);
107 }
108 else
109 {
110 break;
111 }
112
113 ConInfo->ColorTable[colorIndex] = color;
114 InvalidateRect(GetDlgItem(hDlg, IDC_STATIC_COLOR1 + colorIndex), NULL, TRUE);
117
118 PropSheet_Changed(GetParent(hDlg), hDlg);
119 break;
120 }
121 }
122
123 break;
124 }
125
126 case WM_COMMAND:
127 {
128 /* NOTE: both BN_CLICKED and STN_CLICKED == 0 */
129 if (HIWORD(wParam) == BN_CLICKED /* || HIWORD(wParam) == STN_CLICKED */)
130 {
131 WORD ctrlIndex = LOWORD(wParam);
132
133 if (ctrlIndex == IDC_RADIO_SCREEN_TEXT ||
134 ctrlIndex == IDC_RADIO_SCREEN_BACKGROUND ||
135 ctrlIndex == IDC_RADIO_POPUP_TEXT ||
136 ctrlIndex == IDC_RADIO_POPUP_BACKGROUND)
137 {
138 switch (ctrlIndex)
139 {
141 /* Get the colour of the screen foreground */
143 break;
144
146 /* Get the colour of the screen background */
148 break;
149
151 /* Get the colour of the popup foreground */
153 break;
154
156 /* Get the colour of the popup background */
158 break;
159 }
160
161 color = ConInfo->ColorTable[colorIndex];
162
163 /* Set the values of the colour indicators */
167
169 ActiveStaticControl = colorIndex;
171 break;
172 }
173 else
174 if (IDC_STATIC_COLOR1 <= ctrlIndex && ctrlIndex <= IDC_STATIC_COLOR16)
175 {
176 colorIndex = ctrlIndex - IDC_STATIC_COLOR1;
177
178 /* If the same static control was re-clicked, don't take it into account */
179 if (colorIndex == ActiveStaticControl)
180 break;
181
182 color = ConInfo->ColorTable[colorIndex];
183
184 /* Set the values of the colour indicators */
188
190 {
192 }
194 {
196 }
198 {
200 }
202 {
204 }
205
207 ActiveStaticControl = colorIndex;
211
212 PropSheet_Changed(GetParent(hDlg), hDlg);
213 break;
214 }
215 }
216 else if (HIWORD(wParam) == EN_KILLFOCUS)
217 {
218 WORD ctrlIndex = LOWORD(wParam);
219
220 if (ctrlIndex == IDC_EDIT_COLOR_RED ||
221 ctrlIndex == IDC_EDIT_COLOR_GREEN ||
222 ctrlIndex == IDC_EDIT_COLOR_BLUE)
223 {
224 DWORD value;
225
226 /* Get the current colour */
227 colorIndex = ActiveStaticControl;
228 color = ConInfo->ColorTable[colorIndex];
229
230 /* Modify the colour component */
231 switch (ctrlIndex)
232 {
235 value = min(max(value, 0), 255);
237 break;
238
241 value = min(max(value, 0), 255);
243 break;
244
247 value = min(max(value, 0), 255);
249 break;
250 }
251
252 ConInfo->ColorTable[colorIndex] = color;
253 InvalidateRect(GetDlgItem(hDlg, IDC_STATIC_COLOR1 + colorIndex), NULL, TRUE);
256
257 PropSheet_Changed(GetParent(hDlg), hDlg);
258 break;
259 }
260 }
261
262 break;
263 }
264
265 default:
266 break;
267 }
268
269 return FALSE;
270}
static DWORD ActiveStaticControl
Definition: colors.c:15
static VOID PaintStaticControls(IN LPDRAWITEMSTRUCT drawItem, IN PCONSOLE_STATE_INFO pConInfo)
Definition: colors.c:18
VOID ApplyConsoleInfo(HWND hwndDlg)
Definition: console.c:88
@ Screen
Definition: console.h:34
@ Popup
Definition: console.h:35
VOID PaintText(IN LPDRAWITEMSTRUCT drawItem, IN PCONSOLE_STATE_INFO pConInfo, IN TEXT_TYPE TextMode)
Definition: layout.c:471
#define IDC_EDIT_COLOR_GREEN
Definition: resource.h:74
#define IDC_RADIO_POPUP_BACKGROUND
Definition: resource.h:71
#define IDC_EDIT_COLOR_BLUE
Definition: resource.h:76
#define IDC_UPDOWN_COLOR_GREEN
Definition: resource.h:75
#define IDC_STATIC_SCREEN_COLOR
Definition: resource.h:78
#define IDC_STATIC_COLOR16
Definition: resource.h:96
#define IDC_UPDOWN_COLOR_BLUE
Definition: resource.h:77
#define IDC_RADIO_SCREEN_TEXT
Definition: resource.h:68
#define IDC_STATIC_COLOR1
Definition: resource.h:81
#define IDC_EDIT_COLOR_RED
Definition: resource.h:72
#define IDC_RADIO_POPUP_TEXT
Definition: resource.h:70
#define IDC_UPDOWN_COLOR_RED
Definition: resource.h:73
#define IDC_STATIC_POPUP_COLOR
Definition: resource.h:79
#define IDC_RADIO_SCREEN_BACKGROUND
Definition: resource.h:69
#define RGB(r, g, b)
Definition: precomp.h:71
#define GetBValue(quad)
Definition: precomp.h:75
#define GetGValue(quad)
Definition: precomp.h:74
#define GetRValue(quad)
Definition: precomp.h:73
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned short WORD
Definition: ntddk_ex.h:93
GLuint color
Definition: glext.h:6243
#define min(a, b)
Definition: monoChain.cc:55
#define PropSheet_Changed(d, w)
Definition: prsht.h:344
#define PSN_APPLY
Definition: prsht.h:117
#define UDM_SETRANGE
Definition: commctrl.h:2141
struct _NM_UPDOWN * LPNMUPDOWN
#define UDN_DELTAPOS
Definition: commctrl.h:2169
#define WM_NOTIFY
Definition: richedit.h:61
COLORREF ColorTable[16]
Definition: settings.h:53
USHORT PopupAttributes
Definition: settings.h:48
USHORT ScreenAttributes
Definition: settings.h:47
int iDelta
Definition: commctrl.h:2166
NMHDR hdr
Definition: commctrl.h:2164
Definition: inflate.c:139
UINT_PTR idFrom
Definition: winuser.h:3158
#define max(a, b)
Definition: svc.c:63
#define MAKELONG(a, b)
Definition: typedefs.h:249
#define HIWORD(l)
Definition: typedefs.h:247
Definition: pdh_main.c:94
#define TextAttribFromAttrib(Attribute)
Definition: settings.h:72
#define BkgdAttribFromAttrib(Attribute)
Definition: settings.h:73
#define MakeAttrib(TextAttrib, BkgdAttrib)
Definition: settings.h:74
LONG_PTR LPARAM
Definition: windef.h:208
DWORD COLORREF
Definition: windef.h:300
struct tagDRAWITEMSTRUCT * LPDRAWITEMSTRUCT
#define EN_KILLFOCUS
Definition: winuser.h:2025
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define WM_DRAWITEM
Definition: winuser.h:1645
LRESULT WINAPI SendDlgItemMessageW(_In_ HWND, _In_ int, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI SetDlgItemInt(_In_ HWND, _In_ int, _In_ UINT, _In_ BOOL)
HWND WINAPI GetParent(_In_ HWND)
BOOL WINAPI CheckRadioButton(_In_ HWND, _In_ int, _In_ int, _In_ int)
#define BN_CLICKED
Definition: winuser.h:1925
UINT WINAPI GetDlgItemInt(_In_ HWND, _In_ int, _Out_opt_ PBOOL, _In_ BOOL)
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by InitApplet().

◆ CPlApplet()

LONG CALLBACK CPlApplet ( HWND  hwndCPl,
UINT  uMsg,
LPARAM  lParam1,
LPARAM  lParam2 
)

Definition at line 346 of file console.c.

350{
351 switch (uMsg)
352 {
353 case CPL_INIT:
354 return TRUE;
355
356 case CPL_EXIT:
357 // TODO: Free allocated memory
358 break;
359
360 case CPL_GETCOUNT:
361 return 1;
362
363 case CPL_INQUIRE:
364 {
365 CPLINFO *CPlInfo = (CPLINFO*)lParam2;
366 CPlInfo->idIcon = IDC_CPLICON;
367 CPlInfo->idName = IDS_CPLNAME;
368 CPlInfo->idInfo = IDS_CPLDESCRIPTION;
369 break;
370 }
371
372 case CPL_DBLCLK:
373 InitApplet((HANDLE)hwndCPl);
374 break;
375 }
376
377 return FALSE;
378}
#define CPL_INQUIRE
Definition: cpl.h:14
#define CPL_DBLCLK
Definition: cpl.h:16
#define CPL_INIT
Definition: cpl.h:12
#define CPL_EXIT
Definition: cpl.h:18
#define CPL_GETCOUNT
Definition: cpl.h:13
static LONG APIENTRY InitApplet(HANDLE hSectionOrWnd)
Definition: console.c:156
#define IDC_CPLICON
Definition: resource.h:7
#define IDS_CPLNAME
Definition: resource.h:8
#define IDS_CPLDESCRIPTION
Definition: resource.h:9
Definition: cpl.h:24
int idName
Definition: cpl.h:26
int idInfo
Definition: cpl.h:27
int idIcon
Definition: cpl.h:25

◆ DllMain()

INT WINAPI DllMain ( HINSTANCE  hinstDLL,
DWORD  dwReason,
LPVOID  lpvReserved 
)

Definition at line 382 of file console.c.

385{
387
388 switch (dwReason)
389 {
391 hApplet = hinstDLL;
393 break;
394 }
395
396 return TRUE;
397}
DWORD dwReason
Definition: misc.cpp:154
#define DLL_PROCESS_ATTACH
Definition: compat.h:131
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85
static IN DWORD IN LPVOID lpvReserved

◆ FontProc()

INT_PTR CALLBACK FontProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 725 of file font.c.

729{
730 PFONTSIZE_LIST_CTL SizeList;
731
733
734 switch (uMsg)
735 {
736 case WM_INITDIALOG:
737 {
738 SizeList = (PFONTSIZE_LIST_CTL)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*SizeList));
739 if (!SizeList)
740 {
741 EndDialog(hDlg, 0);
742 return (INT_PTR)TRUE;
743 }
748 SizeList->bIsTTSizeDirty = FALSE;
749 SetWindowLongPtrW(hDlg, DWLP_USER, (LONG_PTR)SizeList);
750
751 /* By default show the raster font size list */
752 SizeList->UseRasterOrTTList = TRUE;
753
754 /* By default show the font sizes in pixel units */
756 SizeList->TTSizePixelUnit = TRUE;
757
758 UpdateFontSizeList(hDlg, SizeList);
759
760 DPRINT1("ConInfo->FaceName = '%S'\n", ConInfo->FaceName);
761
762 /* Face names list and current font selection will be done during PSN_SETACTIVE notification */
763 // CurrentCodePage = INVALID_CP;
764
765 return TRUE;
766 }
767
768 case WM_DESTROY:
769 {
770 if (SizeList)
771 HeapFree(GetProcessHeap(), 0, SizeList);
772 return (INT_PTR)TRUE;
773 }
774
775 case WM_DRAWITEM:
776 {
778
779 if (drawItem->CtlID == IDC_STATIC_SELECT_FONT_PREVIEW)
780 PaintText(drawItem, ConInfo, Screen);
781
782 return TRUE;
783 }
784
785 case WM_DISPLAYCHANGE:
786 {
787 /* Retransmit to the preview window */
789 WM_DISPLAYCHANGE, wParam, lParam);
790 break;
791 }
792
793 case WM_FONTCHANGE:
794 {
795 /* The pool of font resources has changed, re-enumerate the fonts */
796 HWND hFontList = GetDlgItem(hDlg, IDC_LBOX_FONTTYPE);
797
798 /* Initialize the font list */
800
801 /* Select the current font */
802 FaceNameList_SelectFont(hDlg, hFontList,
803 SizeList,
808
809 /* Refresh everything */
810 FontTypeChange(hDlg, SizeList, ConInfo);
811 break;
812 }
813
814 case WM_NOTIFY:
815 {
816 switch (((LPNMHDR)lParam)->code)
817 {
818 case PSN_APPLY:
819 {
820 ApplyConsoleInfo(hDlg);
821 return TRUE;
822 }
823
824 case PSN_SETACTIVE:
825 {
826 /* Check whether the current code page has changed.
827 * If so, re-enumerate the fonts. */
829 {
830 HWND hFontList;
831
832 /* Save the new code page */
834
835 hFontList = GetDlgItem(hDlg, IDC_LBOX_FONTTYPE);
836
837 /* Initialize the font list */
839
840 /* Select the current font */
841 FaceNameList_SelectFont(hDlg, hFontList,
842 SizeList,
847
848 /* Refresh everything */
849 FontTypeChange(hDlg, SizeList, ConInfo);
850 }
851
852 /* Fall back to default behaviour */
853 break;
854 }
855 }
856
857 break;
858 }
859
860 case WM_COMMAND:
861 {
862 if (HIWORD(wParam) == LBN_SELCHANGE /* || CBN_SELCHANGE */)
863 {
864 switch (LOWORD(wParam))
865 {
867 {
868 /* Change the property sheet state only if the font has really changed */
869 if (FontTypeChange(hDlg, SizeList, ConInfo))
870 PropSheet_Changed(GetParent(hDlg), hDlg);
871 break;
872 }
873
876 {
877 /* Change the property sheet state only if the font has really changed */
878 if (FontSizeChange(hDlg, SizeList, ConInfo))
879 PropSheet_Changed(GetParent(hDlg), hDlg);
880 break;
881 }
882 }
883 }
884 /* NOTE: CBN_EDITUPDATE is sent first, and is followed by CBN_EDITCHANGE */
886 {
887 ULONG FontSize;
888 PWCHAR pszNext = NULL;
889 WCHAR szFontSize[100];
890 WCHAR szMessage[260];
891
892 /* Read the ComboBox edit string, as the user has entered a custom size */
893 GetWindowTextW(SizeList->hWndTTSizeList, szFontSize, ARRAYSIZE(szFontSize));
894
895 /* Validate the font size */
896 FontSize = wcstoul(szFontSize, &pszNext, 10);
897 if ((FontSize == 0) || (*pszNext))
898 {
899 // FIXME: Localize!
900 StringCchPrintfW(szMessage, ARRAYSIZE(szMessage), L"\"%s\" is not a valid font size.", szFontSize);
901 MessageBoxW(hDlg, szMessage, L"Error", MB_ICONINFORMATION | MB_OK);
902 }
903 SizeList->bIsTTSizeDirty = TRUE;
904 }
906 {
907 /* Change the property sheet state only if the font has really changed */
908 if (FontSizeChange(hDlg, SizeList, ConInfo))
909 PropSheet_Changed(GetParent(hDlg), hDlg);
910 }
911 else
912 if (HIWORD(wParam) == BN_CLICKED)
913 {
914 switch (LOWORD(wParam))
915 {
917 {
920 else
922
923 FontTypeChange(hDlg, SizeList, ConInfo);
924 PropSheet_Changed(GetParent(hDlg), hDlg);
925 break;
926 }
927
930 {
932
933 /* The call is valid only for TrueType fonts */
935 break;
936
937 /* Change the property sheet state only if the font has really changed */
938 if (FontSizeChange(hDlg, SizeList, ConInfo))
939 PropSheet_Changed(GetParent(hDlg), hDlg);
940 break;
941 }
942 }
943 }
944
945 break;
946 }
947
948 default:
949 break;
950 }
951
952 return FALSE;
953}
#define DPRINT1
Definition: precomp.h:8
static DWORD CurrentFontType
Definition: font.c:45
static VOID FaceNameList_Initialize(IN HWND hWndList, IN UINT CodePage)
Definition: font.c:398
static UINT CurrentCodePage
Definition: font.c:48
static VOID FaceNameList_SelectFont(IN HWND hDlg, IN HWND hWndList, IN PFONTSIZE_LIST_CTL SizeList, IN LPCWSTR FaceName, IN ULONG FontFamily, IN ULONG FontWeight, IN COORD FontSize)
Definition: font.c:440
struct _FONTSIZE_LIST_CTL * PFONTSIZE_LIST_CTL
static VOID UpdateFontSizeList(IN HWND hDlg, IN PFONTSIZE_LIST_CTL SizeList)
Definition: font.c:477
static BOOL FontSizeChange(IN HWND hDlg, IN PFONTSIZE_LIST_CTL SizeList, IN OUT PCONSOLE_STATE_INFO pConInfo)
Definition: font.c:656
static ULONG_PTR RasterSizeList_GetData(IN PLIST_CTL ListCtl, IN INT Index)
Definition: font.c:91
static BOOL FontTypeChange(IN HWND hDlg, IN PFONTSIZE_LIST_CTL SizeList, IN OUT PCONSOLE_STATE_INFO pConInfo)
Definition: font.c:542
static INT RasterSizeList_GetCount(IN PLIST_CTL ListCtl)
Definition: font.c:83
#define IDC_RADIO_PIXEL_UNIT
Definition: resource.h:44
#define IDC_LBOX_FONTTYPE
Definition: resource.h:47
#define IDC_STATIC_FONT_WINDOW_PREVIEW
Definition: resource.h:46
#define IDC_CHECK_BOLD_FONTS
Definition: resource.h:38
#define IDC_CBOX_FONTSIZE
Definition: resource.h:43
#define IDC_RADIO_POINT_UNIT
Definition: resource.h:45
#define IDC_STATIC_SELECT_FONT_PREVIEW
Definition: resource.h:39
#define IDC_LBOX_FONTSIZE
Definition: resource.h:42
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
_Check_return_ unsigned long __cdecl wcstoul(_In_z_ const wchar_t *_Str, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr, _In_ int _Radix)
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define L(x)
Definition: ntvdm.h:50
#define PSN_SETACTIVE
Definition: prsht.h:115
STRSAFEAPI StringCchPrintfW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszFormat,...)
Definition: strsafe.h:530
WCHAR FaceName[LF_FACESIZE]
Definition: settings.h:39
LIST_CTL RasterSizeList
Definition: font.c:34
BOOL UseRasterOrTTList
Definition: font.c:37
HWND hWndTTSizeList
Definition: font.c:35
BOOL bIsTTSizeDirty
Definition: font.c:36
BOOL TTSizePixelUnit
Definition: font.c:38
PLIST_GETCOUNT GetCount
Definition: console.h:94
PLIST_GETDATA GetData
Definition: console.h:95
HWND hWndList
Definition: console.h:93
uint16_t * PWCHAR
Definition: typedefs.h:56
uint32_t ULONG
Definition: typedefs.h:59
int WINAPI GetWindowTextW(HWND hWnd, LPWSTR lpString, int nMaxCount)
Definition: window.c:1412
#define FW_BOLD
Definition: wingdi.h:378
#define TRUETYPE_FONTTYPE
Definition: wingdi.h:1109
#define FW_NORMAL
Definition: wingdi.h:373
#define DWLP_USER
Definition: winuser.h:872
#define GetWindowLongPtrW
Definition: winuser.h:4829
int WINAPI MessageBoxW(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType)
#define CBN_EDITUPDATE
Definition: winuser.h:1976
#define CBN_KILLFOCUS
Definition: winuser.h:1978
#define MB_OK
Definition: winuser.h:790
#define LBN_SELCHANGE
Definition: winuser.h:2075
#define MB_ICONINFORMATION
Definition: winuser.h:802
#define WM_DESTROY
Definition: winuser.h:1609
#define WM_FONTCHANGE
Definition: winuser.h:1633
#define SetWindowLongPtrW
Definition: winuser.h:5346
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by InitApplet().

◆ InitApplet()

static LONG APIENTRY InitApplet ( HANDLE  hSectionOrWnd)
static

Definition at line 156 of file console.c.

157{
159 PCONSOLE_STATE_INFO pSharedInfo = NULL;
161 PROPSHEETPAGEW psp[4];
163 INT i = 0;
164
165 /*
166 * Because of Windows compatibility, we need to behave the same concerning
167 * information sharing with CONSRV. For some obscure reason the designers
168 * decided to use the CPlApplet hWnd parameter as being either a handle to
169 * the applet's parent caller's window (in case we ask for displaying
170 * the global console settings), or a handle to a shared section holding
171 * a CONSOLE_STATE_INFO structure (they don't use the extra l/wParams).
172 */
173
174 /*
175 * Try to open the shared section via the handle parameter. If we succeed,
176 * it means we were called by CONSRV for retrieving/setting parameters for
177 * a given console. If we fail, it means we are retrieving/setting default
178 * global parameters (and we were either called by CONSRV or directly by
179 * the user via the Control Panel, etc...)
180 */
181 pSharedInfo = MapViewOfFile(hSectionOrWnd, FILE_MAP_READ, 0, 0, 0);
182 if (pSharedInfo != NULL)
183 {
184 /*
185 * We succeeded. We were called by CONSRV and are retrieving
186 * parameters for a given console.
187 */
188
189 /* Copy the shared data into our allocated buffer */
190 DPRINT1("pSharedInfo->cbSize == %lu ; sizeof(CONSOLE_STATE_INFO) == %u\n",
191 pSharedInfo->cbSize, sizeof(CONSOLE_STATE_INFO));
192 ASSERT(pSharedInfo->cbSize >= sizeof(CONSOLE_STATE_INFO));
193
194 /* Allocate a local buffer to hold console information */
197 pSharedInfo->cbSize);
198 if (ConInfo)
199 RtlCopyMemory(ConInfo, pSharedInfo, pSharedInfo->cbSize);
200
201 /* Close the section */
202 UnmapViewOfFile(pSharedInfo);
203 CloseHandle(hSectionOrWnd);
204
205 if (!ConInfo) return 0;
206 }
207 else
208 {
209 /*
210 * We failed. We are retrieving the default global parameters.
211 */
212
213 /* Allocate a local buffer to hold console information */
216 sizeof(CONSOLE_STATE_INFO));
217 if (!ConInfo) return 0;
218
219 /*
220 * Setting the console window handle to NULL indicates we are
221 * retrieving/setting the default console parameters.
222 */
223 ConInfo->hWnd = NULL;
225
226 /* Use defaults */
228 }
229
230 /* Initialize the font support -- additional TrueType font cache and current preview font */
233
234 /* Initialize the property sheet structure */
235 ZeroMemory(&psh, sizeof(psh));
236 psh.dwSize = sizeof(psh);
238
240 {
242 psh.pszCaption = szTitle;
243 }
244 else
245 {
247 }
248
249 if (pSharedInfo != NULL)
250 {
251 /* We were started from a console window: this is our parent (or ConInfo->hWnd is NULL) */
252 psh.hwndParent = ConInfo->hWnd;
253 }
254 else
255 {
256 /* We were started in another way (--> default parameters). Caller's window is our parent. */
257 psh.hwndParent = (HWND)hSectionOrWnd;
258 }
259
260 psh.hInstance = hApplet;
261 // psh.hIcon = LoadIcon(hApplet, MAKEINTRESOURCEW(IDC_CPLICON));
263 psh.nPages = ARRAYSIZE(psp);
264 psh.nStartPage = 0;
265 psh.ppsp = psp;
267
272
273 /* Display the property sheet */
275 Result = PropertySheetW(&psh);
277
278 /* Clear the font support */
281
282 /* Apply the console settings if necessary */
283 if (SetConsoleInfo)
284 {
286
287 /*
288 * Create a memory section to share with CONSRV, and map it.
289 */
291 NULL,
293 0,
295 NULL);
296 if (!hSection)
297 {
298 DPRINT1("Error when creating file mapping, error = %d\n", GetLastError());
299 goto Quit;
300 }
301
302 pSharedInfo = MapViewOfFile(hSection, FILE_MAP_ALL_ACCESS, 0, 0, 0);
303 if (!pSharedInfo)
304 {
305 DPRINT1("Error when mapping view of file, error = %d\n", GetLastError());
307 goto Quit;
308 }
309
310 /* Copy the console information into the section and unmap it */
311 RtlCopyMemory(pSharedInfo, ConInfo, ConInfo->cbSize);
312 UnmapViewOfFile(pSharedInfo);
313
314 /*
315 * Signal to CONSRV that it can apply the new settings.
316 *
317 * NOTE: SetConsoleInfo set to TRUE by ApplyConsoleInfo()
318 * *only* when ConInfo->hWnd != NULL and the user did not
319 * press IDCANCEL in the confirmation dialog.
320 */
323
324 /* Close the section and return */
326 }
327
328 /* Save the console settings */
329 if (SaveConsoleInfo)
330 {
331 /* Default settings saved when ConInfo->hWnd == NULL */
333 }
334
335Quit:
336 /* Cleanup */
338 ConInfo = NULL;
339
340 return (Result != -1);
341}
INT_PTR CALLBACK FontProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: font.c:725
static VOID InitPropSheetPage(PROPSHEETPAGEW *psp, WORD idDlg, DLGPROC DlgProc)
Definition: console.c:29
static VOID InitDefaultConsoleInfo(PCONSOLE_STATE_INFO pConInfo)
Definition: console.c:43
static int CALLBACK PropSheetProc(HWND hwndDlg, UINT uMsg, LPARAM lParam)
Definition: console.c:137
INT_PTR CALLBACK ColorsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: colors.c:37
INT_PTR CALLBACK OptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: magnifier.c:860
INT_PTR CALLBACK LayoutProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: layout.c:525
BOOL UnRegisterWinPrevClass(IN HINSTANCE hInstance)
Definition: layout.c:52
FONT_PREVIEW FontPreview
Definition: font.c:21
VOID RefreshFontPreview(IN FONT_PREVIEW *Preview, IN PCONSOLE_STATE_INFO pConInfo)
Definition: font.c:52
BOOL RegisterWinPrevClass(IN HINSTANCE hInstance)
Definition: layout.c:32
#define ResetFontPreview(Preview)
Definition: console.h:65
#define IDD_PROPPAGEFONT
Definition: resource.h:13
#define IDD_PROPPAGECOLORS
Definition: resource.h:15
#define IDD_PROPPAGEOPTIONS
Definition: resource.h:12
#define IDD_PROPPAGELAYOUT
Definition: resource.h:14
INT_PTR WINAPI PropertySheetW(LPCPROPSHEETHEADERW lppsh)
Definition: propsheet.c:2913
#define CloseHandle
Definition: compat.h:739
#define UnmapViewOfFile
Definition: compat.h:746
HANDLE HWND
Definition: compat.h:19
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define CreateFileMappingW(a, b, c, d, e, f)
Definition: compat.h:744
#define MAX_PATH
Definition: compat.h:34
#define FILE_MAP_READ
Definition: compat.h:776
#define MapViewOfFile
Definition: compat.h:745
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
TCHAR szTitle[MAX_LOADSTRING]
Definition: magnifier.c:35
#define ASSERT(a)
Definition: mode.c:44
#define PAGE_READWRITE
Definition: nt_native.h:1304
#define UNICODE_NULL
#define PSH_PROPTITLE
Definition: prsht.h:40
#define PSH_USECALLBACK
Definition: prsht.h:48
#define PSH_PROPSHEETPAGE
Definition: prsht.h:43
#define PSH_USEICONID
Definition: prsht.h:42
#define PSH_NOAPPLYNOW
Definition: prsht.h:47
WCHAR ConsoleTitle[ANYSIZE_ARRAY]
Definition: settings.h:58
LPCPROPSHEETPAGEW ppsp
Definition: prsht.h:308
HINSTANCE hInstance
Definition: prsht.h:296
DWORD dwSize
Definition: prsht.h:293
DWORD dwFlags
Definition: prsht.h:294
LPCWSTR pszIcon
Definition: prsht.h:299
HWND hwndParent
Definition: prsht.h:295
PFNPROPSHEETCALLBACK pfnCallback
Definition: prsht.h:311
UINT nStartPage
Definition: prsht.h:304
LPCWSTR pszCaption
Definition: prsht.h:301
int32_t INT
Definition: typedefs.h:58
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
VOID InitTTFontCache(VOID)
Initializes the console TrueType font cache.
Definition: font.c:1013
VOID ClearTTFontCache(VOID)
Clears the console TrueType font cache.
Definition: font.c:1131
BOOLEAN ConCfgWriteUserSettings(IN PCONSOLE_STATE_INFO ConsoleInfo, IN BOOLEAN DefaultSettings)
Definition: settings.c:344
#define WM_SETCONSOLEINFO
Definition: settings.h:21
#define ZeroMemory
Definition: winbase.h:1712
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define FILE_MAP_ALL_ACCESS
Definition: winbase.h:156
UINT_PTR WPARAM
Definition: windef.h:207
_In_ const BITMAPINFO _In_ UINT _In_opt_ HANDLE hSection
Definition: wingdi.h:3239
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:409

Referenced by CPlApplet().

◆ InitDefaultConsoleInfo()

static VOID InitDefaultConsoleInfo ( PCONSOLE_STATE_INFO  pConInfo)
static

Definition at line 43 of file console.c.

44{
45 // FIXME: Also retrieve the value of REG_DWORD CurrentPage.
47}
VOID ConCfgGetDefaultSettings(IN OUT PCONSOLE_STATE_INFO ConsoleInfo)
Definition: settings.c:491

Referenced by InitApplet().

◆ InitPropSheetPage()

static VOID InitPropSheetPage ( PROPSHEETPAGEW psp,
WORD  idDlg,
DLGPROC  DlgProc 
)
static

Definition at line 29 of file console.c.

32{
33 ZeroMemory(psp, sizeof(*psp));
34 psp->dwSize = sizeof(*psp);
35 psp->dwFlags = PSP_DEFAULT;
36 psp->hInstance = hApplet;
38 psp->pfnDlgProc = DlgProc;
39 psp->lParam = 0;
40}
WORD idDlg
Definition: desk.c:121
DLGPROC DlgProc
Definition: desk.c:122
#define PSP_DEFAULT
Definition: prsht.h:22
DLGPROC pfnDlgProc
Definition: prsht.h:226
DWORD dwSize
Definition: prsht.h:214
DWORD dwFlags
Definition: prsht.h:215
LPARAM lParam
Definition: prsht.h:227
LPCWSTR pszTemplate
Definition: prsht.h:218
HINSTANCE hInstance
Definition: prsht.h:216

Referenced by InitApplet().

◆ LayoutProc()

INT_PTR CALLBACK LayoutProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 525 of file layout.c.

529{
530 switch (uMsg)
531 {
532 case WM_INITDIALOG:
533 {
534 /* Multi-monitor support */
535 LONG xVirtScr, yVirtScr; // Coordinates of the top-left virtual screen
536 LONG cxVirtScr, cyVirtScr; // Width and Height of the virtual screen
537 LONG cxFrame , cyFrame ; // Thickness of the window frame
538
543 cxFrame = GetSystemMetrics(SM_CXFRAME);
544 cyFrame = GetSystemMetrics(SM_CYFRAME);
545
550
555
557 (LPARAM)MAKELONG(xVirtScr + cxVirtScr - cxFrame, xVirtScr - cxFrame));
559 (LPARAM)MAKELONG(yVirtScr + cyVirtScr - cyFrame, yVirtScr - cyFrame));
560
563
565 {
570 }
573
574 return TRUE;
575 }
576
577 case WM_DISPLAYCHANGE:
578 {
579 /* Retransmit to the preview window */
581 WM_DISPLAYCHANGE, wParam, lParam);
582 break;
583 }
584
585 case WM_NOTIFY:
586 {
588
589 if (lppsn->hdr.code == UDN_DELTAPOS)
590 {
591 LPNMUPDOWN lpnmud = (LPNMUPDOWN)lParam;
592 DWORD wheight, wwidth;
593 DWORD sheight, swidth;
594 DWORD left, top;
595
597 {
598 wwidth = lpnmud->iPos + lpnmud->iDelta;
599 }
600 else
601 {
603 }
604
606 {
607 wheight = lpnmud->iPos + lpnmud->iDelta;
608 }
609 else
610 {
612 }
613
615 {
616 swidth = lpnmud->iPos + lpnmud->iDelta;
617 }
618 else
619 {
621 }
622
624 {
625 sheight = lpnmud->iPos + lpnmud->iDelta;
626 }
627 else
628 {
630 }
631
633 {
634 left = lpnmud->iPos + lpnmud->iDelta;
635 }
636 else
637 {
639 }
640
642 {
643 top = lpnmud->iPos + lpnmud->iDelta;
644 }
645 else
646 {
648 }
649
651 {
652 /* Automatically adjust screen buffer size when window size enlarges */
653 if (wwidth >= swidth)
654 {
656 swidth = wwidth;
657 }
658 if (wheight >= sheight)
659 {
661 sheight = wheight;
662 }
663 }
664
665 /* Be sure that the (new) screen buffer sizes are in the correct range */
666 swidth = min(max(swidth , 1), 0xFFFF);
667 sheight = min(max(sheight, 1), 0xFFFF);
668
670 {
671 /* Automatically adjust window size when screen buffer decreases */
672 if (wwidth > swidth)
673 {
675 wwidth = swidth;
676 }
677 if (wheight > sheight)
678 {
680 wheight = sheight;
681 }
682 }
683
684 ConInfo->ScreenBufferSize.X = (SHORT)swidth;
685 ConInfo->ScreenBufferSize.Y = (SHORT)sheight;
686 ConInfo->WindowSize.X = (SHORT)wwidth;
687 ConInfo->WindowSize.Y = (SHORT)wheight;
690
692 PropSheet_Changed(GetParent(hDlg), hDlg);
693 }
694 break;
695 }
696
697 case WM_COMMAND:
698 {
699 if (HIWORD(wParam) == EN_KILLFOCUS)
700 {
701 switch (LOWORD(wParam))
702 {
704 {
705 DWORD swidth, wwidth;
706
709
710 /* Be sure that the (new) screen buffer width is in the correct range */
711 swidth = min(max(swidth, 1), 0xFFFF);
712
713 /* Automatically adjust window size when screen buffer decreases */
714 if (wwidth > swidth)
715 {
716 wwidth = swidth;
718 }
719
720 ConInfo->ScreenBufferSize.X = (SHORT)swidth;
721 ConInfo->WindowSize.X = (SHORT)wwidth;
722
724 PropSheet_Changed(GetParent(hDlg), hDlg);
725 break;
726 }
727
729 {
730 DWORD swidth, wwidth;
731
734
735 /* Automatically adjust screen buffer size when window size enlarges */
736 if (wwidth >= swidth)
737 {
738 swidth = wwidth;
739
740 /* Be sure that the (new) screen buffer width is in the correct range */
741 swidth = min(max(swidth, 1), 0xFFFF);
742
744 }
745
746 ConInfo->ScreenBufferSize.X = (SHORT)swidth;
747 ConInfo->WindowSize.X = (SHORT)wwidth;
748
750 PropSheet_Changed(GetParent(hDlg), hDlg);
751 break;
752 }
753
755 {
756 DWORD sheight, wheight;
757
760
761 /* Be sure that the (new) screen buffer width is in the correct range */
762 sheight = min(max(sheight, 1), 0xFFFF);
763
764 /* Automatically adjust window size when screen buffer decreases */
765 if (wheight > sheight)
766 {
767 wheight = sheight;
769 }
770
771 ConInfo->ScreenBufferSize.Y = (SHORT)sheight;
772 ConInfo->WindowSize.Y = (SHORT)wheight;
773
775 PropSheet_Changed(GetParent(hDlg), hDlg);
776 break;
777 }
778
780 {
781 DWORD sheight, wheight;
782
785
786 /* Automatically adjust screen buffer size when window size enlarges */
787 if (wheight >= sheight)
788 {
789 sheight = wheight;
790
791 /* Be sure that the (new) screen buffer width is in the correct range */
792 sheight = min(max(sheight, 1), 0xFFFF);
793
795 }
796
797 ConInfo->ScreenBufferSize.Y = (SHORT)sheight;
798 ConInfo->WindowSize.Y = (SHORT)wheight;
799
801 PropSheet_Changed(GetParent(hDlg), hDlg);
802 break;
803 }
804
807 {
810
812 PropSheet_Changed(GetParent(hDlg), hDlg);
813 break;
814 }
815 }
816 }
817 else
818 if (HIWORD(wParam) == BN_CLICKED &&
820 {
822 {
827
829 // Do not touch ConInfo->WindowPosition !!
830
832 PropSheet_Changed(GetParent(hDlg), hDlg);
833 }
834 else
835 {
836 ULONG left, top;
837
840
845
849
851 PropSheet_Changed(GetParent(hDlg), hDlg);
852 }
853 }
854
855 break;
856 }
857
858 default:
859 break;
860 }
861
862 return FALSE;
863}
#define IDC_CHECK_SYSTEM_POS_WINDOW
Definition: resource.h:63
#define IDC_EDIT_WINDOW_SIZE_WIDTH
Definition: resource.h:55
#define IDC_UPDOWN_WINDOW_SIZE_WIDTH
Definition: resource.h:56
#define IDC_EDIT_WINDOW_POS_LEFT
Definition: resource.h:59
#define IDC_UPDOWN_WINDOW_SIZE_HEIGHT
Definition: resource.h:58
#define IDC_STATIC_LAYOUT_WINDOW_PREVIEW
Definition: resource.h:64
#define IDC_EDIT_WINDOW_POS_TOP
Definition: resource.h:61
#define IDC_UPDOWN_SCREEN_BUFFER_WIDTH
Definition: resource.h:51
#define IDC_UPDOWN_SCREEN_BUFFER_HEIGHT
Definition: resource.h:54
#define IDC_EDIT_SCREEN_BUFFER_HEIGHT
Definition: resource.h:53
#define IDC_EDIT_SCREEN_BUFFER_WIDTH
Definition: resource.h:52
#define IDC_EDIT_WINDOW_SIZE_HEIGHT
Definition: resource.h:57
#define IDC_UPDOWN_WINDOW_POS_LEFT
Definition: resource.h:60
#define IDC_UPDOWN_WINDOW_POS_TOP
Definition: resource.h:62
#define EnableDlgItem(hDlg, nID, bEnable)
Definition: eventvwr.h:55
GLdouble GLdouble GLdouble GLdouble top
Definition: glext.h:10859
GLint left
Definition: glext.h:7726
short SHORT
Definition: pedump.c:59
long LONG
Definition: pedump.c:60
struct _PSHNOTIFY * LPPSHNOTIFY
COORD ScreenBufferSize
Definition: settings.h:32
POINT WindowPosition
Definition: settings.h:34
ULONG Y
Definition: bl.h:1340
ULONG X
Definition: bl.h:1339
NMHDR hdr
Definition: prsht.h:330
UINT code
Definition: winuser.h:3159
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
#define SM_CYVIRTUALSCREEN
Definition: winuser.h:1039
#define BST_UNCHECKED
Definition: winuser.h:199
#define SM_CXFRAME
Definition: winuser.h:994
#define SM_CYFRAME
Definition: winuser.h:996
#define SM_CXVIRTUALSCREEN
Definition: winuser.h:1038
#define SM_XVIRTUALSCREEN
Definition: winuser.h:1036
int WINAPI GetSystemMetrics(_In_ int)
#define SM_YVIRTUALSCREEN
Definition: winuser.h:1037

Referenced by InitApplet().

◆ OptionsProc()

INT_PTR CALLBACK OptionsProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 860 of file magnifier.c.

861{
863
864 switch (message)
865 {
866 case WM_INITDIALOG:
867 {
868 /* Add the zoom items */
878
879 if (uiZoom >= 1 && uiZoom <= 9)
881
882 if (bFollowMouse)
884
885 if (bFollowFocus)
887
888 if (bFollowCaret)
890
891 if (bInvertColors)
893
894 if (bStartMinimized)
896
897 if (bShowMagnifier)
899
900 return (INT_PTR)TRUE;
901 }
902
903 case WM_SHOWWINDOW:
905 break;
906
907 case WM_COMMAND:
908 switch (LOWORD(wParam))
909 {
910 case IDOK:
911 case IDCANCEL:
912 ShowWindow(hDlg, SW_HIDE);
913 return (INT_PTR)TRUE;
914
915 case IDC_BUTTON_HELP:
916 /* Unimplemented */
917 MessageBox(hDlg, TEXT("Magnifier help not available yet!"), TEXT("Help"), MB_OK);
918 break;
919
920 case IDC_ZOOM:
922 {
923 HWND hCombo = GetDlgItem(hDlg,IDC_ZOOM);
924 TCHAR currentZoomValue[2] = TEXT("");
925
926 /* Get index of current selection and the text of that selection */
927 int currentSelectionIndex = ComboBox_GetCurSel(hCombo);
928 ComboBox_GetLBText(hCombo, currentSelectionIndex, currentZoomValue);
929 uiZoom = (UINT)_ttoi(currentZoomValue);
930 /* The zoom factor cannot be smaller than 1 (and not zero) or greater than 9 */
931 if (uiZoom < 1 || uiZoom > 9)
932 uiZoom = 1;
933
934 /* Trigger the Draw function to rezoom (which will be set false automatically after rezooming) */
936
937 /* Update the magnifier UI */
938 Refresh();
939 }
940 break;
941
944 Refresh();
945 break;
948 break;
951 break;
954 break;
957 break;
961 break;
962 }
963 }
964
965 return (INT_PTR)FALSE;
966}
#define IDC_BUTTON_HELP
Definition: resource.h:17
#define IDC_INVERTCOLORSCHECK
Definition: resource.h:19
#define IDC_SHOWMAGNIFIERCHECK
Definition: resource.h:22
#define IDC_FOLLOWKEYBOARDCHECK
Definition: resource.h:17
#define IDC_SHOWMAGNIFIER
Definition: resource.h:21
#define IDC_FOLLOWTEXTEDITINGCHECK
Definition: resource.h:18
#define IDC_FOLLOWMOUSECHECK
Definition: resource.h:23
#define IDC_ZOOM
Definition: resource.h:16
#define IDC_STARTMINIMIZEDCHECK
Definition: resource.h:20
#define TEXT(s)
Definition: k32.h:26
BOOL bOptionsDialog
Definition: magnifier.c:48
void Refresh(void)
Definition: magnifier.c:317
HWND hMainWnd
Definition: magnifier.c:32
BOOL bRecreateOffscreenDC
Definition: magnifier.c:49
BOOL bFollowFocus
Definition: settings.c:19
UINT uiZoom
Definition: settings.c:14
BOOL bInvertColors
Definition: settings.c:22
BOOL bShowMagnifier
Definition: settings.c:24
BOOL bFollowCaret
Definition: settings.c:20
BOOL bFollowMouse
Definition: settings.c:18
BOOL bStartMinimized
Definition: settings.c:23
unsigned int UINT
Definition: ndis.h:50
Definition: tftpd.h:60
#define ComboBox_GetLBText(hwndCtl, index, lpszBuffer)
Definition: windowsx.h:56
#define ComboBox_GetCurSel(hwndCtl)
Definition: windowsx.h:49
#define SW_HIDE
Definition: winuser.h:768
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define CB_SETCURSEL
Definition: winuser.h:1961
#define CBN_SELCHANGE
Definition: winuser.h:1979
#define BM_SETCHECK
Definition: winuser.h:1921
#define WM_SHOWWINDOW
Definition: winuser.h:1628
#define CB_ADDSTRING
Definition: winuser.h:1936
#define MessageBox
Definition: winuser.h:5822
#define SW_SHOW
Definition: winuser.h:775
#define SendDlgItemMessage
Definition: winuser.h:5842
char TCHAR
Definition: xmlstorage.h:189
#define _ttoi
Definition: xmlstorage.h:195

Referenced by InitApplet(), and InitInstance().

◆ PropSheetProc()

static int CALLBACK PropSheetProc ( HWND  hwndDlg,
UINT  uMsg,
LPARAM  lParam 
)
static

Definition at line 137 of file console.c.

138{
139 // NOTE: This callback is needed to set large icon correctly.
140 HICON hIcon;
141 switch (uMsg)
142 {
143 case PSCB_INITIALIZED:
144 {
146 SendMessageW(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)hIcon);
147 break;
148 }
149 }
150 return 0;
151}
static HICON
Definition: imagelist.c:84
HICON hIcon
Definition: msconfig.c:44
#define PSCB_INITIALIZED
Definition: prsht.h:75
#define ICON_BIG
Definition: tnclass.cpp:51
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE hInstance, _In_ LPCWSTR lpIconName)
Definition: cursoricon.c:2075

Referenced by InitApplet().

Variable Documentation

◆ ConInfo

◆ hApplet

HINSTANCE hApplet = NULL

Definition at line 20 of file console.c.

Referenced by ApplyConsoleInfo(), DllMain(), InitApplet(), InitPropSheetPage(), and PropSheetProc().

◆ SaveConsoleInfo

BOOL SaveConsoleInfo = FALSE
static

Definition at line 26 of file console.c.

Referenced by ApplyConsoleInfo(), and InitApplet().

◆ SetConsoleInfo

BOOL SetConsoleInfo = FALSE
static

Definition at line 25 of file console.c.

Referenced by ApplyConsoleInfo(), and InitApplet().