You can almost always catch and suppress errors if you use the try statement:
try
getRegistryValue(....)
onfail
message("Error reading keys")
endtry.
By the way, THERE IS NO WAY AT ALL OF KNOWING YOUR APP IS RUNNING UNDER COMPAT MODE.
Compatibility mode is MEANT to trick te app into thinking it's running in another version of windows, and so almost all version info returned from system calls is false...
I think that the only way you can detect this fact is by some strange low level mean, such as reading byte by byte some important system file searching for version info; don't use any system call in doing that, since ALL system calls are patched.
For the info about the desktop theme in use, i think it's a bit difficult to get it but i remember seeing in Paradox (or in the registry...) some constants (values) like systemmetrics, which you can read to get the size of title bar, title bar controls, menus, toolbars, and even window borders...
Bye!