0X0000058F

ERROR_WINDOW_NOT_COMBOBOX (0X0000058F): What It Means and How to Fix It

This error means a program tried to treat a non-combobox window as one. It's usually a coding bug, not something you caused.

Quick answer

ERROR_WINDOW_NOT_COMBOBOX (0X0000058F) means a running program sent a combo box message (like CB_GETCURSEL or CB_ADDSTRING) to a window handle that isn't a combo box. It's almost never caused by Windows itself — it's a bug in the application, an add-in, or an automation script.

Why this error shows up

Windows has a family of window messages that only make sense for specific control types. If you send CB_GETCURSEL to a list box, an edit control, or the main window of an app, Windows checks the target's class name, sees it isn't "ComboBox", and returns 0X0000058F through GetLastError. In a debugger you'll see something like:

SendMessage(hWnd, CB_GETCURSEL, 0, 0);
// returns CB_ERR, GetLastError() == 0x58F

On its own, that return value is harmless — it's just a failed API call. You only see ERROR_WINDOW_NOT_COMBOBOX as an actual on-screen error when the program doesn't check the return value and then blindly uses the result. The next operation dereferences garbage, and the app crashes or throws a dialog.

Real-world triggers I've seen on the help desk:

  • An old VB6 or Delphi line-of-business app where the developer reused a variable name and passed the wrong hWnd to a helper function.
  • A UI automation script (AutoIt, UiPath, PowerShell + UIAutomation) that cached a window handle. The app re-created the control, and the script kept sending combobox messages to the stale handle.
  • An Office add-in that inspects the ribbon. The ribbon isn't a real Win32 combobox even when it looks like one, and add-ins that assume otherwise blow up when the user opens a specific dialog.
  • A screen reader or accessibility tool that misidentifies a custom control (like a WinForms owner-drawn dropdown) as a combobox.

So the fix isn't a Windows setting. It's figuring out which process is sending the bad message and stopping it.

Fix it step by step

Work through these in order. Most people fix this by step 4.

1. Note exactly when the error appears

  1. Write down the application name shown in the error dialog or in Event Viewer.
  2. Write down the exact action that triggers it — opening a form, pasting data, running a macro, starting an automation job.
  3. If the error only happens after you install or update something, note that too. Timing narrows the suspect list fast.

After this step you should have one sentence like: "Excel 2019 crashes with 0X0000058F when I click the Data tab after installing an old add-in." That sentence is your whole investigation.

2. Check Event Viewer for the offending module

  1. Press Win+R, type eventvwr.msc, hit Enter.
  2. Open Windows Logs > Application.
  3. Look for a red Error entry at the exact time the crash happened.
  4. Click it and read the Faulting module name line. That's usually the DLL or EXE that made the bad combobox call.

You should now see something like Faulting module name: oldaddin.dll, version: 1.0.0.3. That name is the thing to disable or update next.

3. Reproduce with a clean boot of the app

Most apps that trigger this error load third-party extensions. Turn them off.

  • Microsoft Office: run winword /a or excel /safe from the Run box. If the error disappears, it's an add-in. Then disable add-ins one at a time under File > Options > Add-ins > Manage COM Add-ins > Go.
  • Browsers and Electron apps: launch with --disable-extensions. If the error stops, remove the extension that touched the UI.
  • Custom line-of-business apps: look for a Plugins or Addins folder next to the EXE. Rename it temporarily and relaunch.

Expected result: the app opens normally and the error either goes away (add-in problem, confirmed) or comes back immediately (the bug is in the app itself — continue to step 5).

4. Update or remove the suspect component

  1. If Event Viewer named a specific DLL, search for it in C:\Windows\System32, the app's install folder, and %LOCALAPPDATA%\Programs.
  2. Right-click the file, choose Properties > Details, and note the Company and Product Name.
  3. Go to that vendor's site and check for an update. Old VB6-era add-ins are the worst offenders — some haven't been touched since Windows 7 was new.
  4. If no update exists, uninstall the component. There's no safe way to keep a DLL that's sending combobox messages to the wrong handle.

After the update or uninstall, reopen the app and repeat the action from step 1. The error should be gone. If it isn't, keep going.

5. Repair the host application

If the app itself is buggy, a corrupt install can make it worse.

  1. Open Settings > Apps > Installed apps.
  2. Find the app, click the three-dot menu, choose Modify (or Advanced options > Repair).
  3. For Office, use Control Panel > Programs and Features > Microsoft Office > Change > Quick Repair. If that fails, run Online Repair — it takes 20–30 minutes but replaces the entire install.
  4. Reboot before testing. Some DLLs stay loaded until restart.

You should see the repair complete with no errors. Then test the same action again.

Alternative fixes if that doesn't work

Roll back a recent update

If the error started right after a Windows cumulative update or an app update, roll it back. Settings > Windows Update > Update history > Uninstall updates. For an app, check the vendor's site for the previous installer version and reinstall it.

Run the app with a fresh user profile

Sometimes the bug is in a per-user settings file, not the code. Create a new local Windows account, sign in, and run the app. If the error is gone, your old profile has a corrupt config. Copy your documents over and keep using the new profile — it's faster than hunting for one bad XML file.

Check for stuck automation processes

If you use AutoHotkey, AutoIt, UiPath, or Power Automate Desktop, check Task Manager for leftover processes from a previous run. A stuck bot holding a stale window handle will keep firing combobox messages at nothing. Kill the process, restart the automation, and make sure the script re-acquires handles on every run instead of caching them.

Debug it yourself if you wrote the code

If this is your own application, the fix is in your code. Before sending any CB_ message, verify the target:

WCHAR cls[64];
GetClassName(hWnd, cls, 64);
if (_wcsicmp(cls, L"ComboBox") != 0) {
    // wrong handle — bail out
    return FALSE;
}

Or simpler: use GetDlgItem or the control's variable name instead of a raw handle you stored somewhere. The real fix is to never cache handles across dialog sessions. Windows recycles handles, and a recycled handle can point to a completely different control class.

Prevention

Treat every third-party add-in as a suspect until it proves itself. The majority of ERROR_WINDOW_NOT_COMBOBOX reports I've handled came from add-ins that were never updated for modern Windows.

Three habits that stop this error from coming back:

  • Uninstall add-ins you don't actively use. Old Outlook and Excel add-ins are the number one source.
  • Keep automation scripts updated and re-check window handles at the start of every run — never across runs.
  • When you build your own Win32 or WinForms UI, always check the return value of SendMessage and always call GetLastError() right after a failure. Silent failures turn into crashes later.

If the error comes back after all this, capture a dump with Task Manager > right-click the app > Create dump file and hand it to the vendor. They'll see the exact call stack that's sending the bad message, and you won't have to guess.

Related Errors in Windows Errors
0X80040160 CATID 0X80040160 doesn't exist — fix it in 5 minutes 0XC000010E STATUS_IMAGE_ALREADY_LOADED (0XC000010E) Fix 0XC00D1030 Fix Windows Media Player error 0XC00D1030 (bitmap not created) 0X00003715 Fix SXS Manifest Identity Same But Contents Different (0x00003715)

Was this solution helpful?

EP
Erropedia Team
Tech Support Editors
The Erropedia editorial team researches and documents real-world tech errors from across Windows, Linux, macOS, networking, databases, cloud platforms, and more. Every solution is reviewed for accuracy and updated as software and systems evolve.