I have a class for my Windows application which controls the panel brightness.
h = CreateFile(displayName,
GENERIC_READ | GENERIC_WRITE,
0,
NULL,
OPEN_EXISTING,
0, NULL);
Can I keep it open for long time (as long as app is active), or maybe I should close it and open only when required?
You can leave a HANDLE open as long as you want. There is absolutely no need to close and reopen when required.