Just ran into the same problem. Here is how I resolved the problem:
1. In GOG Galaxy, go to the page for the game.
2. Click on the Settings icon, (i.e., the icon to the right of the Play button.)
3. Select: Manage Installation > Verify / Repair
Wait for Galaxy to repair the installation and inject a CD key into the installation. At this point, the game can run without the "invalid CD-key" message popping up, but I got a blank screen. I could hear the intro sound, but the screen was completely blank. So:
1. Go to the installation folder for the game: i.e., click on the Setting icon for the game again, select: Manage Installation > Show Folder.
2. Right-click on Dragonshard.exe, and select "Properties" at the bottom.
3. Select the "Compatibility" tab.
4. Check "Run this program in compatibility mode for:", and select "Windows XP (Service Pack 3)" (which was the Windows version that had come out shortly before the game did.)
5. Click on "Apply".
6. Close Properties.
The game should run now if you press "Play" in Galaxy.
Post edited March 20, 2022 by KT Chong