https://git.reactos.org/?p=reactos.git;a=commitdiff;h=3ecbbd991f0c8022488ba…
commit 3ecbbd991f0c8022488ba5e4cd7f5d5c6eb43eb4
Author: Eric Kohl <eric.kohl(a)reactos.org>
AuthorDate: Sun Mar 15 18:12:54 2020 +0100
Commit: Eric Kohl <eric.kohl(a)reactos.org>
CommitDate: Sun Mar 15 18:12:54 2020 +0100
[JOY] Use APPLET_PROC instead of a custom CPLAPPLET_PROC and simpify the code
---
dll/cpl/joy/joy.c | 16 ++++++++--------
dll/cpl/joy/joy.h | 6 ++----
2 files changed, 10 insertions(+), 12 deletions(-)
diff --git a/dll/cpl/joy/joy.c b/dll/cpl/joy/joy.c
index 97c49ed547e..530a78d442c 100644
--- a/dll/cpl/joy/joy.c
+++ b/dll/cpl/joy/joy.c
@@ -30,9 +30,8 @@
#define NUM_APPLETS (1)
-LONG CALLBACK SystemApplet(VOID);
+LONG CALLBACK SystemApplet(HWND hwnd, UINT uMsg, LPARAM lParam1, LPARAM lParam2);
HINSTANCE hApplet = 0;
-HWND MainDlg;
/* Applets */
@@ -262,11 +261,15 @@ MainPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
/* First Applet */
LONG CALLBACK
-SystemApplet(VOID)
+SystemApplet(HWND hwnd, UINT uMsg, LPARAM lParam1, LPARAM lParam2)
{
+ UNREFERENCED_PARAMETER(uMsg);
+ UNREFERENCED_PARAMETER(lParam1);
+ UNREFERENCED_PARAMETER(lParam2);
+
DialogBox(hApplet,
MAKEINTRESOURCE(IDD_PROPPAGEMAIN),
- MainDlg,
+ hwnd,
MainPageProc);
return (LONG)TRUE;
@@ -299,10 +302,7 @@ CPlApplet(HWND hwndCPl, UINT uMsg, LPARAM lParam1, LPARAM lParam2)
break;
case CPL_DBLCLK:
- {
- MainDlg = hwndCPl;
- Applets[i].AppletProc();
- }
+ Applets[i].AppletProc(hwndCPl, uMsg, lParam1, lParam2);
break;
}
diff --git a/dll/cpl/joy/joy.h b/dll/cpl/joy/joy.h
index 42d5f6f4d89..7ede1e01539 100644
--- a/dll/cpl/joy/joy.h
+++ b/dll/cpl/joy/joy.h
@@ -12,14 +12,12 @@
#include "resource.h"
-typedef LONG (CALLBACK *CPLAPPLET_PROC)(VOID);
-
typedef struct
{
int idIcon;
int idName;
int idDescription;
- CPLAPPLET_PROC AppletProc;
+ APPLET_PROC AppletProc;
} APPLET, *PAPPLET;
typedef struct
@@ -28,7 +26,7 @@ typedef struct
WCHAR szWorkingDirectory[MAX_PATH];
WCHAR szDescription[MAX_PATH];
WCHAR szLinkName[MAX_PATH];
-}CREATE_LINK_CONTEXT, *PCREATE_LINK_CONTEXT;
+} CREATE_LINK_CONTEXT, *PCREATE_LINK_CONTEXT;
extern HINSTANCE hApplet;