xref: /reactos/dll/cpl/desk/desk.h (revision 5cadc268)
1 #ifndef _DESK_H
2 #define _DESK_H
3 
4 #include <stdarg.h>
5 
6 #define WIN32_NO_STATUS
7 #define _INC_WINDOWS
8 #define COM_NO_WINDOWS_H
9 
10 #define COBJMACROS
11 
12 #include <windef.h>
13 #include <winbase.h>
14 #include <winreg.h>
15 #include <wingdi.h>
16 #include <winuser.h>
17 #include <wincon.h>
18 #include <commdlg.h>
19 #include <cpl.h>
20 #include <tchar.h>
21 #include <setupapi.h>
22 #include <shlobj.h>
23 #include <regstr.h>
24 #include <dll/desk/deskcplx.h>
25 #include <strsafe.h>
26 #include <gdiplus.h>
27 
28 #include "appearance.h"
29 #include "preview.h"
30 #include "draw.h"
31 #include "monslctl.h"
32 
33 #include "resource.h"
34 
35 typedef struct _APPLET
36 {
37     int idIcon;
38     int idName;
39     int idDescription;
40     APPLET_PROC AppletProc;
41 } APPLET, *PAPPLET;
42 
43 typedef struct _DIBITMAP
44 {
45     BITMAPINFO       *info;
46     BYTE             *bits;
47     UINT              width;
48     UINT              height;
49 } DIBITMAP, *PDIBITMAP;
50 
51 extern HINSTANCE hApplet;
52 
53 HMENU
54 LoadPopupMenu(IN HINSTANCE hInstance,
55               IN LPCTSTR lpMenuName);
56 
57 PDIBITMAP DibLoadImage(LPTSTR lpFilename);
58 VOID DibFreeImage(PDIBITMAP lpBitmap);
59 
60 INT AllocAndLoadString(LPTSTR *lpTarget,
61                        HINSTANCE hInst,
62                        UINT uID);
63 
64 ULONG __cdecl DbgPrint(PCCH Format,...);
65 
66 #define MAX_DESK_PAGES        32
67 #define NUM_SPECTRUM_BITMAPS  3
68 
69 /* As slider control can't contain user data, we have to keep an
70  * array of RESOLUTION_INFO to have our own associated data.
71  */
72 typedef struct _RESOLUTION_INFO
73 {
74     DWORD dmPelsWidth;
75     DWORD dmPelsHeight;
76 } RESOLUTION_INFO, *PRESOLUTION_INFO;
77 
78 typedef struct _SETTINGS_ENTRY
79 {
80     struct _SETTINGS_ENTRY *Blink;
81     struct _SETTINGS_ENTRY *Flink;
82     DWORD dmBitsPerPel;
83     DWORD dmPelsWidth;
84     DWORD dmPelsHeight;
85     DWORD dmDisplayFrequency;
86 } SETTINGS_ENTRY, *PSETTINGS_ENTRY;
87 
88 typedef struct _DISPLAY_DEVICE_ENTRY
89 {
90     struct _DISPLAY_DEVICE_ENTRY *Flink;
91     LPTSTR DeviceDescription;
92     LPTSTR DeviceName;
93     LPTSTR DeviceKey;
94     LPTSTR DeviceID;
95     DWORD DeviceStateFlags;
96     PSETTINGS_ENTRY Settings; /* Sorted by increasing dmPelsHeight, BPP */
97     DWORD SettingsCount;
98     PRESOLUTION_INFO Resolutions;
99     DWORD ResolutionsCount;
100     PSETTINGS_ENTRY CurrentSettings; /* Points into Settings list */
101     SETTINGS_ENTRY InitialSettings;
102 } DISPLAY_DEVICE_ENTRY, *PDISPLAY_DEVICE_ENTRY;
103 
104 typedef struct _GLOBAL_DATA
105 {
106     COLORREF desktop_color;
107     LPCWSTR pwszFile;
108     LPCWSTR pwszAction;
109 } GLOBAL_DATA, *PGLOBAL_DATA;
110 
111 extern GLOBAL_DATA g_GlobalData;
112 extern HWND hCPLWindow;
113 
114 BOOL
115 DisplayAdvancedSettings(HWND hWndParent, PDISPLAY_DEVICE_ENTRY DisplayDevice);
116 
117 IDataObject *
118 CreateDevSettings(PDISPLAY_DEVICE_ENTRY DisplayDeviceInfo);
119 
120 HPSXA WINAPI SHCreatePropSheetExtArrayEx(HKEY,LPCWSTR,UINT,IDataObject*);
121 
122 INT_PTR CALLBACK
123 AdvGeneralPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
124 
125 BOOL
126 SwitchDisplayMode(HWND hwndDlg, PWSTR DeviceName, PSETTINGS_ENTRY seInit, PSETTINGS_ENTRY seNew, OUT PLONG rc);
127 
128 LONG
129 RegLoadMUIStringW(IN HKEY hKey,
130                   IN LPCWSTR pszValue  OPTIONAL,
131                   OUT LPWSTR pszOutBuf,
132                   IN DWORD cbOutBuf,
133                   OUT LPDWORD pcbData OPTIONAL,
134                   IN DWORD Flags,
135                   IN LPCWSTR pszDirectory  OPTIONAL);
136 
137 #endif /* _DESK_H */
138