📄 rwini.cpp
字号:
// rwini.cpp: implementation of the Crwini class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include <stdlib.h>
#include "rwini.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
Crwini::Crwini()
{
}
Crwini::~Crwini()
{
}
bool Crwini::WriteString(LPCTSTR appname, LPCTSTR keyname,char* s, char *fn)
{
CHAR FilePath[255];
GetModuleFileName(NULL,FilePath,255);
(strrchr(FilePath,'\\'))[1] = 0;
strcat(FilePath,fn);
//MessageBox(hWnd,FilePath,"a",0);
WritePrivateProfileString(appname,keyname,s,FilePath);
return 1;
}
int Crwini::GetInt(LPCTSTR appname, LPCTSTR keyname, char *fn)
{
CHAR FilePath[255];
GetModuleFileName(NULL,FilePath,255);
(strrchr(FilePath,'\\'))[1] = 0;
strcat(FilePath,fn);
//MessageBox(hWnd,FilePath,"a",0);
return GetPrivateProfileInt(appname,keyname,1,FilePath);
}
void Crwini::ReadString(char *key, char *s, char *fn,char str[])
{
CHAR FilePath[255];
GetModuleFileName(NULL,FilePath,255);
(strrchr(FilePath,'\\'))[1] = 0;
strcat(FilePath,fn);
::GetPrivateProfileString(key,s,NULL,str,255,FilePath);
}
void Crwini::WriteInt(char *keyname, char *appname, char *fn, int i)
{CHAR FilePath[255];
GetModuleFileName(NULL,FilePath,255);
(strrchr(FilePath,'\\'))[1] = 0;
strcat(FilePath,fn);
char r[10];
_itoa(i,r,10);
WritePrivateProfileString(appname,keyname,r,FilePath);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -