Url with dde server

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
haichen
Posts: 631
Joined: 09 Feb 2014, 08:24

Url with dde server

09 Apr 2016, 05:02

I'd like to get seans dde code to work with my firefox. It works without a problem at a windows 7 pc at work, but on my win10 at home it only gets the url of the "about:" sites of firefox

Code: Select all

browser:="Firefox"
msgbox, %  FF_RetrievePageName(browser)
return 

FF_RetrievePageName(browser)
   {
   DllCall("DdeInitializeW","UPtrP",idInst,"Uint",0,"Uint",0,"Uint",0)
   ; CP_WINANSI = 1004   CP_WINUNICODE = 1200
 
  CP_WIN:=A_IsUnicode?1200:1004
   hServer := DllCall("DdeCreateStringHandleW","UPtr",idInst,"Str",browser,"int",cp_win)
   hTopic  := DllCall("DdeCreateStringHandleW","UPtr",idInst,"Str","WWW_GetWindowInfo","int",cp_win)
   hItem   := DllCall("DdeCreateStringHandleW","UPtr",idInst,"Str","0xFFFFFFFF","int",cp_win)
   hConv := DllCall("DdeConnect","UPtr",idInst,"UPtr",hServer,"UPtr",hTopic,"Uint",0)
   ; CF_TEXT = 1      CF_UNICODETEXT = 13
   CF_TEXT :=1
  
   hData := DllCall("DdeClientTransaction","Uint",0,"Uint",0,"UPtr",hConv,"UPtr",hItem,"UInt",   CF_TEXT,"Uint",0x20B0,"Uint",10000,"UPtrP",nResult)
; seems to fail at hData

   sData := DllCall("DdeAccessData","Uint",hData,"Uint",0,"str")
 msgbox, % hserver " " hTopic  " " hItem " "  hConv  " " hData " sData" sData
   DllCall("DdeFreeStringHandle","UPtr",idInst,"UPtr",hServer)
   DllCall("DdeFreeStringHandle","UPtr",idInst,"UPtr",hTopic)
   DllCall("DdeFreeStringHandle","UPtr",idInst,"UPtr",hItem)
   DllCall("DdeUnaccessData","UPtr",hData)
   DllCall("DdeFreeDataHandle","UPtr",hData)
   DllCall("DdeDisconnect","UPtr",hConv)
   DllCall("DdeUninitialize","UPtr",idInst)
   result:=StrGet(&sData,"cp0")
   return result
   }
User avatar
haichen
Posts: 631
Joined: 09 Feb 2014, 08:24

Re: Url with dde server

09 Apr 2016, 06:22

With dde-monitor I get this status messages:
firefox 45.0.1 does not work at all
Time: 22517828 Task: 1748 Message [DDE_INITIATE]
Time: 22517828 Task: 1748 Error [NO_CONV_ESTABLISHED]
Time: 22519875 Task: 1748 Error [INVALIDPARAMETER]
Time: 22520781 Task: 1748 String Deleted ["Firefox"]
Time: 22520781 Task: 1748 String Deleted ["WWW_GetWindowInfo"]
Time: 22520781 Task: 1748 String Deleted ["0xFFFFFFFF"]
Time: 22520781 Task: 1748 Error [INVALIDPARAMETER]

firefox nightly normal website
Time: 22199046 Task: a1c Message [DDE_INITIATE]
Time: 22199046 Task: 1104 Callback [CONNECT]
Time: 22199046 Task: 1104 Message [DDE_ACK]
Time: 22199046 Task: 1104 Callback [CONNECT_CONFIRM]
Time: 22199046 Task: a1c Conversation established: Service="Firefox" Topic="WWW_GetWindowInfo"
Time: 22200375 Task: a1c Message [DDE_REQUEST]
Time: 22200375 Task: 1104 Callback [REQUEST]
Time: 22200375 Task: 1104 Message [DDE_ACK]
Time: 22200375 Task: a1c Error [NOTPROCESSED]
Time: 22201187 Task: a1c String Deleted ["Firefox"]
Time: 22201187 Task: a1c String Deleted ["WWW_GetWindowInfo"]
Time: 22201187 Task: a1c String Deleted ["0xFFFFFFFF"]
Time: 22201187 Task: a1c Message [DDE_TERMINATE]
Time: 22201187 Task: a1c Conversation terminated: Service="Firefox" Topic="WWW_GetWindowInfo"
Time: 22201187 Task: 1104 Message [DDE_TERMINATE]
Time: 22201187 Task: 1104 Callback [DISCONNECT]

firefox nightly about:new tab Works!
Time: 22364468 Task: 2720 Message [DDE_INITIATE]
Time: 22364468 Task: 1104 Callback [CONNECT]
Time: 22364468 Task: 1104 Message [DDE_ACK]
Time: 22364468 Task: 1104 Callback [CONNECT_CONFIRM]
Time: 22364468 Task: 2720 Conversation established: Service="Firefox" Topic="WWW_GetWindowInfo"
Time: 22367125 Task: 2720 Message [DDE_REQUEST]
Time: 22367125 Task: 1104 Callback [REQUEST]
Time: 22367125 Task: 1104 Message [DDE_DATA] Format="TEXT" Value=""about:newtab","New Tab","""
Time: 22369578 Task: 2720 String Deleted ["Firefox"]
Time: 22369578 Task: 2720 String Deleted ["WWW_GetWindowInfo"]
Time: 22369578 Task: 2720 String Deleted ["0xFFFFFFFF"]
Time: 22369578 Task: 2720 Message [DDE_TERMINATE]
Time: 22369578 Task: 2720 Conversation terminated: Service="Firefox" Topic="WWW_GetWindowInfo"
Time: 22369578 Task: 1104 Message [DDE_TERMINATE]
Time: 22369578 Task: 1104 Callback [DISCONNECT]
HotKeyIt
Posts: 2364
Joined: 29 Sep 2013, 18:35
Contact:

Re: Url with dde server

09 Apr 2016, 06:46

Seems to work fine for me on Win 10 Firefox 45.0.1.
Guest

Re: Url with dde server

09 Apr 2016, 07:00

Maybe have a look at this extended and updated version by atnbueno:
Get the URL of the current (active) browser tab
:arrow: https://autohotkey.com/boards/viewtopic.php?f=6&t=3702
User avatar
haichen
Posts: 631
Joined: 09 Feb 2014, 08:24

Re: Url with dde server

09 Apr 2016, 07:43

Thank you very much for testing!
Could it be x86 / x64 problem? At work (code is working) i've a x64 hardware/windows. But i don't believe this..
I know i used this code some time ago...before win10 ...i think it was xp. :-)
I also deactiveted my addons without improvement.
User avatar
haichen
Posts: 631
Joined: 09 Feb 2014, 08:24

Re: Url with dde server

09 Apr 2016, 10:58

I got it working with setting firefox (nighly) multi-process option (e10s) off.
User avatar
haichen
Posts: 631
Joined: 09 Feb 2014, 08:24

Re: Url with dde server

10 Apr 2016, 09:30

Dear guest,
atnbueno's function also doesnt work with firefox multi-process option which will be activated in future versions of firefox.
Guest

Re: Url with dde server

10 Apr 2016, 12:33

Hey Haichen,
Well.. If you tell him he will probably update it ;)

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: No registered users and 91 guests