QString file; //Stores the path of file/folder
LPCWSTR path = file.toStdWString().c_str();
BOOL result = SetFileAttributes(path, FILE_ATTRIBUTE_HIDDEN);
if ((attr & FILE_ATTRIBUTE_HIDDEN) == FILE_ATTRIBUTE_HIDDEN) {
SetFileAttributes(path, attr & ~FILE_ATTRIBUTE_HIDDEN);
}
This hides the files if its not hidden
else if its hidden it becomes visible..
That's all, & Thanks for reading if you like the content please like or comment..