I have a program that, when running, requires the desktop to be disabled (icons disabled and right-click disabled).
I got this working fine in XP and Vista, but Windows 7 keeps throwing me curve balls.
This is what I have tried already...
* dwinlock component
* EnableWindow(FindWindowEx(
FindWindow
('Progman', nil), HWND(0), 'ShellDll_DefView', nil), FALSE) ;
* HKCU\SoftwareMicrosoft\Win
dows\Curre
ntVersion\
Policies\E
xplorer\No
Desktop
dwinlock works GREAT for XP and Vista for all it is advertised to do, but the disable desktop feature does not work in Windows 7. No error code or anything. The program thinks it is working, but the desktop is still fully accessible.
"EnableWindow(FindWindowEx
(FindWindo
w ('Progman', nil), HWND(0), 'ShellDll_DefView', nil), FALSE) ;" does nothing since Windows 7 does not use "Progman" for the program manager. I have read that it uses "WorkerW", but I cannot call it as like I used to be able to call ProgMan.
HKCU\SoftwareMicrosoft\Win
dows\Curre
ntVersion\
Policies\E
xplorer\No
Desktop. When I manually set this with regedit, and I kill then restart explorer.exe it works like a champ. The problem is that I need this to be programmatically automatic when my app starts up and reverse when it closes. I tried using Delphi to write this to the registry, but Windows 7 deflects it without error messages. (it seems it get re-routed to HKU instead of HKCU. I found that by default, the "policies" sub-dir does not offer write permissions which only seem to take effect when I try to use a script too modify it. If I manually set write permission for the current user for the "policies" sub-dir, it lets Delphi write the needed key.
I also tried shellexecuting a .reg file, but if I run it silently (using switch /s) it fails without any messages) Running it without any switches works, but I am nagged and cannot have my end users nagged at all (not an option).
An answer to any of these questions will solve the issue...
How can I programmatically write values to the HKCU\Software\Microsoft\Wi
ndows\Curr
entVersion
\Policies\
Explorer section in the registry?
How can I use the "EnableWindow(FindWindowEx
(FindWindo
w ('Progman', nil), HWND(0), 'ShellDll_DefView', nil), FALSE) ;" but with Windows 7?
Know of any WORKING component like dwinlock for Windows 7?
When replying, please remember, this is a required function (don't try to talk me out of it) It MUST work with Windows 7, and it must be forgiving (this app will run on a variety of different computers)
Thank you!