-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathData.h
More file actions
36 lines (35 loc) · 1.24 KB
/
Data.h
File metadata and controls
36 lines (35 loc) · 1.24 KB
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
#pragma once
#include <Windows.h>
#define _SourceFile L"F:\\UserData.ini"
//UserDataÊý¾Ý
struct UserData{
int cxClient;
int cyClient;
int x;
int y;
bool iUnicode;
wchar_t wSpaceError[0xff];
wchar_t wUnknowError[0xff];
UserData()
{
cxClient = GetPrivateProfileInt(L"BoxSize", L"Width", 700, _SourceFile);
cyClient = GetPrivateProfileInt(L"BoxSize", L"Hight", 500, _SourceFile);
x = GetPrivateProfileInt(L"BoxSize", L"x", 0, _SourceFile);
y = GetPrivateProfileInt(L"BoxSize", L"y", 0, _SourceFile);
iUnicode = GetPrivateProfileInt(L"TextFormat", L"IsUnicode", 0, _SourceFile);
GetPrivateProfileString(L"Strings", L"SpaceError", L" ", wSpaceError, 0xff, _SourceFile);
GetPrivateProfileString(L"Strings", L"UnknowError", L" ", wUnknowError, 0xff, _SourceFile);
}
void Write(int cxClient, int cyClient, int x, int y)
{
wchar_t temp[0xff];
wsprintf(temp, L"%d", cxClient);
WritePrivateProfileString(L"BoxSize", L"Width", temp, _SourceFile);
wsprintf(temp, L"%d", cyClient);
WritePrivateProfileString(L"BoxSize", L"Hignt", temp, _SourceFile);
wsprintf(temp, L"%d", x);
WritePrivateProfileString(L"BoxSize", L"x", temp, _SourceFile);
wsprintf(temp, L"%d", y);
WritePrivateProfileString(L"BoxSize", L"y", temp, _SourceFile);
}
};