AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Open File in Editor
Goto page Previous  1, 2
 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
moorpipe



Joined: 04 Oct 2006
Posts: 19

PostPosted: Mon Oct 09, 2006 3:40 pm    Post subject: Reply with quote

Titan wrote:
moorpipe wrote:
WinMenuSelectItem. Sorry, call me nitpicking, but even the slightest flickering isn't good enough for me. My project should be able to open files quickly one after the other.
Try SendMessage.

Yes, much better. Like Method 3.
PhiLho wrote:
Frankly, I didn't read all the messages of the topic, but I believe it is not possible to find an universal solution, it will necessarily depends on the target editor. For some, like Notepad, it isn't possible at all. For others, like SciTE, you can, for example, activate the unique instance option (lot of editors have this one) or when knowing well the code, use the mechanism used in this option: when unique instance is activated, a new instance is always created. It checks if there is already a running instance (various methods), then either exit (nothing to do more) or send to the old instance the command line parameters to process (like a new file name/path) and exit.
Some programs use DDE for this (out of fashion), others WM_COPYDATA message, etc.

Hmm.. that would explain a lot. I did tests with Notepad and EditPlus and the results were not always predictable. I knew I had to deal with differences like window handles and ClassNN names (Notepad: Edit1; EditPlus: AfxFrameOrView42s1), but didn't realize that the behaviour of some functions depend on the target. How could I be so naive.

I guess I have to drop the idea to create an universal solution. Making separate routines for the most used / popular editors would be very hard if not impossible (e.g. EditPlus supports DDE, but AHK doesn't - well, maybe indirectly via DllCall).
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group