GUI Application: Single instance to capture parameters on repeated launch
Posted: 11 Apr 2023, 07:28
Hi,
I have been using Hiedit.dll(4.0.04),HiEdit.ahk and Ahk2Exe.exe to write an editor application.
In general, I am very happy with the result (no text wrapping - but that's ok). From within the application, I can open and close files with the dialogs or using drag and drop.
However, I am having trouble with SingleInstance. When talking about text editors, single instance usually means "any repeated attempts to launch the editor will simply revert to the first running instance AND open any new filename parameter in a new tab".
I use an Xtree like file manager, and would like to be able to leave the editor open and then open further files by calling the exe with a filename parameter.
The top of my code is currently:
Is there a way to achieve this behaviour in my compiled AHK application?
Kind Regards Gavin Holt
I have been using Hiedit.dll(4.0.04),HiEdit.ahk and Ahk2Exe.exe to write an editor application.
In general, I am very happy with the result (no text wrapping - but that's ok). From within the application, I can open and close files with the dialogs or using drag and drop.
However, I am having trouble with SingleInstance. When talking about text editors, single instance usually means "any repeated attempts to launch the editor will simply revert to the first running instance AND open any new filename parameter in a new tab".
I use an Xtree like file manager, and would like to be able to leave the editor open and then open further files by calling the exe with a filename parameter.
The top of my code is currently:
Code: Select all
;# A Programmable Editor Gavin Holt
; Standing upon the shoulders of giants, developed borrowing from various scripts:
; - HiEdit.dll Antonis Kyprianou (akyprian)
; - HiEdit.ahk Miodrag Milic (majkinetor)
; - HiEdit _test.ahk Magnetometer
; - AHKPAd Michael Peters
; - QuickAHK (jballi)
; - Vic Editor Normand Lamoureux (Normand)
;
;# Setup AHK Environment
#SingleInstance Off
#NoEnv
#NoTrayIcon
#MaxMem 128
SetWorkingDir, %A_ScriptDir%
AutoTrim,Off
SetBatchLines,-1
SetControlDelay,-1
SetWinDelay,-1
ListLines, Off
DetectHiddenWindows, On
SetTitleMatchMode,2
SendMode, Input
Process,Priority,,A
CoordMode, Mouse, Relative
Kind Regards Gavin Holt