Commit 7342bce8 authored by Joel Holdsworth's avatar Joel Holdsworth Committed by Alexandre Julliard

winecfg: Moved about panel code into about.c.

parent cf7de41e
...@@ -7,6 +7,7 @@ APPMODE = -mwindows ...@@ -7,6 +7,7 @@ APPMODE = -mwindows
IMPORTS = uuid comdlg32 comctl32 shell32 ole32 winmm shlwapi uxtheme user32 gdi32 advapi32 kernel32 IMPORTS = uuid comdlg32 comctl32 shell32 ole32 winmm shlwapi uxtheme user32 gdi32 advapi32 kernel32
C_SRCS = \ C_SRCS = \
about.c \
appdefaults.c \ appdefaults.c \
audio.c \ audio.c \
drive.c \ drive.c \
......
/*
* WineCfg about panel
*
* Copyright 2002 Jaco Greeff
* Copyright 2003 Dimitrie O. Paun
* Copyright 2003 Mike Hearn
* Copyright 2010 Joel Holdsworth
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*
*/
#include <windows.h>
#include <commctrl.h>
#include <wine/debug.h>
#include "resource.h"
#include "winecfg.h"
WINE_DEFAULT_DEBUG_CHANNEL(winecfg);
INT_PTR CALLBACK
AboutDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
char *owner, *org;
switch (uMsg)
{
case WM_NOTIFY:
switch(((LPNMHDR)lParam)->code)
{
case PSN_APPLY:
/*save registration info to registry */
owner = get_text(hDlg, IDC_ABT_OWNER);
org = get_text(hDlg, IDC_ABT_ORG);
set_reg_key(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\CurrentVersion",
"RegisteredOwner", owner ? owner : "");
set_reg_key(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\CurrentVersion",
"RegisteredOrganization", org ? org : "");
set_reg_key(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows NT\\CurrentVersion",
"RegisteredOwner", owner ? owner : "");
set_reg_key(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows NT\\CurrentVersion",
"RegisteredOrganization", org ? org : "");
apply();
HeapFree(GetProcessHeap(), 0, owner);
HeapFree(GetProcessHeap(), 0, org);
break;
}
break;
case WM_INITDIALOG:
/* read owner and organization info from registry, load it into text box */
owner = get_reg_key(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows NT\\CurrentVersion",
"RegisteredOwner", "");
org = get_reg_key(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows NT\\CurrentVersion",
"RegisteredOrganization", "");
SetDlgItemText(hDlg, IDC_ABT_OWNER, owner);
SetDlgItemText(hDlg, IDC_ABT_ORG, org);
SendMessage(GetParent(hDlg), PSM_UNCHANGED, 0, 0);
HeapFree(GetProcessHeap(), 0, owner);
HeapFree(GetProcessHeap(), 0, org);
break;
case WM_COMMAND:
switch(HIWORD(wParam))
{
case EN_CHANGE:
/* enable apply button */
SendMessage(GetParent(hDlg), PSM_CHANGED, 0, 0);
break;
}
break;
}
return FALSE;
}
...@@ -60,66 +60,6 @@ PropSheetCallback (HWND hWnd, UINT uMsg, LPARAM lParam) ...@@ -60,66 +60,6 @@ PropSheetCallback (HWND hWnd, UINT uMsg, LPARAM lParam)
return 0; return 0;
} }
static INT_PTR CALLBACK
AboutDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
char *owner, *org;
switch (uMsg) {
case WM_NOTIFY:
switch(((LPNMHDR)lParam)->code)
{
case PSN_APPLY:
/*save registration info to registry */
owner = get_text(hDlg, IDC_ABT_OWNER);
org = get_text(hDlg, IDC_ABT_ORG);
set_reg_key(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\CurrentVersion",
"RegisteredOwner", owner ? owner : "");
set_reg_key(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\CurrentVersion",
"RegisteredOrganization", org ? org : "");
set_reg_key(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows NT\\CurrentVersion",
"RegisteredOwner", owner ? owner : "");
set_reg_key(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows NT\\CurrentVersion",
"RegisteredOrganization", org ? org : "");
apply();
HeapFree(GetProcessHeap(), 0, owner);
HeapFree(GetProcessHeap(), 0, org);
break;
}
break;
case WM_INITDIALOG:
/* read owner and organization info from registry, load it into text box */
owner = get_reg_key(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows NT\\CurrentVersion",
"RegisteredOwner", "");
org = get_reg_key(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows NT\\CurrentVersion",
"RegisteredOrganization", "");
SetDlgItemText(hDlg, IDC_ABT_OWNER, owner);
SetDlgItemText(hDlg, IDC_ABT_ORG, org);
SendMessage(GetParent(hDlg), PSM_UNCHANGED, 0, 0);
HeapFree(GetProcessHeap(), 0, owner);
HeapFree(GetProcessHeap(), 0, org);
break;
case WM_COMMAND:
switch(HIWORD(wParam))
{
case EN_CHANGE:
/* enable apply button */
SendMessage(GetParent(hDlg), PSM_CHANGED, 0, 0);
break;
}
break;
}
return FALSE;
}
#define NUM_PROPERTY_PAGES 7 #define NUM_PROPERTY_PAGES 7
static INT_PTR static INT_PTR
......
...@@ -87,6 +87,7 @@ INT_PTR CALLBACK AppDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) ...@@ -87,6 +87,7 @@ INT_PTR CALLBACK AppDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
INT_PTR CALLBACK LibrariesDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); INT_PTR CALLBACK LibrariesDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
INT_PTR CALLBACK AudioDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); INT_PTR CALLBACK AudioDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
INT_PTR CALLBACK ThemeDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); INT_PTR CALLBACK ThemeDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
INT_PTR CALLBACK AboutDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
/* Drive management */ /* Drive management */
BOOL load_drives(void); BOOL load_drives(void);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment