Need help with control panel applet

All development related issues welcome

Moderator: Moderator Team

Post Reply
Pi_User5
Posts: 752
Joined: Thu May 01, 2014 4:18 am
Location: United States

Need help with control panel applet

Post by Pi_User5 »

So I am trying to add another page to a control panel applet. It currently only has one page. I add everything that I think I need and when I compile it, the second page renders on top of the first page. I tried looking at the other control panel applets and it appears I've done everything right. Any help would be nice Here's my patch file and my failed attempt:

[ external image ]

Code: Select all

Index: about.c
===================================================================
--- about.c	(revision 0)
+++ about.c	(working copy)
@@ -0,0 +1,22 @@
+#include "wined3dcfg.h"
+
+INT_PTR CALLBACK HelpPageProc(HWND hWndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
+{
+    switch (uMsg)
+    {
+        case WM_INITDIALOG:
+            
+            return TRUE;
+
+        case WM_COMMAND:
+            if (LOWORD(wParam) > IDC_MIN && LOWORD(wParam) < IDC_MAX)
+                PropSheet_Changed(GetParent(hWndDlg), hWndDlg);
+            break;
+
+        case WM_NOTIFY:
+
+            break;
+    }
+
+    return FALSE;
+}
\ No newline at end of file
Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt	(revision 68507)
+++ CMakeLists.txt	(working copy)
@@ -4,6 +4,7 @@
 list(APPEND SOURCE
     wined3dcfg.c
     general.c
+	about.c
     wined3dcfg.h)
 
 add_library(wined3dcfg SHARED
Index: lang/en-US.rc
===================================================================
--- lang/en-US.rc	(revision 68507)
+++ lang/en-US.rc	(working copy)
@@ -30,6 +30,14 @@
     COMBOBOX IDC_DDRENDERER, 135, 200, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST
 END
 
+IDD_HELPPAGE DIALOGEX 0, 0, 246, 228
+STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION
+CAPTION "Help"
+FONT 8, "MS Shell Dlg"
+BEGIN
+	GROUPBOX "About", -1, 5, 25, 230, 80
+END
+
 STRINGTABLE
 BEGIN
     IDS_CPLNAME "WineD3D Options"
Index: resource.h
===================================================================
--- resource.h	(revision 68507)
+++ resource.h	(working copy)
@@ -5,6 +5,7 @@
 
 /* Dialogs */
 #define IDD_PROPPAGEGENERAL 100
+#define IDD_HELPPAGE	    101
 
 /* Controls */
 #define IDC_MIN                1000
Index: wined3dcfg.c
===================================================================
--- wined3dcfg.c	(revision 68507)
+++ wined3dcfg.c	(working copy)
@@ -18,6 +18,13 @@
     psp.hInstance = hApplet;
     psp.pszTemplate = MAKEINTRESOURCE(IDD_PROPPAGEGENERAL);
     psp.pfnDlgProc = GeneralPageProc;
+	
+	ZeroMemory(&psp, sizeof(PROPSHEETPAGE));
+    psp.dwSize = sizeof(PROPSHEETPAGE);
+    psp.dwFlags = PSP_DEFAULT;
+    psp.hInstance = hApplet;
+    psp.pszTemplate = MAKEINTRESOURCE(IDD_HELPPAGE);
+    psp.pfnDlgProc = HelpPageProc;
 
     ZeroMemory(&psh, sizeof(PROPSHEETHEADER));
     psh.dwSize = sizeof(PROPSHEETHEADER);
Index: wined3dcfg.h
===================================================================
--- wined3dcfg.h	(revision 68507)
+++ wined3dcfg.h	(working copy)
@@ -37,6 +37,7 @@
 #define SAVE_CONTROL(a, b) SaveSetting(hWndDlg, hKey, KEY_##a, b, IDC_##a, sizeof(b)/sizeof(WINED3D_SETTINGS))
 
 INT_PTR CALLBACK GeneralPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
+INT_PTR CALLBACK HelpPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
 
 typedef struct _WINED3D_SETTINGS{
     WCHAR szValue[24];
I use ReactOS on real hardware. Will you? My Computers: https://www.reactos.org/wiki/PC_ROS_Rigs Go all the way to the bottom.

[ external image ]
Pi_User5
Posts: 752
Joined: Thu May 01, 2014 4:18 am
Location: United States

Re: Need help with control panel applet

Post by Pi_User5 »

Here's the patch again but this time it's all shown at once:

http://pastebin.com/wxZfGnFk
I use ReactOS on real hardware. Will you? My Computers: https://www.reactos.org/wiki/PC_ROS_Rigs Go all the way to the bottom.

[ external image ]
User avatar
gonzoMD
Posts: 1077
Joined: Fri Oct 20, 2006 7:49 am
Location: Germany
Contact:

Re: Need help with control panel applet

Post by gonzoMD »

Hey Jared.
AFAIK this is a wine module so no changes are accepted.
User avatar
EmuandCo
Developer
Posts: 4731
Joined: Sun Nov 28, 2004 7:52 pm
Location: Germany, Bavaria, Steinfeld
Contact:

Re: Need help with control panel applet

Post by EmuandCo »

Nope, it's not. ^^
ReactOS is still in alpha stage, meaning it is not feature-complete and is recommended only for evaluation and testing purposes.

If my post/reply offends or insults you, be sure that you know what sarcasm is...
Forever Winter
Posts: 131
Joined: Sun Oct 20, 2013 6:50 am

Re: Need help with control panel applet

Post by Forever Winter »

The ppsp member of the PROPSHEETHEADER structure is an array of PROPSHEETPAGE structures, but you thread it like a single PROPSHEETPAGE structure, thus you overwrite the first page.
Pi_User5
Posts: 752
Joined: Thu May 01, 2014 4:18 am
Location: United States

Re: Need help with control panel applet

Post by Pi_User5 »

Forever Winter wrote:The ppsp member of the PROPSHEETHEADER structure is an array of PROPSHEETPAGE structures, but you thread it like a single PROPSHEETPAGE structure, thus you overwrite the first page.
How would I fix this?
I use ReactOS on real hardware. Will you? My Computers: https://www.reactos.org/wiki/PC_ROS_Rigs Go all the way to the bottom.

[ external image ]
Z98
Release Engineer
Posts: 3379
Joined: Tue May 02, 2006 8:16 pm
Contact:

Re: Need help with control panel applet

Post by Z98 »

It's an array. How do you use arrays?
User avatar
gonzoMD
Posts: 1077
Joined: Fri Oct 20, 2006 7:49 am
Location: Germany
Contact:

Re: Need help with control panel applet

Post by gonzoMD »

http://pastebin.com/1VZk5vCK

EDIT: There is still a bug in line 17 and line 23 that prevents it from properly working on windows.

Both lines has to get PSP_DEFAULT as value. Otherwise the tab captions are only garbage

just change this two lines and everything is ok
Post Reply

Who is online

Users browsing this forum: No registered users and 26 guests