#include <iostream> #define Main main #define COLOR_GREEN system("color 2"); #include <vector> #include <list> #include <WinSock2.h> #include <WS2tcpip.h> #include <LM.h> #include <winnetwk.h> #include "BitMap.h" #include <wlanapi.h> #include "ATBAudioEngine/ATBAudioEngine.h" #pragma comment(lib,"Ws2_32.lib") #pragma comment(lib,"Mpr.lib") #pragma comment(lib,"netapi32.lib") #pragma comment(lib,"Wlanapi.lib") #include <Windows.h> class disorderly { int m_buf[10] = { 0 }; public: void initBuf() { srand(GetTickCount()); int len = sizeof(m_buf) / sizeof(int); for (int i = 0; i < len; i++) { m_buf[i] = rand() % 100; printf("%d, ", m_buf[i]); } } //范围 void initBuf(int range) { srand(GetTickCount()); int len = sizeof(m_buf) / sizeof(int); for (int i = 0; i < len; i++) { m_buf[i] = rand() % range; printf("%d, ", m_buf[i]); } } int *getBuf() { return m_buf; } int getLen() { return sizeof(m_buf) / sizeof(int); } void print() { printf(" "); int len = sizeof(m_buf) / sizeof(int); for (int i = 0; i < len; i++) { printf("%d, ", m_buf[i]); } printf(" "); } void C(int *Arr, int Len) { int TempData = 0; int i = 0; int j = 0; for (i = 1; i < Len; i++) { j = i; TempData = *(Arr + i); //如果当前的数据小于当前数据的上一个 //那么进行赋值, j--, 然后再判断j--数据是否小于上一个数据 while (j > 0 && TempData < Arr[j - 1]) { Arr[j] = Arr[j - 1]; j--; } Arr[j] = TempData; } //for (int i = 0; i < 5; i++) //{ // std::thread th(C, i); // th.join(); // //th.detch(); //} } void M(int *Arr, int Len) { for (int i = 0; i < Len - 1; i++) { for (int j = i + 1; j < Len; j++) { if (Arr[i] > Arr[j]) { int temp = Arr[i]; Arr[i] = Arr[j]; Arr[j] = temp; } } } } void X(int *Arr, int Len) { int k = -1; for (int i = 0; i < Len - 1; i++) { k = i; for (int j = i + 1; j < Len; j++) { //第一波出来的必定是最小的 if (Arr[k] > Arr[j]) { k = j; } } int temp = Arr[i]; Arr[i] = Arr[k]; Arr[k] = temp; } } void GetAllUserName(std::vector<std::wstring> & allUserName) { // See more: http://msdn.microsoft.com/en-us/library/windows/desktop/aa370652(v=vs.85).aspx LPUSER_INFO_1 pBuf = NULL; LPUSER_INFO_1 pTmpBuf; DWORD dwLevel = 1; DWORD dwEntriesRead = 0; DWORD dwTotalEntries = 0; DWORD dwResumeHandle = 0; DWORD dwPrefMaxLen = MAX_PREFERRED_LENGTH; NET_API_STATUS nStatus; LPTSTR pszServerName = NULL; do { nStatus = NetUserEnum((LPCWSTR)pszServerName, dwLevel, FILTER_NORMAL_ACCOUNT, // global users (LPBYTE*)&pBuf, dwPrefMaxLen, &dwEntriesRead, &dwTotalEntries, &dwResumeHandle); if ((nStatus == NERR_Success) || (nStatus == ERROR_MORE_DATA)) { if ((pTmpBuf = pBuf) != NULL) { for (DWORD i = 0; i < dwEntriesRead; i++) { if (pTmpBuf == NULL) { fprintf(stderr, "An access violation has occurred "); break; } allUserName.push_back(pTmpBuf->usri1_name); pTmpBuf++; } } } else fprintf(stderr, "A system error has occurred: %d ", nStatus); if (pBuf != NULL) { NetApiBufferFree(pBuf); pBuf = NULL; } } while (nStatus == ERROR_MORE_DATA); // end do // Check again for allocated memory. if (pBuf != NULL) NetApiBufferFree(pBuf); //std::vector<std::wstring> v; //GetAllUserName(v); //for (int i = 0; i < v.size(); i++) //{ // char buf[256] = { 0 }; // int j = 0; // while (v[i].c_str()[j]) // { // buf[j] = v[i].c_str()[j]; // j++; // } // printf(buf); //} } int getSystemPath() { HANDLE hFile; DWORD dwWrite; TCHAR path[MAX_PATH]; GetSystemDirectory(path, MAX_PATH); hFile = CreateFile("syspath.txt", GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); if (hFile != INVALID_HANDLE_VALUE) { if (!(WriteFile(hFile, path, lstrlen(path), &dwWrite, NULL))) { return GetLastError(); } } return CloseHandle(hFile); } //打印环境变量 void printEV() { PVOID P = GetEnvironmentStringsA(); LPSTR sz; for (sz = (LPSTR)P; *sz;) { printf("%s ", sz); while (*sz++); } FreeEnvironmentStringsA((LPCH)P); P = NULL; } void vectors() { std::vector<int> arr; srand(GetTickCount()); for (unsigned int i = 0; i < 10; i++) { arr.push_back(rand() % 100); } for (unsigned int i = 0; i < arr.size(); i++) { printf("%d, ", arr[i]); } printf(" "); std::cout << "sort last" << std::endl; std::cout << "======================" << std::endl; unsigned int j = 0; int data = 0; for (unsigned int i = 1; i < arr.size(); i++) { j = i; data = arr[i]; while (j > 0 && data < arr[j - 1]) { arr[j] = arr[j - 1]; j--; } arr[j] = data; } for (unsigned int i = 0; i < arr.size(); i++) { printf("%d, ", arr[i]); } printf(" "); arr.clear(); } void ComputerName_Ip() { char buf[256] = ""; hostent *ph = NULL;//struct hostent *ph = NULL; WSADATA w; WSAStartup(0x0101, &w);//这一行必须在使用任何SOCKET函数前写! std::string hostName = buf;//此处获得本机名称 gethostname(buf, sizeof(buf)); ph = gethostbyname(buf); int i = 0; while (ph->h_addr_list[i] != NULL) { char *IP = inet_ntoa(*((struct in_addr *)ph->h_addr_list[i]));//此处获得本机IP std::cout << IP << std::endl; i++; } ph = gethostbyname("www.baidu.com"); i = 0; while (ph->h_addr_list[i] != NULL) { char *IP = inet_ntoa(*((struct in_addr *)ph->h_addr_list[i]));//此处获得本机IP std::cout << IP << std::endl; i++; } WSACleanup(); } void gethostsIP(char *hostsbuf) { WORD wVersion; WSADATA WSAData; wVersion = MAKEWORD(2, 2); WSAStartup(wVersion, &WSAData); gethostname(hostsbuf, 256); addrinfo hints; struct addrinfo *res, *cur; int ret; struct sockaddr_in *addr; char m_ipaddr[16]; memset(&hints, 0, sizeof(struct addrinfo)); hints.ai_family = AF_INET; /* Allow IPv4 */ hints.ai_flags = AI_PASSIVE;/* For wildcard IP address */ hints.ai_protocol = 0; /* Any protocol */ hints.ai_socktype = SOCK_STREAM; ret = getaddrinfo(hostsbuf, NULL, &hints, &res); if (ret == -1) { perror("getaddrinfo"); exit(1); } for (cur = res; cur != NULL; cur = cur->ai_next) { addr = (struct sockaddr_in *)cur->ai_addr; sprintf_s(m_ipaddr, "%d.%d.%d.%d", (*addr).sin_addr.S_un.S_un_b.s_b1, (*addr).sin_addr.S_un.S_un_b.s_b2, (*addr).sin_addr.S_un.S_un_b.s_b3, (*addr).sin_addr.S_un.S_un_b.s_b4); printf("%s ", m_ipaddr); } freeaddrinfo(res); WSACleanup(); } void gethostsIP(const char *hostsName) { WORD wVersion; WSADATA WSAData; wVersion = MAKEWORD(2, 2); WSAStartup(wVersion, &WSAData); addrinfo hints; struct addrinfo *res, *cur; int ret; struct sockaddr_in *addr; char m_ipaddr[16]; memset(&hints, 0, sizeof(struct addrinfo)); hints.ai_family = AF_INET; /* Allow IPv4 */ hints.ai_flags = AI_PASSIVE;/* For wildcard IP address */ hints.ai_protocol = 0; /* Any protocol */ hints.ai_socktype = SOCK_STREAM; ret = getaddrinfo(hostsName, NULL, &hints, &res); if (ret == -1) { perror("getaddrinfo"); exit(1); } for (cur = res; cur != NULL; cur = cur->ai_next) { addr = (struct sockaddr_in *)cur->ai_addr; sprintf_s(m_ipaddr, "%d.%d.%d.%d", (*addr).sin_addr.S_un.S_un_b.s_b1, (*addr).sin_addr.S_un.S_un_b.s_b2, (*addr).sin_addr.S_un.S_un_b.s_b3, (*addr).sin_addr.S_un.S_un_b.s_b4); printf("%s ", m_ipaddr); } freeaddrinfo(res); res = NULL; WSACleanup(); } //无线连接状态 int intlistenStatus() { HANDLE hClient = NULL; DWORD dwMaxClient = 2; DWORD dwCurVersion = 0; DWORD dwResult = 0; int iRet = 0; WCHAR GuidString[39] = { 0 }; //ListenthestatusoftheAPyouconnected. while (1) { Sleep(5000); PWLAN_INTERFACE_INFO_LIST pIfList = NULL; PWLAN_INTERFACE_INFO pIfInfo = NULL; dwResult = WlanOpenHandle(dwMaxClient, NULL, &dwCurVersion, &hClient); if (dwResult != ERROR_SUCCESS) { wprintf(L"WlanOpenHandlefailedwitherror:%u ", dwResult); return 1; } //获取无线网卡列表 dwResult = WlanEnumInterfaces(hClient, NULL, &pIfList); if (dwResult != ERROR_SUCCESS) { wprintf(L"WlanEnumInterfacesfailedwitherror:%u ", dwResult); return 1; } else { wprintf(L"NumEntries:%lu ", pIfList->dwNumberOfItems); wprintf(L"CurrentIndex:%lu ", pIfList->dwIndex); int i; for (i = 0; i < (int)pIfList->dwNumberOfItems; i++) { pIfInfo = (WLAN_INTERFACE_INFO*)&pIfList->InterfaceInfo[i]; wprintf(L"InterfaceIndex[%u]: %lu ", i, i); iRet = StringFromGUID2(pIfInfo->InterfaceGuid, (LPOLESTR)&GuidString, sizeof(GuidString) / sizeof(*GuidString)); if (iRet == 0) wprintf(L"StringFromGUID2failed "); else { wprintf(L"InterfaceGUID[%d]:%S ", i, GuidString); } wprintf(L"InterfaceDescription[%d]:%S", i, pIfInfo->strInterfaceDescription); wprintf(L" "); wprintf(L"InterfaceState[%d]: ", i); switch (pIfInfo->isState) { casewlan_interface_state_not_ready: wprintf(L"Notready "); break; casewlan_interface_state_connected: wprintf(L"Connected "); break; casewlan_interface_state_ad_hoc_network_formed: wprintf(L"Firstnodeinaadhocnetwork "); break; casewlan_interface_state_disconnecting: wprintf(L"Disconnecting "); break; casewlan_interface_state_disconnected: wprintf(L"Notconnected "); break; casewlan_interface_state_associating: wprintf(L"Attemptingtoassociatewithanetwork "); break; casewlan_interface_state_discovering: wprintf(L"Autoconfigurationisdiscoveringsettingsforthenetwork "); break; casewlan_interface_state_authenticating: wprintf(L"Inprocessofauthenticating "); break; default: wprintf(L"Unknownstate%ld ", pIfInfo->isState); break; } } } } } }; #define FF FindFiles::getInstance() class FindFiles { string Path; string Type; HANDLE HFinder = NULL; WIN32_FIND_DATAA FindFileData; string CurPath; int num = -1; public: static FindFiles *getInstance() { static FindFiles obj; return &obj; } //D:/Music_s void setFindPath(const char *Path) { if (Path) { this->Path = Path; CurPath = this->Path; if (this->Path == string("exit")) { exit(0); } } else { printf("input find path .......... "); } } //D:/Music_s void setFindPath(string &Path) { if (!Path.empty()) { this->Path = Path; CurPath = this->Path; if (this->Path == string("exit")) { exit(0); } } else { printf("input find path .......... "); } } // mp3 mp4 ... void setFindType(const char *Type) { if (Type) { this->Type = Type; if (this->Type == string("exit")) { exit(0); } } else { printf("input find Type .......... "); } } // mp3 mp4 ... void setFindType(string &Type) { if (!Type.empty()) { this->Type = Type; if (this->Type == string("exit")) { exit(0); } FF->strcatFindFile(); } else { printf("input find Type .......... "); } } string getPath() const { return this->Path; } string getType() const { return this->Type; } ///============================================= void run() { system("color 2"); char path[256] = { 0 }; char type[256] = { 0 }; printf("input path suppose <D:/Music>:"); std::cin >> path; printf("input type or input 0 is any type suppose <bmp,mp3,mp4,0,cpp,h,c,zip,avi> :"); std::cin >> type; FF->setFindPath(path); if (string(type) == "0") { FF->setFindType("*"); } else { FF->setFindType(type); } FF->strcatFindFile(); FF->findFirstFile(FF->Path.c_str()); while (true) { if (!find()) { break; } } printf(" "); printf("number =========== :::::::: %d file ", num); } void run_s() { while (true) { system("cls"); run(); system("pause"); } } ///============================================= bool find() { string tmp = FindFileData.cFileName; if (tmp != "." && tmp != "..") { printf("%s , %d ", FindFileData.cFileName, FindFileData.dwFileAttributes); } num++; int len = strlen(FindFileData.cFileName); char temp[2] = { 0 }; temp[0] = FindFileData.cFileName[len - 1]; if (FindFileData.dwFileAttributes == FILE_ATTRIBUTE_DIRECTORY) { if (string(temp) != "" && string(temp) != "." && string(temp) != " " && string(temp) != "..") { string lastCurPath = this->CurPath; string lastCur = this->CurPath; lastCurPath += "/"; lastCur += "/"; lastCurPath += FindFileData.cFileName; lastCur += FindFileData.cFileName; lastCurPath += "/*."; if (this->Type == string("0")) { lastCurPath += "*"; } else { lastCurPath += this->Type; } FF->ergodicFile(lastCurPath, lastCur); } } if (!FF->findNextFile()) { return false; } return true; } bool ergodicFile(string path, string lastCur) { WIN32_FIND_DATAA temp; HANDLE HFinder = FindFirstFileA(path.c_str(), &temp); if (HFinder == INVALID_HANDLE_VALUE) { std::cout << "查找失败 !" << std::endl; return true; } while (true) { string tmp = temp.cFileName; if (tmp != "." && tmp != "..") { printf("%s , %d ", temp.cFileName, temp.dwFileAttributes); } num++; int len = strlen(temp.cFileName); char strTemp[2] = { 0 }; strTemp[0] = temp.cFileName[len - 1]; if (temp.dwFileAttributes == FILE_ATTRIBUTE_DIRECTORY) { if (string(strTemp) != "" && string(strTemp) != "." && string(strTemp) != " " && string(strTemp) != "..") { string CurPaths = lastCur; string lastCurPath = CurPaths; lastCurPath += "/"; CurPaths += "/"; lastCurPath += temp.cFileName; CurPaths += temp.cFileName; lastCurPath += "/*."; if (this->Type == string("0")) { lastCurPath += "*"; } else { lastCurPath += this->Type; } ergodicFile(lastCurPath, CurPaths); } } if (!(FindNextFileA(HFinder, &temp))) { return false; } } return true; } void findFirstFile(string path) { HFinder = FindFirstFileA(path.c_str(), &FindFileData); if (HFinder == INVALID_HANDLE_VALUE) { char buf[256] = { 0 }; for (int i = path.length() - 1; i >= 0; i--) { if (path.c_str()[i] == '.') { int len = path.length() - i; for (int j = 0; j <= len + 1; j++) { buf[j] = path.c_str()[j]; } } } string temp = buf; temp += "*"; HFinder = FindFirstFileA(temp.c_str(), &FindFileData); if (HFinder == INVALID_HANDLE_VALUE) { std::cout << "查找失败 !" << std::endl; } } } void closeFind() { if (HFinder) { FindClose(HFinder); HFinder = NULL; } } bool findNextFile() { if (!(FindNextFileA(HFinder, &FindFileData))) { return false; } return true; } private: FindFiles() { } ~FindFiles() { FF->closeFind(); } //连接查找 void strcatFindFile() { if (!Path.empty() && !Type.empty()) { Path += "/*."; Path += Type.c_str(); printf("find file path : %s ", Path.c_str()); } } }; class Registry { public: void read_dword()//读取操作表,其类型为DWORD { HKEY hKEY;//定义有关的键,在查询结束时关闭 //打开与路径data_Set相关的hKEY string data_set = "Software\Chicony\Lenovo1"; //访问注册表,hKEY则保存此函数所打开的键的句柄 if (ERROR_SUCCESS == ::RegOpenKeyEx(HKEY_CURRENT_USER, data_set.c_str(), 0, KEY_READ, &hKEY)) { DWORD dwValue;//长整型数据,如果是字符串数据用char数组 DWORD dwSize = sizeof(DWORD); DWORD dwType = REG_DWORD; if (::RegQueryValueEx(hKEY, "123", 0, &dwType, (LPBYTE)&dwValue, &dwSize) != ERROR_SUCCESS) { cout << "错误:无法查询有关的注册表信息" << endl; } cout << dwValue << endl; } ::RegCloseKey(hKEY); } void read_reg_sz()//读取操作表,其类型为REG_SZ { HKEY hkey; string data_set = "Software\Chicony\Lenovo1"; //LPCWSTR lpwchar = &data_set; if (ERROR_SUCCESS == ::RegOpenKeyEx(HKEY_CURRENT_USER, data_set.c_str(), 0, KEY_READ, &hkey)) { char dwValue[256]; DWORD dwSzType = REG_SZ; DWORD dwSize = sizeof(dwValue); if (::RegQueryValueEx(hkey, "wangchong", 0, &dwSzType, (LPBYTE)&dwValue, &dwSize) != ERROR_SUCCESS) { cout << "无法查询有关的注册表信息" << endl; } cout << dwValue << endl; } ::RegCloseKey(hkey); } void write_dword()//在Software\Chicony\Lenovo1文件夹下写入一个test111的子键,设置其名称为Name,其值为6 { HKEY hkey;//定义有关的hkey,在查询结束时要关闭 HKEY hTempKey; DWORD dwValue = 6; DWORD dwSize = sizeof(DWORD); DWORD dwType = REG_DWORD; const char *data_set = "Software\Chicony\Lenovo1"; if (ERROR_SUCCESS == RegOpenKeyEx(HKEY_CURRENT_USER, data_set, 0, KEY_SET_VALUE, &hkey)) { if (ERROR_SUCCESS == ::RegCreateKey(hkey, "test111", &hTempKey)) { if (ERROR_SUCCESS != ::RegSetValueEx(hTempKey, "Name", 0, REG_DWORD, (CONST BYTE*)&dwValue, sizeof(DWORD))) { cout << "写入注册表失败" << endl; } } } ::RegCloseKey(hkey); } void write_reg_sz() { HKEY hkey; HKEY hTempKey; char m_name_set[256] = "China"; DWORD len = strlen(m_name_set) + 1; const char *data_set = "Software\Chicony\Lenovo1"; if (ERROR_SUCCESS == ::RegOpenKeyEx(HKEY_CURRENT_USER, data_set, 0, KEY_SET_VALUE, &hkey)) { if (ERROR_SUCCESS == ::RegCreateKey(hkey, "test1112", &hTempKey)) { if (ERROR_SUCCESS != ::RegSetValueEx(hTempKey, "Name", 0, REG_SZ, (const BYTE*)m_name_set, len)) { cout << "写入错误" << endl; } } } ::RegCloseKey(hkey); } void write_binary() { HKEY hkey; HKEY hTempKey; BYTE m_name[10]; memset(m_name, 0, sizeof(m_name)); m_name[0] = 0xff; m_name[1] = 0xac; m_name[2] = 0x05; m_name[3] = 0x4e; const char *data_set = "Software\Chicony\Lenovo1"; if (ERROR_SUCCESS == ::RegOpenKeyEx(HKEY_CURRENT_USER, data_set, 0, KEY_SET_VALUE, &hkey)) { if (ERROR_SUCCESS == ::RegCreateKey(hkey, "test111", &hTempKey)) { if (ERROR_SUCCESS != ::RegSetValueEx(hTempKey, "Name", 0, REG_BINARY, (unsigned char *)m_name, 5)) { cout << "写入错误" << endl; } } } ::RegCloseKey(hkey); } void delete_value() { HKEY hkey; const char *data_set = "Software\Chicony\Lenovo1\test1112"; if (ERROR_SUCCESS == ::RegOpenKeyEx(HKEY_CURRENT_USER, data_set, 0, KEY_SET_VALUE, &hkey)) { if (ERROR_SUCCESS != ::RegDeleteValue(hkey, "Name")) { cout << "删除错误" << endl; } } ::RegCloseKey(hkey); } void delete_key() { HKEY hkey; const char *data_set = "Software\Chicony\Lenovo1"; if (ERROR_SUCCESS == ::RegOpenKeyEx(HKEY_CURRENT_USER, data_set, 0, KEY_SET_VALUE, &hkey)) { if (ERROR_SUCCESS != ::RegDeleteKey(hkey, "test1112")) { cout << "删除错误" << endl; } } ::RegCloseKey(hkey); } }; #define DB DoubleBuffer::GetInstance() class DoubleBuffer { HANDLE m_hOutBuf = NULL; HANDLE m_hOutput = NULL; //双缓冲处理显示 DWORD bytes = 0; COORD coord = { 0,0 }; public: static DoubleBuffer *GetInstance() { static DoubleBuffer db; return &db; } HANDLE GetOutBuf() { return m_hOutBuf; } HANDLE GetOutPut() { return m_hOutput; } void Begin(char **data, int W_Len) { for (int i = 0; i < W_Len; i++) { coord.Y = i; BOOL Over = WriteConsoleOutputCharacterA(m_hOutBuf, data[i], W_Len, coord, &bytes); int var = 0; } //设置新的缓冲区为活动显示缓冲 BOOL Over = SetConsoleActiveScreenBuffer(m_hOutBuf); } void End(char **data, int W_Len) { for (int i = 0; i < W_Len; i++) { coord.Y = i; BOOL Over = WriteConsoleOutputCharacterA(m_hOutput, data[i], W_Len, coord, &bytes); } //设置新的缓冲区为活动显示缓冲 BOOL Over = SetConsoleActiveScreenBuffer(m_hOutput); } /* system("color 2"); char **buf = NULL; buf = new char*[40]; for (int i = 0; i < 40; i++) { buf[i] = new char[40]; for (int j = 0; j < 40; j++) { buf[i][j] = 0; } } srand(GetTickCount()); while (true) { for (int i = 0; i < 40; i++) { for (int j = 0; j < 40 - 1; j++) { buf[i][j] = rand() % 48 + 32; } } DB->Begin(buf, 40); for (int i = 0; i < 40; i++) { for (int j = 0; j < 40 - 1; j++) { buf[i][j] = rand() % 48 + 32; } } DB->End(buf, 40); for (int i = 0; i < 40; i++) { for (int j = 0; j < 40 - 1; j++) { buf[i][j] = 0; } } } */ private: DoubleBuffer() { //创建新的控制台缓冲区 m_hOutBuf = CreateConsoleScreenBuffer( GENERIC_WRITE,//定义进程可以往缓冲区写数据 FILE_SHARE_WRITE,//定义缓冲区可共享写权限 NULL, CONSOLE_TEXTMODE_BUFFER, NULL ); m_hOutput = CreateConsoleScreenBuffer( GENERIC_WRITE,//定义进程可以往缓冲区写数据 FILE_SHARE_WRITE,//定义缓冲区可共享写权限 NULL, CONSOLE_TEXTMODE_BUFFER, NULL ); //隐藏两个缓冲区的光标 CONSOLE_CURSOR_INFO cci; cci.bVisible = 0; cci.dwSize = 1; SetConsoleCursorInfo(m_hOutput, &cci); SetConsoleCursorInfo(m_hOutBuf, &cci); } ~DoubleBuffer() { m_hOutBuf = NULL; m_hOutput = NULL; } }; void MusicDemo() { //https://github.com/zhmmmm/ANYTOOL-2.0.0.0.2Version system("color 2"); //D:AudioYZFHKM-S.mp3 string AudioName; std::cout << "Please Input Audio File Names :"; std::cin >> AudioName; std::cout << "Player Music Name : " << AudioName << std::endl; ATA->LoadMusicsAndPlay(AudioName); const int H = 35; const int W = 100; char MusicName[256] = { 0 }; strcat_s(MusicName, AudioName.c_str()); char Buf[128]; char **Map = NULL; Map = new char*[H]; for (int i = 0; i < H; i++) { Map[i] = new char[W]; for (int j = 0; j < W; j++) { Map[i][j] = 0; } } while (true) { ATA->GetAudioStreamData(ATA->GetCurPlayMusic(), Buf); for (int i = 0; i < H; i++) { if (Buf[i] <= 0) { for (int j = 0; j < W; j++) { Map[i][j] = ' '; } } else if (Buf[i] > W - 1) { int temp = Buf[i] % W - 1; for (int j = 0; j < temp; j++) { Map[i][j] = '@'; } } else { for (int j = 0; j < Buf[i]; j++) { Map[i][j] = '@'; } } Map[H - 1][W - 1] = 0; } DB->Begin(Map, W); ATA->GetAudioStreamData(ATA->GetCurPlayMusic(), Buf); for (int i = 0; i < H; i++) { if (Buf[i] <= 0) { for (int j = 0; j < W; j++) { Map[i][j] = ' '; } } else if (Buf[i] > W - 1) { int temp = Buf[i] % W - 1; for (int j = 0; j < temp; j++) { Map[i][j] = '@'; } } else { for (int j = 0; j < Buf[i]; j++) { Map[i][j] = '@'; } } Map[H - 1][W - 1] = 0; } DB->End(Map, W); for (int i = 0; i < H; i++) { for (int j = 0; j < W; j++) { Map[i][j] = 0; } } } delete[] Map; Map = NULL; } class CodeChange { public: void wcharTochar(char *Buf, const wchar_t* wchar) { int len = WideCharToMultiByte(CP_ACP, 0, wchar, wcslen(wchar), NULL, 0, NULL, NULL); WideCharToMultiByte(CP_ACP, 0, wchar, wcslen(wchar), Buf, len, NULL, NULL); } void charToWchar(wchar_t *buf, const char* cchar) { int len = MultiByteToWideChar(CP_ACP, 0, cchar, strlen(cchar), NULL, 0); MultiByteToWideChar(CP_ACP, 0, cchar, strlen(cchar), buf, len); } void UTF_8ToWchar(char *buf, const char* UTF_8) { int wcsLen = ::MultiByteToWideChar(CP_UTF8, NULL, UTF_8, strlen(UTF_8), NULL, 0); wchar_t wszString[1024] = { 0 }; ::MultiByteToWideChar(CP_UTF8, NULL, UTF_8, strlen(UTF_8), wszString, wcsLen); wszString[wcsLen] = '