Scripts discussion (2)
- Author
- Message
-
Offline
- Posts: 1949
- Joined: Sat Mar 06, 2010 7:40 pm
- Location: Poland
Gentlemen, if anyone can help me in this topic:
viewtopic.php?p=17639&hilit=#p17639
viewtopic.php?p=17639&hilit=#p17639
-
Offline
- Posts: 2247
- Joined: Tue Aug 07, 2007 2:03 pm
- Location: Vinnitsa, Ukraine
KDJ
You have used very destructive workaround. There is direct direct solution. I show it on instance of SelectionOpenInTab.js, it applicable to other scripts.Fixed: conflict with Templates plugin.
Last edited by FeyFre on Fri Apr 13, 2012 8:00 pm, edited 1 time in total.
-
Offline
- Posts: 2247
- Joined: Tue Aug 07, 2007 2:03 pm
- Location: Vinnitsa, Ukraine
Gentlemen, if anyone can help me in this topic:
You are on the right way. Preferred way is to use user32.dll LoadImageA/W. You can read more here. Do not forget to use DestroyIcon on received handle after it is not needed any more.But I don't know, how to get the handle to the icon contained in a file (.exe, .dll or .ico).
Maybe using LoadIcon() or LoadImage() functions.
-
Offline
- Posts: 1949
- Joined: Sat Mar 06, 2010 7:40 pm
- Location: Poland
Great, now the entire script takes only four lines.FeyFre wrote:Yo can just make special invocation of IDM_FILE_NEW command.
Code: Select all
var pSelTxt;
if (AkelPad.GetEditWnd() && (AkelPad.IsMDI() > 0) && (pSelTxt = AkelPad.GetSelText()))
{
AkelPad.SendMessage(AkelPad.GetMainWnd(), 273 /*WM_COMMAND*/, 4101 /*wParam=MAKEWPARAM(0,IDM_FILE_NEW)*/, 1 /*lParam=TRUE*/);
AkelPad.ReplaceSel(pSelTxt);
}
-
Offline
- Posts: 1949
- Joined: Sat Mar 06, 2010 7:40 pm
- Location: Poland
I need to get the icon from Scripts.dll.FeyFre wrote:You are on the right way. Preferred way is to use user32.dll LoadImageA/W.
Unfortunately, the following code does not work:
Code: Select all
hIcon = AkelPad.SystemFunction().Call("User32::LoadImageW",
AkelPad.GetInstanceDll(), //hinst
"1", //lpszName
1, //uType=IMAGE_ICON
0, //cxDesired
0, //cyDesired
0x00000040); //fuLoad=LR_DEFAULTSIZE
WScript.Echo(hIcon);
-
Offline
- Site Admin
- Posts: 6311
- Joined: Thu Jul 06, 2006 7:20 am
KDJ
Code: Select all
var oSys=AkelPad.SystemFunction();
var hIconScripts=oSys.Call("user32::LoadIcon" + _TCHAR, AkelPad.GetInstanceDll(), 101 /*IDI_ICON_PLUGIN*/);
AkelPad.SendMessage(AkelPad.GetMainWnd(), 0x0080 /*WM_SETICON*/, 1 /*ICON_BIG*/, hIconScripts);
...
oSys.Call("user32::DestroyIcon", hIconScripts);
-
Offline
- Posts: 1949
- Joined: Sat Mar 06, 2010 7:40 pm
- Location: Poland
CSVToColumnText.js
FileInfo.js
PluginText.js
PlugTextReadFromIni.js
PlugTextToAkelPad.js
SelectionOpenInTab.js
Changed: solution of conflict with Templates plugin, according to FeyFre idea.
FileInfo.js
PluginText.js
PlugTextReadFromIni.js
PlugTextToAkelPad.js
SelectionOpenInTab.js
Changed: solution of conflict with Templates plugin, according to FeyFre idea.
-
Offline
- Posts: 1949
- Joined: Sat Mar 06, 2010 7:40 pm
- Location: Poland
InputBox_function.js
Added: icon from Scripts.dll on title bar.
Changed: now window width adjusts to the length of title string and label string.
Added: icon from Scripts.dll on title bar.
Changed: now window width adjusts to the length of title string and label string.
-
Offline
- Posts: 1949
- Joined: Sat Mar 06, 2010 7:40 pm
- Location: Poland
-
Offline
- Posts: 670
- Joined: Thu Jun 03, 2010 8:47 am
- Location: Сочи, Хоста
- Contact:
Infocatcher у Вас есть скрипт moveResizeWindow.js, который изменяет положение/размеры окна. А можно ли сделать в нём параметр восстановления размеров и положения. К примеру мы растянули по ширине, а хочется вернуть обратно. Конечно в идеале было бы лучше , чтобы одна и та же кнопка и изменяла положение и возвращала при повторном нажатии
-
Offline
- Posts: 1862
- Joined: Mon Aug 06, 2007 1:07 pm
- Contact:
Andrey_A_A
Готово:
moveResizeWindow.js
Если окно уже находится в заданном положении, будет восстановлено предыдущее положение окна.
И добавлен параметр -allowRestore для возможности отключения (по умолчанию включено).
Готово:
moveResizeWindow.js
Если окно уже находится в заданном положении, будет восстановлено предыдущее положение окна.
И добавлен параметр -allowRestore для возможности отключения (по умолчанию включено).