How to start AkelPAD always single open file mode from cmd

English main discussion
Post Reply
  • Author
  • Message
Offline
Posts: 3
Joined: Thu Dec 01, 2011 2:19 pm

How to start AkelPAD always single open file mode from cmd

Post 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?

KDJ
Offline
Posts: 1949
Joined: Sat Mar 06, 2010 7:40 pm
Location: Poland

Post by KDJ »

HonestQiao
Main menu -> Options -> Don't open a file twice.

Offline
Posts: 3
Joined: Thu Dec 01, 2011 2:19 pm

Post by HonestQiao »

But I want open akelpad from command line ,and set single open file on.

KDJ
Offline
Posts: 1949
Joined: Sat Mar 06, 2010 7:40 pm
Location: Poland

Post 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")
Post Reply