Call windows explorer to refresh recycle bin filename

71 views Asked by At

I changed recycle bin name by this code:

HKEY recycleBinHKey;
LPCSTR registrySubkey = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\CLSID\\{645FF040-5081-101B-9F08-00AA002F954E}";
const BYTE * pnewValue = (const BYTE *) "СибАДИ";
int newValueLen = 7;

RegOpenKeyExA(HKEY_CURRENT_USER, registrySubkey, 0, KEY_SET_VALUE, &recycleBinHKey);
RegSetValueExA(recycleBinHKey, NULL, 0, REG_SZ, pnewValue, newValueLen);
RegCloseKey(recycleBinHKey);

I need to call explorer to refresh desktop, so new filename is visible. Is there any function in winapi that can help me? I'm using Windows 10

I've tried

RedrawWindow(NULL, NULL, NULL, RDW_INTERNALPAINT);

and

SHChangeNotify(SHCNE_ALLEVENTS, SHCNF_FLUSHNOWAIT, NULL, NULL);

but there is no required result - recycle bin name didn't change.

1

There are 1 answers

0
Torrecto - MSFT On

Wrong directory. Recycle bin name is not in here. Check HKEY_LOCAL_MACHINE\SOFTWARE\Classes\WOW6432Node\CLSID\{645FF040-5081-101B-9F08-00AA002F954E}. I'm working on win11. enter image description here