OSDN Git Service

Add VC++ Project files for PuTTY DLL without exported functions.
[ffftp/ffftp.git] / updatebell.c
1 /*=============================================================================\r
2 *                                                               更新風鐸対応\r
3 *\r
4 ===============================================================================\r
5 / Copyright (C) 1997-2007 Sota. All rights reserved.\r
6 /\r
7 / Redistribution and use in source and binary forms, with or without \r
8 / modification, are permitted provided that the following conditions \r
9 / are met:\r
10 /\r
11 /  1. Redistributions of source code must retain the above copyright \r
12 /     notice, this list of conditions and the following disclaimer.\r
13 /  2. Redistributions in binary form must reproduce the above copyright \r
14 /     notice, this list of conditions and the following disclaimer in the \r
15 /     documentation and/or other materials provided with the distribution.\r
16 /\r
17 / THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR \r
18 / IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES \r
19 / OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \r
20 / IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, \r
21 / INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, \r
22 / BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF \r
23 / USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON \r
24 / ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT \r
25 / (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF \r
26 / THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
27 /============================================================================*/\r
28 \r
29 #define  STRICT\r
30 #include <windows.h>\r
31 #include <stdio.h>\r
32 #include <stdlib.h>\r
33 #include <string.h>\r
34 #include <malloc.h>\r
35 #include <stdarg.h>\r
36 #include <windowsx.h>\r
37 #include <commctrl.h>\r
38 \r
39 #include "common.h"\r
40 \r
41 \r
42 \r
43 #define MAIL_ADDRESS    "sota@mwa.biglobe.ne.jp"\r
44 #define SOFTWARE                "FFFTP"\r
45 #define MYNAME                  "曽田"\r
46 #define MYURL                   "http://www2.biglobe.ne.jp/~sota/"\r
47 #define INFOFILE                "http://www2.biglobe.ne.jp/~sota/product/update.inf"\r
48 \r
49 \r
50 /*----- 更新風鐸のローカル情報を書き込む --------------------------------------\r
51 *\r
52 *       Parameter\r
53 *               なし\r
54 *\r
55 *       Return Value\r
56 *               なし\r
57 *----------------------------------------------------------------------------*/\r
58 \r
59 void SaveUpdateBellInfo(void)\r
60 {\r
61         HKEY hKey1;\r
62         HKEY hKey2;\r
63         HKEY hKey3;\r
64         DWORD Dispos;\r
65         int Tmp;\r
66 \r
67         if(RegOpenKeyEx(HKEY_CURRENT_USER, "Software\\Upcheck", 0, KEY_CREATE_SUB_KEY, &hKey1) == ERROR_SUCCESS)\r
68         {\r
69                 if(RegCreateKeyEx(hKey1, MAIL_ADDRESS, 0, "", REG_OPTION_NON_VOLATILE, KEY_CREATE_SUB_KEY|KEY_SET_VALUE, NULL, &hKey2, &Dispos) == ERROR_SUCCESS)\r
70                 {\r
71                         RegSetValueEx(hKey2, "Author", 0, REG_SZ, MYNAME, strlen(MYNAME)+1);\r
72                         RegSetValueEx(hKey2, "InfoURL", 0, REG_SZ, INFOFILE, strlen(INFOFILE)+1);\r
73                         RegSetValueEx(hKey2, "DisplayHost", 0, REG_SZ, MYURL, strlen(MYURL)+1);\r
74 \r
75                         if(RegCreateKeyEx(hKey2, SOFTWARE, 0, "", REG_OPTION_NON_VOLATILE, KEY_CREATE_SUB_KEY|KEY_SET_VALUE, NULL, &hKey3, &Dispos) == ERROR_SUCCESS)\r
76                         {\r
77                                 Tmp = PROGRAM_VERSION_NUM;\r
78                                 RegSetValueEx(hKey3, "Build", 0, REG_DWORD, (CONST BYTE *)&Tmp, sizeof(Tmp));\r
79                                 RegSetValueEx(hKey3, "DistinctName", 0, REG_SZ, SOFTWARE, strlen(SOFTWARE)+1);\r
80 \r
81                                 RegCloseKey(hKey3);\r
82                         }\r
83                         RegCloseKey(hKey2);\r
84                 }\r
85                 RegCloseKey(hKey1);\r
86         }\r
87         return;\r
88 }\r
89 \r
90 \r