https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d1d9920b069513d4535bc5cf7c77da5c5e5298ee

commit d1d9920b069513d4535bc5cf7c77da5c5e5298ee
Author:     Eric Kohl <[email protected]>
AuthorDate: Sun Mar 15 15:10:14 2020 +0100
Commit:     Eric Kohl <[email protected]>
CommitDate: Sun Mar 15 15:10:14 2020 +0100

    [INPUT] Use APPLET_PROC instead of a custom CPLAPPLET_PROC and simpify the 
code
---
 dll/cpl/input/input.c | 12 ++++--------
 dll/cpl/input/input.h |  5 ++---
 2 files changed, 6 insertions(+), 11 deletions(-)

diff --git a/dll/cpl/input/input.c b/dll/cpl/input/input.c
index 1d566ed3620..1896eb8552a 100644
--- a/dll/cpl/input/input.c
+++ b/dll/cpl/input/input.c
@@ -10,14 +10,11 @@
 
 #include "input.h"
 
-#include <cpl.h>
-
 #define NUM_APPLETS    (1)
 
-static LONG CALLBACK SystemApplet(VOID);
+static LONG CALLBACK SystemApplet(HWND hwnd, UINT uMsg, LPARAM lParam1, LPARAM 
lParam2);
 
 HINSTANCE hApplet = NULL;
-static HWND hCPLWindow;
 
 /* Applets */
 static APPLET Applets[NUM_APPLETS] =
@@ -57,7 +54,7 @@ PropSheetProc(HWND hwndDlg, UINT uMsg, LPARAM lParam)
 
 /* First Applet */
 static LONG CALLBACK
-SystemApplet(VOID)
+SystemApplet(HWND hwnd, UINT uMsg, LPARAM lParam1, LPARAM lParam2)
 {
     PROPSHEETPAGEW page[2];
     PROPSHEETHEADERW header;
@@ -69,7 +66,7 @@ SystemApplet(VOID)
 
     header.dwSize      = sizeof(header);
     header.dwFlags     = PSH_PROPSHEETPAGE | PSH_USEICONID | PSH_USECALLBACK;
-    header.hwndParent  = hCPLWindow;
+    header.hwndParent  = hwnd;
     header.hInstance   = hApplet;
     header.pszIcon     = MAKEINTRESOURCEW(IDI_KEY_SHORT_ICO);
     header.pszCaption  = szCaption;
@@ -114,8 +111,7 @@ CPlApplet(HWND hwndCPl, UINT uMsg, LPARAM lParam1, LPARAM 
lParam2)
             break;
 
         case CPL_DBLCLK:
-            hCPLWindow = hwndCPl;
-            Applets[i].AppletProc();
+            Applets[i].AppletProc(hwndCPl, uMsg, lParam1, lParam2);
             break;
     }
 
diff --git a/dll/cpl/input/input.h b/dll/cpl/input/input.h
index 2ddd82f267a..f7ab1f47141 100644
--- a/dll/cpl/input/input.h
+++ b/dll/cpl/input/input.h
@@ -15,17 +15,16 @@
 #include <windowsx.h>
 #include <setupapi.h>
 #include <strsafe.h>
+#include <cpl.h>
 
 #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;
 
 extern HINSTANCE hApplet;

Reply via email to