I may have found a solution, at least for certain hardware configurations.
I have exactly the case which the original poster reported with his laptop #2 - using TeamViewer v9.4.41110 to remote into my new ThinkPad P50 running Windows 10 Enterprise 64-bit (also with the same TeamViewer v9.0.41110 version) works fine, except that when the laptop's lid is closed it will blink the "The screen cannot be captured..." message on and every off every several seconds. There are brief moments, when the "The screen cannot be captured..." message is displaying, that keystrokes will not be forwarded to the remote ThinkPad P50, though mousestrokes do all seem to stay queued and get through. It's not entirely unusable, but it's not usable either.
I tried the DisableDuplicationAPI Registry setting, to no effect in my case.
Opening the remote ThinkPad's display stops the "The screen cannot be captured..." message from displaying and TeamViewer works normally, until the lid is closed again which causes the message to start blinking every several seconds again.
This particular ThinkPad P50 has built-in NVIDIA Quadro M 1000M discrete graphics along with the on-CPU (Core i7-6700HQ) Intel HD Graphics 530. Each program may use one or the other GPU depending on program preferences, user configurations, and system defaults, as part of power-saving vs performance balancing.
I had a theory, that which graphics processor was being used by TeamViewer might have an effect on this problem:
I exited TeamViewer including stopping the "TeamViewer 9" service, then navigated to the TeamViewer Program Files and ran teamviewer.exe with the context option to use the discrete graphics. This made no difference. (I later realised that teamviewer.exe is the user interface; the two tv_*.exe programs I'm not sure exactly what they do; and it is teamviewer_desktop.exe which actually runs the graphics for the remote session).
I looked further; using Process Explorer (procexp.exe) it seems that the TeamViewer service process TeamViewer.exe does not use any graphics at all. So I looked for other TeamViewer processes. I found tv_w32.exe and tv_x64.exe. These also show zero GPU activity in the Process Explorer process details GPU Graph tab. The last TeamViewer proces, TeamViewer_Desktop.exe shows GPU activity, on the System GPU, which I presume is the Intel HD built-in graphics.
So I set TeamViewer_Desktop.exe to default to using discrete NVIDIA graphics, as follows:
I n the NVIDIA Control Panel application, 3D Settings -> Manage 3D Settings, Program Settings tab, Add and browse for C:\Program Files (x86)\TeamViewer\Version9\TeamViewer_Desktop.exe, and select the NVIDIA GPU as the preferred graphics processor for this program.
I restarted all TeamViewer processes, and the blinking "Screen cannot be captured at the moment..." problem seems to have gone away! including after a full reboot with the notebook's lid closed the whole time.
I hope that a) this fix sticks for me, and that b) this is useful to others.