-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathconfig.cpp
More file actions
47 lines (36 loc) · 952 Bytes
/
config.cpp
File metadata and controls
47 lines (36 loc) · 952 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#include "stdafx.h"
#include "config.h"
#define CONFIGFILE TEXT("superwx.ini")
WxFuncConfig::WxFuncConfig()
{
Init();
}
WxFuncConfig::~WxFuncConfig()
{
}
void WxFuncConfig::Init()
{
TCHAR tszCfgPath[MAX_PATH] = { 0 };
GetModuleFileName(GetModuleHandle(WECHATRESOURCE), tszCfgPath, MAX_PATH);
PathRemoveFileSpec(tszCfgPath);
PathAppend(tszCfgPath, CONFIGFILE);
_tcscpy_s(m_configPath, tszCfgPath);
}
bool WxFuncConfig::IsRevokeMsg()
{
return GetPrivateProfileInt(TEXT("config"), TEXT("revokemsg"), 0, m_configPath) != 0;
}
bool WxFuncConfig::IsSaveVoiceMsg(TCHAR * path)
{
TCHAR voiceMsgPath[MAX_PATH] = { 0 };
GetPrivateProfileString(TEXT("config"), TEXT("voicemsg"), TEXT(""), voiceMsgPath, MAX_PATH, m_configPath);
if (_tcslen(voiceMsgPath) > 0) {
if (path) {
_tcscpy_s(path, MAX_PATH, voiceMsgPath);
}
return true;
}
else {
return false;
}
}