Page 50 of 74
Posted: Sat May 11, 2013 5:55 am
by Instructor
Добавлено: константы vbTCHAR, vbTSTR, vbTSIZE, vbX64 для использования в VBScript.
Added: constants vbTCHAR, vbTSTR, vbTSIZE, vbX64 for using in VBScript.
Scripts plugin v12.5
Posted: Sun May 19, 2013 11:28 am
by KDJ
Instructor
I have a script that uses AkelEdit control.
When I run this script from command line (as ActiveX), the following metods are available:
AkelPad.SetEditWnd(),
AkelPad.GetSelStart(),
AkelPad.GetSelEnd(),
AkelPad.SetSel(),
AkelPad.ReplaceSel().
However, these methods do not work:
AkelPad.GetSelText(),
AkelPad.GetTextRange().
I looked at the source - IDocument.c.
These methods use GetTextRange() function that retrieves the text through main window (AKD_EXGETTEXTRANGEW message).
Can you do so that the text was taken directly from edit window (AEM_GETTEXTRANGEW)?
Posted: Wed May 22, 2013 1:49 pm
by Instructor
Изменено: методы GetSelText и GetTextRange получают текст напрямую из AkelEdit контрола.
Changed: methods GetSelText and GetTextRange retrieves text directly from AkelEdit control.
Scripts plugin v12.6
Posted: Wed May 22, 2013 6:10 pm
by KDJ
Instructor
Excellently, thank you very much.
You can still mark in documentation as +ActiveX:
AkelPad.GetEditWnd,
AkelPad.SetEditWnd,
AkelPad.GetSelStart,
AkelPad.GetSelEnd,
AkelPad.SetSel,
AkelPad.ReplaceSel,
AkelPad.GetSelText,
AkelPad.GetTextRange.
Posted: Tue Jun 18, 2013 8:06 am
by Instructor
Добавлено: методы WindowRegisterDialog, WindowUnregisterDialog - зарегистрировать диалог для обработки в цикле сообщений. Используется в случае, если диалог создан без WindowRegisterClass.
Added: methods WindowRegisterDialog, WindowUnregisterDialog - register dialog for message loop. Used if dialog created without WindowRegisterClass.
Scripts plugin v12.8
Posted: Sat Jul 13, 2013 7:11 pm
by KDJ
Instructor wrote:Только DT_BYTE unsigned, остальные signed.
viewtopic.php?p=9203#p9203
I think it has been changed.
It seems that DT_WORD is also unsigned.
You could add it in the documentation of AkelPad.MemRead().
Posted: Sun Aug 04, 2013 3:39 pm
by KDJ
A sample script run on x64:
Code: Select all
var hMainWnd = AkelPad.GetMainWnd();
var hEditWnd = AkelPad.GetEditWnd();
var hFont = AkelPad.SendMessage(hMainWnd, 1233 /*AKD_GETFONTW*/, 0, 0);
WScript.Echo(hFont);
AkelPad.SendMessage(hEditWnd, 48 /*WM_SETFONT*/, hFont, true);
Sometimes the value of hFont is negative.
In this case, there is a run-time error:
Error: Overflow
Code: 800A0006
Line: 5
Posted: Mon Aug 05, 2013 9:55 am
by Instructor
KDJ wrote:Error: Overflow
Code: 800A0006
Line: 5
Were unable to reproduce, but the problems with the large number is possible, because:
Scripts.idl wrote:...
//- JScript and VBScript doesn't understand __int64 in return value
//- VBScript doesn't support UINT in return value
...
Posted: Mon Aug 05, 2013 6:24 pm
by KDJ
Instructor wrote:Were unable to reproduce, ...
I repeated following actions 10 times:
1. Run AkelPad.
2. Run sample script.
3. Close AkelPad.
On the ten trials, in three cases, I received a negative value (eg. hFont = -485881582).
//- JScript and VBScript doesn't understand __int64 in return value
This means that many scripts can not be converted into 64-bit version.

Posted: Mon Aug 05, 2013 8:36 pm
by KDJ
Instructor
I think I found the problem solution.
Instead AkelPad.SendMessage method, should use User32::SendMessage function.
Code: Select all
var oSys = AkelPad.SystemFunction();
var hMainWnd = AkelPad.GetMainWnd();
var hEditWnd = AkelPad.GetEditWnd();
var hFont = AkelPad.SendMessage(hMainWnd, 1233 /*AKD_GETFONTW*/, 0, 0);
var nObjType = oSys.Call("Gdi32::GetObjectType", hFont);
WScript.Echo("hFont: " + hFont + "\nnObjType: " + nObjType + "\n\n(6=OBJ_FONT)");
//AkelPad.SendMessage(hEditWnd, 48 /*WM_SETFONT*/, hFont, true);
oSys.Call("User32::SendMessageW", hEditWnd, 48 /*WM_SETFONT*/, hFont, true);
It seems to me that AkelPad.SendMessage method not tolerate negative value as a parameter (on x64).
Posted: Sun Sep 08, 2013 6:33 am
by Instructor
Исправлено: передача отрицательных значений методу SendMessage на Windows x64.
Fixed: passing negative values to SendMessage method on Windows x64.
Scripts plugin v12.9
Posted: Sun Sep 08, 2013 2:29 pm
by KDJ
It seems, that now can pass a text parameter directly eg.:
AkelPad.SendMessage(hWnd, 0x143 /*CB_ADDSTRING*/, 0, "Text");
Posted: Sun Sep 08, 2013 8:46 pm
by KDJ
On Win7 does not work:
AkelPad.Exec("regedit.exe");
Posted: Mon Sep 09, 2013 4:30 am
by Instructor
KDJ
Probably UAC blocks. You can check it by running AkelPad.exe as admin.
Posted: Mon Sep 09, 2013 7:58 pm
by KDJ
Instructor
Oh yeah, as admin it works. Thanks.
This can be done also in this way (without admin privileges):
AkelPad.Exec("rundll32.exe shell32, ShellExec_RunDLL regedit.exe");