检索当前浏览器的URL:DDE [英] Retrieving current browser's URL: DDE

查看:118
本文介绍了检索当前浏览器的URL:DDE的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用以下代码检索URL

I use the following code to retrieve the URL

DWORD dwDDEInst=0;
WCHAR szService[]=L"…",szTopic[]=L"WWW_GetWindowInfo",szCommand[]=L"URL";
if(!DdeInitialize(&dwDDEInst,DdeCallback,APPCLASS_STANDARD | APPCMD_CLIENTONLY,0)){
	HSZ hService=DdeCreateStringHandle(dwDDEInst,szService,0),hTopic=DdeCreateStringHandle(dwDDEInst,szTopic,0);
	HCONV hConv=DdeConnect(dwDDEInst,hService,hTopic,0);
	if(hConv){
		HSZ hCommand=DdeCreateStringHandle(dwDDEInst,szCommand,0);
		HDDEDATA hData=DdeClientTransaction(0,0,hConv,hCommand,CF_TEXT,XTYP_REQUEST,1234,0);
		if(hData){
			DWORD dwLen=DdeGetData(hData,0,0,0);
			if(dwLen){
				PCH pszData=new char[++dwLen];
				DdeGetData(hData,(PBYTE)pszData,dwLen,0);
				MessageBoxA(hDlg,pszData,0,0);
				delete pszData;
			}
			DdeFreeDataHandle(hData);
		}
		DdeFreeStringHandle(dwDDEInst,hCommand);
		DdeDisconnect(hConv);
	}
	DdeFreeStringHandle(dwDDEInst,hService);DdeFreeStringHandle(dwDDEInst,hTopic);
	DdeUninitialize(dwDDEInst);
}

并对其行为有疑问。

如果  szService  是"歌剧" ;,它工作得很好,但是当  szService  是" IEXPLORE" ;,
DdeClientTransaction  返回  DMLERR_NOTPROCESSED。仅当 szService  是"0xFFFFFFFF"时,它才有效。那么,
问题1 :我在哪里可以阅读有关此类行为的内容?

If szService is "Opera", it works fine, but when szService is "IExplore", DdeClientTransaction returns DMLERR_NOTPROCESSED. It works only when szService is "0xFFFFFFFF". So, question 1: where can I read about such behavior?

我发现了许多对http://support.microsoft的引用.com / kb / 160957,但当我打开它时,我被重定向到https://support.microsoft.com/en-us/help/160957,告诉这个↓

I've found many references to http://support.microsoft.com/kb/160957, but when I open it, I'm redirected to https://support.microsoft.com/en-us/help/160957 which tells this ↓


此页面不存在。

This page doesn’t exist.

所以,问题2 :在哪里可以找到DDE命令列表?

So, question 2: where to find DDE commands list?

正如您在我的代码中看到的,它有Unicode字符集,但 C F_TEXT 的以  DdeClientTransaction让我到一个URL从MB转化为WC,但是当我使用
CF_UNICODETEXT 的,  DdeClientTransaction 的 再次返回&NBSP ; DMLERR_NOTPROCESSED。那么,
问题3 :如何检索Unicode字符串?

As you may see in my code, it has Unicode charset, but CF_TEXT in DdeClientTransaction makes me to convert an URL from MB to WC, but when I use CF_UNICODETEXTDdeClientTransaction again returns DMLERR_NOTPROCESSED. So, question 3: how then can I retrieve a Unicode string?

当涉及Opera检测时,它也存在一些问题。我安装了2个Opera:Opera Classic,12.18,Opera基于Chromium。  szService == " Opera"仅适用于Opera Classic,所以
问题4 :如何区分这些歌剧?

When it comes to Opera detection, it also has some problems. I have 2 Operas installed: Opera Classic, which is 12.18, and Opera based on Chromium. szService=="Opera" works only for Opera Classic, so question 4: how to differ these Operas?

如果我跌倒我会在我去天堂的途中出现

If I fall I will arise on my way to paradise

推荐答案

感谢您的回答!这不是那么有用,但总比没有好。)

Thank you for your answer! This is not so informative but much better than nothing :)

仍然对其他问题的答案感兴趣。

Still interested in answers to other questions.


这篇关于检索当前浏览器的URL:DDE的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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