Windowless ActiveX controls are not supported

Windowless ActiveX controls are not supported

2 Comments on Windowless ActiveX controls are not supported

In windows 7 environment you may receive “Unable to get window handle, Windowless ActiveX controls are not supported..” exception when you display a child form that contains ActiveX user controls. The user control may be a third party control. To avoid this exception you may disable DEP (Data Execution Prevention) for your activex control.

DEP (Data Execution Prevention) is a security feature from windows 7 operating system to prevent damage your system from viruses and other security threats. If your user control access memory in an incorrect way, the DEP will close the program.
If you trust the user control which you integrated in the application, you may disable the DEP for that program in following way.

Go to Control Panel -> System and Security -> System

You will get a list of options in the left side of the window.

Advanced System Settings DEP

Click on the “Advanced system settings” link, you will get System properties window.

In that System properties window, switch to Advanced tab and click on the settings button under the Perfomance section, you will get Performance Options window.

DEP System Properties

Switch to Data Execution Prevention tab and select “Turn on DEP for all programs and services except those I select:” option.

DEP Performance Option

Now the “Add…” button is enabled, then you can add the specific program which you want to disable the DEP.
This changes will apply only after you restart the system.

DEP Turn on DEP option

If you want to disable the DEP completely using the command prompt you need to do the following steps.

Select Start Menu -> All Programs -> Accessories.

You will see the Command Prompt under Accessories. Right click on the Command Prompt and select “Run as administrator”.

Enter the following command and execute it to diable DEP completely.

bcdedit.exe /set {current} nx AlwaysOff

If you want to enable DEP, you need to execute the following command.

bcdedit.exe /set {current} nx AlwaysOn

These changes will be affected after you restart the computer.

By default DEP is turned on in windows 7.

About the author:



  1. jithin  - July 13, 2014 - 6:35 PM
    Reply /

    hai thanks .. it solved one of my serious problem

  2. felipe  - August 27, 2015 - 7:15 PM
    Reply /

    I LOVE YOU!!!!!

Leave a comment



Back to Top