如何获取网页窗口句柄 [英] How to get web page window handle

查看:320
本文介绍了如何获取网页窗口句柄的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


在我的项目中有一个处理Windows句柄的C ++ DLL。它通常被编写为与Old Gupta Sql Windows应用程序一起使用。现在我们必须在.net Web应用程序中重用相同的dll。我们可以通过interop和mershalling从C#代码中调用
C ++ dll的所有方法。但现在的问题是如何从Web应用程序传递Windows句柄参数。如果我们使用Web表单应用程序如何将当前网页句柄传递给C ++ DLL方法
?请帮助!!


谢谢,


Prabhat Ghosh。

解决方案

< blockquote>

您是否构建了一个Web应用程序?如果是这样,那么您将无法使用C ++ DLL来获取Web浏览器窗口。 Web浏览器位于客户端上,您的所有代码都在服务器上运行。唯一可以访问Web浏览器的代码是客户端
端JavaScript代码。 JavaScript不能调用您的C ++ DLL,也不能调用除JavaScript以外的任何其他内容(如果您碰巧在较旧的IE版本上运行且网络团队未禁用支持,则可能使用ActiveX)。


有关Web开发的问题,请在ASP.NET
论坛
上发布。


Michael Taylor

http://www.michaeltaylorp3.net


Hi,

In my project there is a C++ dll that deals with windows handle. It was typically written to be used with Old Gupta Sql windows application. Now we will have to reuse the same dll in .net web application. we could able to call all the methods of the C++ dll from C# code through interop and mershalling. But now the question is how to pass the windows handle parameter from the web application. If we use web form application how to pass the current web page handle to the C++ dll method ? Please help!!

Thanks,

Prabhat Ghosh.

解决方案

Are you build a web app? If so then you aren't going to be able to use a C++ DLL to get the web browser window. The web browser is on the client, all your code is running on the server. The only code that has access to the web browser is the client side JavaScript code. JavaScript cannot call your C++ DLL nor anything other than JavaScript (and maybe ActiveX if you happen to be running on an older IE version and the network team hasn't disabled support).

For further questions related to web development please post in the ASP.NET forums.

Michael Taylor
http://www.michaeltaylorp3.net


这篇关于如何获取网页窗口句柄的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆