[CALC] Add theming support, requires Windows XP or later. CORE-13343
[reactos.git] / base / applications / calc / calc.h
index 702ad47..f6c2c7c 100644 (file)
@@ -1,10 +1,14 @@
-#ifndef _CALC_H
-#define _CALC_H
+#ifndef __CALC_H__
+#define __CALC_H__
 
-#include <stdarg.h>
-#include <windef.h>
-#include <winuser.h>
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
 #include <tchar.h>
+#include <commctrl.h>
+#include <shellapi.h>
+
+#include <stdio.h>
+#include <string.h>
 #include <math.h>
 #include <float.h>
 #include <malloc.h>
@@ -13,6 +17,9 @@
 #endif
 #include <limits.h>
 
+/* RESOURCES */
+#include "resource.h"
+
 /* Messages reserved for the main dialog */
 #define WM_CLOSE_STATS      (WM_APP+1)
 #define WM_HANDLE_CLIPBOARD (WM_APP+2)
 
 #endif
 
-#include "resource.h"
+#define CALC_VERSION        _T("1.12")
+
+#define MAX_CALC_SIZE       256
+
+/* HTMLHELP SUPPORT */
+typedef HWND (WINAPI* type_HtmlHelpA)(HWND, LPCSTR, UINT, DWORD);
+typedef HWND (WINAPI* type_HtmlHelpW)(HWND, LPCWSTR, UINT, DWORD);
+
+extern type_HtmlHelpA calc_HtmlHelpA;
+extern type_HtmlHelpW calc_HtmlHelpW;
 
-#ifndef IDC_STATIC
-#define IDC_STATIC  ((DWORD)-1)
+#ifndef UNICODE
+#define calc_HtmlHelp   calc_HtmlHelpA
+#else
+#define calc_HtmlHelp   calc_HtmlHelpW
 #endif
 
-#define MAX_CALC_SIZE       256
+void HtmlHelp_Start(HINSTANCE hInstance);
+void HtmlHelp_Stop(void);
+
+/* THEMING SUPPORT */
+#if (_WIN32_WINNT >= 0x0600)
+#include <vssym32.h>
+#include <vsstyle.h>
+#else
+#include <tmschema.h>
+#endif
+#include <uxtheme.h>
+
+void Theme_Start(HINSTANCE hInstance);
+void Theme_Stop(void);
+
+typedef HTHEME   (WINAPI* type_OpenThemeData)(HWND,const WCHAR*);
+typedef HRESULT  (WINAPI* type_CloseThemeData)(HTHEME);
+typedef HRESULT  (WINAPI* type_DrawThemeBackground)(HTHEME,HDC,int,int,const RECT*,const RECT*);
+typedef BOOL     (WINAPI* type_IsAppThemed)(void);
+typedef BOOL     (WINAPI* type_IsThemeActive)(void);
+typedef BOOL     (WINAPI* type_IsThemeBackgroundPartiallyTransparent)(HTHEME, int, int);
+typedef HRESULT  (WINAPI* type_DrawThemeParentBackground)(HWND, HDC, RECT *);
+
+extern type_OpenThemeData                   calc_OpenThemeData;
+extern type_CloseThemeData                  calc_CloseThemeData;
+extern type_DrawThemeBackground             calc_DrawThemeBackground;
+extern type_IsAppThemed                     calc_IsAppThemed;
+extern type_IsThemeActive                   calc_IsThemeActive;
+extern type_IsThemeBackgroundPartiallyTransparent calc_IsThemeBackgroundPartiallyTransparent;
+extern type_DrawThemeParentBackground       calc_DrawThemeParentBackground;
 
 /*#define USE_KEYBOARD_HOOK*/
 
@@ -122,6 +169,8 @@ typedef struct {
     HHOOK         hKeyboardHook;
 #endif
     HWND          hWnd;
+    HICON         hBgIcon;
+    HICON         hSmIcon;
     DWORD         layout;
     TCHAR         buffer[MAX_CALC_SIZE];
     TCHAR         source[MAX_CALC_SIZE];
@@ -226,8 +275,10 @@ void convert_real_integer(unsigned int base);
 
 INT_PTR CALLBACK AboutDlgProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp);
 
+//
+
 void ConvExecute(HWND hWnd);
 void ConvAdjust(HWND hWnd, int n_cat);
 void ConvInit(HWND hWnd);
 
-#endif /* _CALC_H */
+#endif /* __CALC_H__ */