Activating SumatraPDF from AutoHotKey? #4376
Replies: 4 comments 4 replies
-
It should be accessible same as others but it may be running a slightly different way as it has to be able to broadcast its self controls via DDE Whenever I have tried driving with AHK GUI menus in the past it worked flawlessly Most of those features are now to some degree in main app, so have not run AHK for months so it may have changed ? For what it is worth one of my old test files is at #217 (comment) Some SumatraPDF staring behaviours may have changed since then but if you are calling the exe via shell or DDE it should launch in a similar fashion. I dont know if there may have been some changes in Windows Focus or SumatraPDF response to some newer Windows calls, but it should focus with calling the exe/dde server. You are of course using AHK32 bit for SumatraPDF32.exe and 64 for 64 ? You can not expect to breach UAC with a 32/64 mix SumatraPDF is daily brought into "Focus" (probably thousands of times) from LaTeX editors or pirate wrappers ! by calling the exe via command line or DDE the key to that command line call is -reuse-instance to recall with the named PDF but there are many other calls. |
Beta Was this translation helpful? Give feedback.
-
Let's start with: what exactly is your script doing? Post the script because Generally speaking, AHK can call any windows API so I'm sure you can solve that using AHK by grabbing Sumatra window handle and calling the necessary windows API functions to bring it to front, give focus etc. But I'm not AHK person nor do I know what exactly you're trying to achieve so can't tell you what the script would be. |
Beta Was this translation helpful? Give feedback.
-
I don't really know AHK but:
I don't see how |
Beta Was this translation helpful? Give feedback.
-
Don't use ahk_exe. Please use ahk_class, i.e: Refer to online manual |
Beta Was this translation helpful? Give feedback.
-
Sumatra PDF has behavior different from every other app I use. I have an AHK script to toggle activation of windows (for example, one key to switch between a reference PDF and the Word document I am editing). The script calls the app for activation by its exe ("SumatraPDF.exe"), but Sumatra does not come to the front and seems to not come into focus (as shortcut keys and the like do not work until I physically click the Sumatra window).
I believe I also tried by pid and had the same problem. Is there a surefire way to activate and give focus to Sumatra PDF?
Beta Was this translation helpful? Give feedback.
All reactions