我做了一个很简单的控件(基于ATL),就是画了个矩形框,然后写了它的鼠标左键的事件来启动进程运行一个exe程序。
在MFC的对话框应用程序中使用控件,很正常的把这个exe程序启动了
但在网页中没有任何反应。
大家有在网页中使用控件的吗
有兴趣的做个小实验吧顺便贴点代码,谢谢!!

解决方案 »

  1.   

    It will/should never automatically launch an executable if the page is located on an HTTP/HTTPS server (assuming default security settings). You can't without changing your default security settings, or adding the site you are loading the page from to your list of Trusted Sites. No. If there were a way for an "honest guy like you" to run a local EXE unprompted, then there would be a way for a malicious person to run a local EXE unprompted. Not being able to do what you want to do is a GOOD 
    thing. If you're running IE5.5 or better, try changing your "web" page to .hta (HyperText Application) -- which can be used to turn IE into an application "shell". HTA's are automatically afforded security permissions that should allow you to manipulate your system any way you like (without certs, etc...). 
    http://groups.google.com/group/microsoft.public.inetexplorer.scripting/browse_frm/thread/2af70e0b67bb0c2d/4dd455f90c20dc20?lnk=st&q=shellexecute+activex&rnum=24&hl=en#4dd455f90c20dc20