xref: /reactos/dll/cpl/telephon/telephon.c (revision 1734f297)
1 /*
2  *
3  * PROJECT:         ReactOS Software Control Panel
4  * FILE:            dll/cpl/telephon/telephon.c
5  * PURPOSE:         ReactOS Software Control Panel
6  * PROGRAMMER:      Dmitry Chapyshev (dmitry@reactos.org)
7  * UPDATE HISTORY:
8  *    10-19-2007  Created
9  */
10 
11 #define WIN32_NO_STATUS
12 #include <stdarg.h>
13 #include <windef.h>
14 #include <winbase.h>
15 #include <cpl.h>
16 
17 #include "resource.h"
18 
19 typedef LONG (CALLBACK* LPINTERNALCONFIG)(HWND, UINT, LPARAM, LPARAM);
20 
21 /* Control Panel Callback */
22 LONG CALLBACK
23 CPlApplet(HWND hwndCPl, UINT uMsg, LPARAM lParam1, LPARAM lParam2)
24 {
25     LPINTERNALCONFIG lpInternalConfig;
26     HINSTANCE hTapi32;
27     CPLINFO *CPlInfo;
28 
29     switch (uMsg)
30     {
31         case CPL_INIT:
32             return TRUE;
33 
34         case CPL_GETCOUNT:
35             return 1;
36 
37         case CPL_INQUIRE:
38             CPlInfo = (CPLINFO*)lParam2;
39             CPlInfo->lData = 0;
40             CPlInfo->idIcon = IDI_CPLSYSTEM;
41             CPlInfo->idName = IDS_CPLSYSTEMNAME;
42             CPlInfo->idInfo = IDS_CPLSYSTEMDESCRIPTION;
43             break;
44 
45         case CPL_DBLCLK:
46         {
47             hTapi32 = LoadLibraryW(L"tapi32.dll");
48             if (!hTapi32) return FALSE;
49 
50             lpInternalConfig = (LPINTERNALCONFIG) GetProcAddress(hTapi32, "internalConfig");
51             if (!lpInternalConfig)
52             {
53                 FreeLibrary(hTapi32);
54                 return FALSE;
55             }
56 
57             lpInternalConfig(hwndCPl, 0, 0, 0);
58             FreeLibrary(hTapi32);
59             return TRUE;
60         }
61     }
62 
63     return FALSE;
64 }
65 
66 BOOL WINAPI
67 DllMain(HINSTANCE hinstDLL, DWORD dwReason, LPVOID lpvReserved)
68 {
69     return TRUE;
70 }
71