Author: dchapyshev Date: Sun Jan 25 05:45:47 2009 New Revision: 39087
URL: http://svn.reactos.org/svn/reactos?rev=39087&view=rev Log: - Cleanup and implement telephon.cpl
Removed: trunk/reactos/dll/cpl/telephon/telephon.h Modified: trunk/reactos/dll/cpl/telephon/lang/bg-BG.rc trunk/reactos/dll/cpl/telephon/lang/de-DE.rc trunk/reactos/dll/cpl/telephon/lang/el-GR.rc trunk/reactos/dll/cpl/telephon/lang/en-US.rc trunk/reactos/dll/cpl/telephon/lang/es-ES.rc trunk/reactos/dll/cpl/telephon/lang/fr-FR.rc trunk/reactos/dll/cpl/telephon/lang/it-IT.rc trunk/reactos/dll/cpl/telephon/lang/no-NO.rc trunk/reactos/dll/cpl/telephon/lang/pl-PL.rc trunk/reactos/dll/cpl/telephon/lang/ru-RU.rc trunk/reactos/dll/cpl/telephon/lang/sk-SK.rc trunk/reactos/dll/cpl/telephon/lang/uk-UA.rc trunk/reactos/dll/cpl/telephon/resource.h trunk/reactos/dll/cpl/telephon/telephon.c
Modified: trunk/reactos/dll/cpl/telephon/lang/bg-BG.rc URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/telephon/lang/bg-BG... ============================================================================== --- trunk/reactos/dll/cpl/telephon/lang/bg-BG.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/telephon/lang/bg-BG.rc [iso-8859-1] Sun Jan 25 05:45:47 2009 @@ -1,11 +1,4 @@ LANGUAGE LANG_BULGARIAN, SUBLANG_DEFAULT - -IDD_PROPPAGE DIALOGEX 0, 0, 246, 230 -STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION -CAPTION "" -FONT 8, "MS Shell Dlg" -BEGIN -END
STRINGTABLE BEGIN
Modified: trunk/reactos/dll/cpl/telephon/lang/de-DE.rc URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/telephon/lang/de-DE... ============================================================================== --- trunk/reactos/dll/cpl/telephon/lang/de-DE.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/telephon/lang/de-DE.rc [iso-8859-1] Sun Jan 25 05:45:47 2009 @@ -1,11 +1,4 @@ LANGUAGE LANG_GERMAN, SUBLANG_NEUTRAL - -IDD_PROPPAGE DIALOGEX 0, 0, 246, 230 -STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION -CAPTION "" -FONT 8, "MS Shell Dlg" -BEGIN -END
STRINGTABLE BEGIN
Modified: trunk/reactos/dll/cpl/telephon/lang/el-GR.rc URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/telephon/lang/el-GR... ============================================================================== --- trunk/reactos/dll/cpl/telephon/lang/el-GR.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/telephon/lang/el-GR.rc [iso-8859-1] Sun Jan 25 05:45:47 2009 @@ -1,11 +1,4 @@ LANGUAGE LANG_GREEK, SUBLANG_DEFAULT - -IDD_PROPPAGE DIALOGEX 0, 0, 246, 230 -STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION -CAPTION "" -FONT 8, "MS Shell Dlg" -BEGIN -END
STRINGTABLE BEGIN
Modified: trunk/reactos/dll/cpl/telephon/lang/en-US.rc URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/telephon/lang/en-US... ============================================================================== --- trunk/reactos/dll/cpl/telephon/lang/en-US.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/telephon/lang/en-US.rc [iso-8859-1] Sun Jan 25 05:45:47 2009 @@ -1,11 +1,4 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US - -IDD_PROPPAGE DIALOGEX 0, 0, 246, 230 -STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION -CAPTION "" -FONT 8, "MS Shell Dlg" -BEGIN -END
STRINGTABLE BEGIN
Modified: trunk/reactos/dll/cpl/telephon/lang/es-ES.rc URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/telephon/lang/es-ES... ============================================================================== --- trunk/reactos/dll/cpl/telephon/lang/es-ES.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/telephon/lang/es-ES.rc [iso-8859-1] Sun Jan 25 05:45:47 2009 @@ -1,11 +1,4 @@ LANGUAGE LANG_SPANISH, SUBLANG_NEUTRAL - -IDD_PROPPAGE DIALOGEX 0, 0, 246, 230 -STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION -CAPTION "" -FONT 8, "MS Shell Dlg" -BEGIN -END
STRINGTABLE BEGIN
Modified: trunk/reactos/dll/cpl/telephon/lang/fr-FR.rc URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/telephon/lang/fr-FR... ============================================================================== --- trunk/reactos/dll/cpl/telephon/lang/fr-FR.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/telephon/lang/fr-FR.rc [iso-8859-1] Sun Jan 25 05:45:47 2009 @@ -1,11 +1,4 @@ LANGUAGE LANG_FRENCH, SUBLANG_NEUTRAL - -IDD_PROPPAGE DIALOGEX 0, 0, 246, 230 -STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION -CAPTION "" -FONT 8, "MS Shell Dlg" -BEGIN -END
STRINGTABLE BEGIN
Modified: trunk/reactos/dll/cpl/telephon/lang/it-IT.rc URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/telephon/lang/it-IT... ============================================================================== --- trunk/reactos/dll/cpl/telephon/lang/it-IT.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/telephon/lang/it-IT.rc [iso-8859-1] Sun Jan 25 05:45:47 2009 @@ -1,11 +1,4 @@ LANGUAGE LANG_ITALIAN, SUBLANG_NEUTRAL - -IDD_PROPPAGE DIALOGEX 0, 0, 246, 230 -STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION -CAPTION "" -FONT 8, "MS Shell Dlg" -BEGIN -END
STRINGTABLE BEGIN
Modified: trunk/reactos/dll/cpl/telephon/lang/no-NO.rc URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/telephon/lang/no-NO... ============================================================================== --- trunk/reactos/dll/cpl/telephon/lang/no-NO.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/telephon/lang/no-NO.rc [iso-8859-1] Sun Jan 25 05:45:47 2009 @@ -1,13 +1,6 @@ // Norwegian (no) resources by LMH1
LANGUAGE LANG_NORWEGIAN, SUBLANG_NEUTRAL - -IDD_PROPPAGE DIALOGEX 0, 0, 246, 230 -STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION -CAPTION "" -FONT 8, "MS Shell Dlg" -BEGIN -END
STRINGTABLE BEGIN
Modified: trunk/reactos/dll/cpl/telephon/lang/pl-PL.rc URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/telephon/lang/pl-PL... ============================================================================== --- trunk/reactos/dll/cpl/telephon/lang/pl-PL.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/telephon/lang/pl-PL.rc [iso-8859-1] Sun Jan 25 05:45:47 2009 @@ -7,13 +7,6 @@
LANGUAGE LANG_POLISH, SUBLANG_DEFAULT
-IDD_PROPPAGE DIALOGEX 0, 0, 246, 230 -STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION -CAPTION "" -FONT 8, "MS Shell Dlg" -BEGIN -END - STRINGTABLE BEGIN IDS_CPLSYSTEMNAME "Opcje telefonu i modemu"
Modified: trunk/reactos/dll/cpl/telephon/lang/ru-RU.rc URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/telephon/lang/ru-RU... ============================================================================== --- trunk/reactos/dll/cpl/telephon/lang/ru-RU.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/telephon/lang/ru-RU.rc [iso-8859-1] Sun Jan 25 05:45:47 2009 @@ -1,11 +1,4 @@ LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT - -IDD_PROPPAGE DIALOGEX 0, 0, 246, 230 -STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION -CAPTION "" -FONT 8, "MS Shell Dlg" -BEGIN -END
STRINGTABLE BEGIN
Modified: trunk/reactos/dll/cpl/telephon/lang/sk-SK.rc URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/telephon/lang/sk-SK... ============================================================================== --- trunk/reactos/dll/cpl/telephon/lang/sk-SK.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/telephon/lang/sk-SK.rc [iso-8859-1] Sun Jan 25 05:45:47 2009 @@ -1,11 +1,4 @@ LANGUAGE LANG_SLOVAK, SUBLANG_DEFAULT - -IDD_PROPPAGE DIALOGEX 0, 0, 246, 230 -STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION -CAPTION "" -FONT 8, "MS Shell Dlg" -BEGIN -END
STRINGTABLE BEGIN
Modified: trunk/reactos/dll/cpl/telephon/lang/uk-UA.rc URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/telephon/lang/uk-UA... ============================================================================== --- trunk/reactos/dll/cpl/telephon/lang/uk-UA.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/telephon/lang/uk-UA.rc [iso-8859-1] Sun Jan 25 05:45:47 2009 @@ -8,13 +8,6 @@
LANGUAGE LANG_UKRAINIAN, SUBLANG_DEFAULT
-IDD_PROPPAGE DIALOGEX 0, 0, 246, 230 -STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION -CAPTION "" -FONT 8, "MS Shell Dlg" -BEGIN -END - STRINGTABLE BEGIN IDS_CPLSYSTEMNAME "Òåëåôîí ³ ìîäåì"
Modified: trunk/reactos/dll/cpl/telephon/resource.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/telephon/resource.h... ============================================================================== --- trunk/reactos/dll/cpl/telephon/resource.h [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/telephon/resource.h [iso-8859-1] Sun Jan 25 05:45:47 2009 @@ -4,8 +4,6 @@ /* icons */ #define IDI_CPLSYSTEM 100
-/* dialogs */ -#define IDD_PROPPAGE 200 /* strings */ #define IDS_CPLSYSTEMNAME 1001 #define IDS_CPLSYSTEMDESCRIPTION 2001
Modified: trunk/reactos/dll/cpl/telephon/telephon.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/telephon/telephon.c... ============================================================================== --- trunk/reactos/dll/cpl/telephon/telephon.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/telephon/telephon.c [iso-8859-1] Sun Jan 25 05:45:47 2009 @@ -1,154 +1,62 @@ -/* - * ReactOS - * Copyright (C) 2007 ReactOS Team - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ /* * - * PROJECT: ReactOS Software Control Panel - * FILE: dll/cpl/telephon/telephon.c - * PURPOSE: ReactOS Software Control Panel - * PROGRAMMER: Dmitry Chapyshev (lentind@yandex.ru) + * PROJECT: ReactOS Software Control Panel + * FILE: dll/cpl/telephon/telephon.c + * PURPOSE: ReactOS Software Control Panel + * PROGRAMMER: Dmitry Chapyshev (dmitry@reactos.org) * UPDATE HISTORY: - * 10-19-2007 Created + * 10-19-2007 Created */
-#include "telephon.h" +#include <windows.h> +#include <cpl.h>
-#define NUM_APPLETS (1) +#include "resource.h"
-LONG CALLBACK SystemApplet(VOID); -HINSTANCE hApplet = 0; -HWND hCPLWindow; - -/* Applets */ - -APPLET Applets[NUM_APPLETS] = -{ - {IDI_CPLSYSTEM, IDS_CPLSYSTEMNAME, IDS_CPLSYSTEMDESCRIPTION, SystemApplet} -}; - -/* Property page dialog callback */ -INT_PTR CALLBACK -TelephonPageProc(HWND hwndDlg, - UINT uMsg, - WPARAM wParam, - LPARAM lParam) -{ - UNREFERENCED_PARAMETER(lParam); - UNREFERENCED_PARAMETER(wParam); - - switch (uMsg) - { - case WM_INITDIALOG: - return TRUE; - } - - return FALSE; -} - - - -static VOID -InitPropSheetPage(PROPSHEETPAGE *psp, WORD idDlg, DLGPROC DlgProc) -{ - ZeroMemory(psp, sizeof(PROPSHEETPAGE)); - psp->dwSize = sizeof(PROPSHEETPAGE); - psp->dwFlags = PSP_DEFAULT; - psp->hInstance = hApplet; - psp->pszTemplate = MAKEINTRESOURCE(idDlg); - psp->pfnDlgProc = DlgProc; -} - - -/* First Applet */ -LONG CALLBACK -SystemApplet(VOID) -{ - PROPSHEETPAGE psp[1]; - PROPSHEETHEADER psh; - TCHAR Caption[1024]; - - LoadString(hApplet, IDS_CPLSYSTEMNAME, Caption, sizeof(Caption) / sizeof(TCHAR)); - - ZeroMemory(&psh, sizeof(PROPSHEETHEADER)); - psh.dwSize = sizeof(PROPSHEETHEADER); - psh.dwFlags = PSH_PROPSHEETPAGE; - psh.hwndParent = hCPLWindow; - psh.hInstance = hApplet; - psh.hIcon = LoadIcon(hApplet, MAKEINTRESOURCE(IDI_CPLSYSTEM)); - psh.pszCaption = Caption; - psh.nPages = sizeof(psp) / sizeof(PROPSHEETPAGE); - psh.nStartPage = 0; - psh.ppsp = psp; - psh.pfnCallback = NULL; - - InitPropSheetPage(&psp[0], IDD_PROPPAGE, (DLGPROC)TelephonPageProc); - - return (LONG)(PropertySheet(&psh) != -1); -} - +typedef UINT (CALLBACK* LPINTERNALCONFIG)(HWND, UINT, LPARAM, LPARAM);
/* Control Panel Callback */ LONG CALLBACK CPlApplet(HWND hwndCPl, UINT uMsg, LPARAM lParam1, LPARAM lParam2) { + LPINTERNALCONFIG lpInternalConfig; + HINSTANCE hTapi32; CPLINFO *CPlInfo; - DWORD i;
- i = (DWORD)lParam1; switch (uMsg) { case CPL_INIT: return TRUE;
case CPL_GETCOUNT: - return NUM_APPLETS; + return 1;
case CPL_INQUIRE: CPlInfo = (CPLINFO*)lParam2; CPlInfo->lData = 0; - CPlInfo->idIcon = Applets[i].idIcon; - CPlInfo->idName = Applets[i].idName; - CPlInfo->idInfo = Applets[i].idDescription; + CPlInfo->idIcon = IDI_CPLSYSTEM; + CPlInfo->idName = IDS_CPLSYSTEMNAME; + CPlInfo->idInfo = IDS_CPLSYSTEMDESCRIPTION; break;
case CPL_DBLCLK: - hCPLWindow = hwndCPl; - Applets[i].AppletProc(); - break; + { + hTapi32 = LoadLibraryW(L"tapi32.dll"); + if (!hTapi32) return FALSE; + + lpInternalConfig = (LPINTERNALCONFIG) GetProcAddress(hTapi32, "internalConfig"); + if (!lpInternalConfig) return FALSE; + + lpInternalConfig(hwndCPl, 0, 0, 0); + return TRUE; + } }
return FALSE; }
- BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD dwReason, LPVOID lpvReserved) { - UNREFERENCED_PARAMETER(lpvReserved); - - switch (dwReason) - { - case DLL_PROCESS_ATTACH: - case DLL_THREAD_ATTACH: - CoInitialize(NULL); - hApplet = hinstDLL; - break; - } - return TRUE; }
Removed: trunk/reactos/dll/cpl/telephon/telephon.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/telephon/telephon.h... ============================================================================== --- trunk/reactos/dll/cpl/telephon/telephon.h [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/telephon/telephon.h (removed) @@ -1,32 +1,0 @@ -#ifndef __CPL_TELEPHON_H -#define __CPL_TELEPHON_H - -#include <windows.h> -#include <commctrl.h> -#include <cpl.h> -#include <stdlib.h> -#include <stdio.h> -#include <stdarg.h> -#include <tchar.h> -#include <process.h> - -#include "resource.h" - -typedef LONG (CALLBACK *CPLAPPLET_PROC)(VOID); - -typedef struct -{ - int idIcon; - int idName; - int idDescription; - CPLAPPLET_PROC AppletProc; -} APPLET, *PAPPLET; - - -extern HINSTANCE hApplet; - -void ShowLastWin32Error(HWND hWndOwner); - -#endif /* __CPL_TELEPHON_H */ - -/* EOF */