danial weaber
danial weaber

Reputation: 876

How do I change the "show hidden files" setting?

How do I enable or disable the "show hidden filles and folders" and "show system hidden files and folders" options within my program? (I'm not meaning to change the file attributes to be hidden or not — I need to change the Windows options.)

Is it possible by changing a registry key or something like that if their is no C++ method?

Upvotes: 0

Views: 1120

Answers (1)

Sheng Jiang 蒋晟
Sheng Jiang 蒋晟

Reputation: 15261

SHELLSTATE ss;
ZeroMemory(&ss,sizeof(ss));
ss.fShowAllObjects=TRUE;
ss.fShowSysFiles=TRUE;
ss.fShowSuperHidden=TRUE;
SHGetSetSettings(&ss, SSF_SHOWALLOBJECTS|SSF_SHOWSYSFILES|SSF_SHOWSUPERHIDDEN,TRUE)

Upvotes: 2

Related Questions