Page 1 of 1

How to start AkelPAD always single open file mode from cmd

Posted: Thu Dec 01, 2011 2:34 pm
by HonestQiao
If we open akelpad from command line ,we can use param "/Command(4255)" to set single open file mode.

But it's toggle for single open file.
How to set single open file on always?

Posted: Thu Dec 01, 2011 5:37 pm
by KDJ
HonestQiao
Main menu -> Options -> Don't open a file twice.

Posted: Fri Dec 02, 2011 3:26 am
by HonestQiao
But I want open akelpad from command line ,and set single open file on.

Posted: Fri Dec 02, 2011 7:32 pm
by KDJ
HonestQiao
You can use the script SingleOpenFileSetOn.js:

Code: Select all

var hMenuMain = AkelPad.SendMessage(AkelPad.GetMainWnd(), 1222 /*AKD_GETMAININFO*/, 21 /*MI_MENUMAIN*/, 0);
var nOptionState = AkelPad.SystemFunction().Call("user32::GetMenuState", hMenuMain, 4255 /*IDM_OPTIONS_SINGLEOPEN_FILE*/, 0 /*MF_BYCOMMAND*/);

if (! (nOptionState & 0x8 /*MF_CHECKED*/))
  AkelPad.Command(4255 /*IDM_OPTIONS_SINGLEOPEN_FILE*/);
in command line:

Code: Select all

AkelPad.exe /Call("Scripts::Main", 2, "SingleOpenFileSetOn.js")