1 /*=============================================================================
\r
4 ===============================================================================
\r
5 / Copyright (C) 1997-2007 Sota. All rights reserved.
\r
7 / Redistribution and use in source and binary forms, with or without
\r
8 / modification, are permitted provided that the following conditions
\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
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
30 #include <windows.h>
\r
36 #include <windowsx.h>
\r
37 #include <commctrl.h>
\r
43 #define MAIL_ADDRESS "sota@mwa.biglobe.ne.jp"
\r
44 #define SOFTWARE "FFFTP"
\r
46 #define MYURL "http://www2.biglobe.ne.jp/~sota/"
\r
47 #define INFOFILE "http://www2.biglobe.ne.jp/~sota/product/update.inf"
\r
50 /*----- 更新風鐸のローカル情報を書き込む --------------------------------------
\r
57 *----------------------------------------------------------------------------*/
\r
59 void SaveUpdateBellInfo(void)
\r
67 if(RegOpenKeyEx(HKEY_CURRENT_USER, "Software\\Upcheck", 0, KEY_CREATE_SUB_KEY, &hKey1) == ERROR_SUCCESS)
\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
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
75 if(RegCreateKeyEx(hKey2, SOFTWARE, 0, "", REG_OPTION_NON_VOLATILE, KEY_CREATE_SUB_KEY|KEY_SET_VALUE, NULL, &hKey3, &Dispos) == ERROR_SUCCESS)
\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