Secret agent window does not appear in the foreground

I use codebook on Windows 10.
For some time I have the problem that the window of the Secret Agent does not open in the foreground.
However, the effect only occurs sometimes and so far I have not been able to detect a context.

A Windows message appears:
“Codebook was unable to set the foreground window; please retry Secret Agent Hotkey or launch manually using the task”.
The repetition of the shortcut is without success.

What is the cause of the error message and what can I do to eliminate it?

Hello @Frank_

Codebook for Windows is attempting to set the Secret Agent window as the foreground window and activate it, however on your system it is unable to. When the operating system is unable to make Secret Agent the foreground window, we report the message to the user via a notification. This is done to prevent the user from inadvertently inputting their master password in another window when Codebook is locked and requires a password for access.

As to why it isn’t allowing the foreground window to be set, that is a bit more difficult to say. A few additional questions to consider:

  • Did the behavior previously work?
    • If so, do you know what changes have occurred on your system since it stopped working?
    • Specifically, have you install other software applications around the same time?
  • What version of Windows 10 are you running?
  • Does rebooting your system change the behavior?
  • Do you have other applications running?
    • If so, does the behavior change when you terminate those applications?

Hello Nick,

          I've been using Codebook for over 4 years.

          Yes, opening the Secret Agent in the foreground has always worked in the past.

          The problem described by me occurs only for some time - since about 1/2 year.

          It's a bit annoying and now I wanted to tackle it.

          Of course, hardware and software changes have taken place during this time.

          I started with a Windows 7 machine - there I never had this problem.

          For some time I use Windows 10 (currently Windows 10 Pro 64 bit - 1803 build 17134.345 German) and only then came up the problem.

          Very well reproducible it is in combination with a home banking software "Lexware Financial Manager".         When the banking account is retrieved, an input mask for the bank access data appears.         This mask is in the foreground and the Secret Agent is almost never about to get there.         The problem did not exist before and the Lexware software I also use for years.

          But even outside the financial software, Codebook sometimes can not come to the fore - both the login mask and the secret agent.         But I have not been able to recognize a system here.

Rebooting the computer doesn't help here.

I have other applications closed (via Task Manager).
  But also without success.

    Best regards


Hi all, I’ve noticed this behaviour as well. It happens infrequently on various Windows 10 PCs.

I can’t seem to reproduce it on demand, but when it happens it sticks around for a while.


I would be curious if you would note what other third-party applications are running when you observe this behavior again. Thanks!

This happens for me somewhat regularly on my system when I try to use Secret Agent to launch Codebook. Here is my system setup

Codebook 4.3.10
Edition Windows 10 Pro
Version 20H2
Installed on ‎5/‎29/‎2020
OS build 19042.685
Experience Windows Feature Experience Pack 120.2212.551.0

The other software open on my desktop at the time:

  • Firefox – Almost always the application I have focused when using Secret Agent
  • IntelliJ IDEA
  • Windows Terminal
  • Windows Explorer


Please let me know if there are other ways I can help track down the issue. It is not consistently reproducible for me – possibly based on what other applications I have open or have focused but I have not been keeping track.

I’ve also experienced this on Windows 10.

I believe it’s a change that’s been made to Windows by Microsoft that’s brought about this behavior. Windows, I think, is trying to prevent another program from popping in front of your browser, as Windows regards this as an attempt to “steal” keystrokes from the browser.

If the user pauses for a couple of seconds before pressing the Codebook Agent hotkey, Windows will allow the agent to pop up, because it appears as if the user wasn’t in the middle of typing something to the browser. But if the user quickly presses the Hotkey after just having typed at the browser, Windows will block the Agent from coming to the foreground.

At least, that’s my best guess, from analyzing the behavior I’m seeing.

@ZipFoxtaur - may I ask what browser you are using when you observe this behavior during quick typing?

The main browser I use is Microsoft Edge (the new one based on Chromium).

I’m a little annoyed just now, as I’m trying to reproduce the behavior that I’ve seen so many times, and yet I can’t make it happen. The secret agent window pops up reliably every time.

I’ll have to keep a closer eye on my interactions next time I see this occur.

I have this same problem. I am using the Chromium version of Edge also. I have also had problems reproducing it but it happens many times and unexpectedly. Sometimes I get the message and sometimes it appears as if nothing happens. Then I notice the icon in the taskbar so I know it is opened. I left-click the icon and it comes to the front.

Hello @lwetzel and @ZipFoxtaur - we’ve been doing some really extensive testing with Edge here but haven’t been able to reproduce similar issues so far.

One thing we’re wondering about is if there might be something interfering with the hotkey processing of Codebook. If I might ask, do you know of any other non-default Windows software running on your computers that may be using special hotkeys?

Also, are you using the default Secret Agent hotkey, or did you change it to something custom?

I have not changed the default hotkey definition in Codebook.

Just now while trying to reproduce the problem, I was trying quickly switching between windows, then pressing the hotkey to launch Secret Agent. I couldn’t reproduce the error reported here, but I was able several times to replicate a similar problem, where pressing the hotkey causes nothing at all to happen.

Recently I was even able to reproduce the problem happening when Edge was not even running, so I guess my previous ideas about what’s going on just don’t stand up to experimentation. I’m at a loss.

As for software I have installed that might be interfering with keyboard behavior, I have the following that could be related:

  • Logitech Options
  • Logitech SetPoint
  • WinHotKey

I can see any one of these might try to involve itself in handling hotkeys.

Hello old Friend Stephen,

I have nothing that I know of that is using short cuts besides the Windows normal. I too have Logitech Options but that is a recent addition and I have had the problem well before I got this mouse. I can think of nothing else.

I am using the default Secret Agent Hotkey.


Hello @lwetzel and @ZipFoxtaur - I am hopeful that you’ve recently seen the latest release of Codebook 4.4. We have made some really extensive changes and improvements to the way Secret Agent works regarding focus and data input. Have you had a chance to try it out since the upgrade became available? If so, has it fixed the issues you were seeing previously?

I have been able to use it. I think it is functioning as it should. I don’t have time right now to specifically give it a test. Going out of town via train so maybe I can spend time testing. I will let you know how it goes.

I have definitely noted with interest that changes have been made to the way Secret Agent works in the latest 4.4, which I’ve upgraded to. However, it will take some time to determine if there are any problems, as I’ve found that reproducing the issues on demand has been very difficult.

In the past I tried to determine a set of steps that would reproduce the problem, and found that I could not produce it reliably in any way. And then a few days would go by, and the next time I try to pop up Secret Agent in the course of web browsing, I’d get the dreaded foreground glitch, with still no idea what caused it. I stopped reporting here because I could not provide any useful data.

So, I’ll continue using Codebook and Secret Agent at version 4.4 to see if I see the behavior again.

Hi @ZipFoxtaur

Thank you for reaching out, we look forward to hearing your results of using Secret Agent on Windows!

Hi Codebook developers,
since the latest update (Codebook for Windows) the secret agent works as it should.
Every time I use now the shortcut the window of the secret agent appears in the forground and has the input focus.
In the past it really annoying. I guess only every second time it worked correctly. (otherwise the input window was in the background)
Congratulations - finally it’s perfect.

Regards Frank

Hi @Frank_ - It is so great to hear that the new Secret Agent changes have improved the stability for you. Thank you for letting us know the experience has improved!

I have also not noticed this issue again since around that time period of the ~ update.