xref: /reactos/base/applications/mstsc/precomp.h (revision 845faec4)
1 #ifndef _MSTSC_PCH_
2 #define _MSTSC_PCH_
3 
4 #include <stdarg.h>
5 
6 #define WIN32_NO_STATUS
7 #define _INC_WINDOWS
8 #define COM_NO_WINDOWS_H
9 
10 #include <windef.h>
11 #include <winbase.h>
12 #include <wingdi.h>
13 #include <wincon.h>
14 #include <shlobj.h>
15 #include <stdio.h>
16 #include <wincrypt.h>
17 
18 #include "rdesktop.h"
19 #include "resource.h"
20 
21 #ifndef __TODO_MSTSC_H
22 #define __TODO_MSTSC_H
23 
24 #define RDP_LOGON_NORMAL (RDP_INFO_MOUSE | RDP_INFO_DISABLECTRLALTDEL | RDP_INFO_UNICODE | RDP_INFO_MAXIMIZESHELL)
25 
26 #define IS_PERSISTENT(id) (id < 8 && g_pstcache_fd[id] > 0)
27 
28 #define MAXKEY 256
29 #define MAXVALUE 256
30 #define NUM_SETTINGS 6
31 extern LPWSTR lpSettings[];
32 
33 typedef struct _SETTINGS
34 {
35     WCHAR Key[MAXKEY];
36     WCHAR Type; // holds 'i' or 's'
37     union {
38         INT i;
39         WCHAR s[MAXVALUE];
40     } Value;
41 } SETTINGS, *PSETTINGS;
42 
43 typedef struct _RDPSETTINGS
44 {
45     PSETTINGS pSettings;
46     INT NumSettings;
47 } RDPSETTINGS, *PRDPSETTINGS;
48 
49 /* As slider control can't contain user data, we have to keep an
50  * array of RESOLUTION_INFO to have our own associated data.
51  */
52 typedef struct _RESOLUTION_INFO
53 {
54     DWORD dmPelsWidth;
55     DWORD dmPelsHeight;
56 } RESOLUTION_INFO, *PRESOLUTION_INFO;
57 
58 typedef struct _SETTINGS_ENTRY
59 {
60     struct _SETTINGS_ENTRY *Blink;
61     struct _SETTINGS_ENTRY *Flink;
62     DWORD dmBitsPerPel;
63     DWORD dmPelsWidth;
64     DWORD dmPelsHeight;
65 } SETTINGS_ENTRY, *PSETTINGS_ENTRY;
66 
67 typedef struct _DISPLAY_DEVICE_ENTRY
68 {
69     struct _DISPLAY_DEVICE_ENTRY *Flink;
70     LPWSTR DeviceDescription;
71     LPWSTR DeviceName;
72     LPWSTR DeviceKey;
73     LPWSTR DeviceID;
74     DWORD DeviceStateFlags;
75     PSETTINGS_ENTRY Settings; /* sorted by increasing dmPelsHeight, BPP */
76     DWORD SettingsCount;
77     PRESOLUTION_INFO Resolutions;
78     DWORD ResolutionsCount;
79     PSETTINGS_ENTRY CurrentSettings; /* Points into Settings list */
80     SETTINGS_ENTRY InitialSettings;
81 } DISPLAY_DEVICE_ENTRY, *PDISPLAY_DEVICE_ENTRY;
82 
83 typedef struct _INFO
84 {
85     PRDPSETTINGS pRdpSettings;
86     PDISPLAY_DEVICE_ENTRY DisplayDeviceList;
87     PDISPLAY_DEVICE_ENTRY CurrentDisplayDevice;
88     HWND hSelf;
89     HWND hTab;
90     HWND hGeneralPage;
91     HWND hDisplayPage;
92     HBITMAP hHeader;
93     BITMAP headerbitmap;
94     HICON hMstscSm;
95     HICON hMstscLg;
96     HICON hLogon;
97     HICON hConn;
98     HICON hRemote;
99     HICON hColor;
100     HBITMAP hSpectrum;
101     BITMAP bitmap;
102 } INFO, *PINFO;
103 
104 BOOL InitRdpSettings(PRDPSETTINGS pRdpSettings);
105 BOOL OpenRDPConnectDialog(HINSTANCE hInstance, PRDPSETTINGS pRdpSettings);
106 BOOL LoadRdpSettingsFromFile(PRDPSETTINGS pRdpSettings, LPWSTR lpFile);
107 BOOL SaveRdpSettingsToFile(LPWSTR lpFile, PRDPSETTINGS pRdpSettings);
108 INT GetIntegerFromSettings(PRDPSETTINGS pSettings, LPWSTR lpValue);
109 LPWSTR GetStringFromSettings(PRDPSETTINGS pSettings, LPWSTR lpValue);
110 BOOL SetIntegerToSettings(PRDPSETTINGS pRdpSettings, LPWSTR lpKey, INT Value);
111 BOOL SetStringToSettings(PRDPSETTINGS pRdpSettings, LPWSTR lpKey, LPWSTR lpValue);
112 VOID SaveAllSettings(PINFO pInfo);
113 
114 #endif /* __TODO_MSTSC_H */
115 
116 #endif /* _MSTSC_PCH_ */
117