AkelPad Forum Index AkelPad
Support forum
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Scripts plugin
Goto page Previous  1, 2, 3 ... 49, 50, 51 ... 56, 57, 58  Next
 
Post new topic   Reply to topic    AkelPad Forum Index -> Plugins
View previous topic :: View next topic  
Author Message
Instructor
Site Admin


Joined: 06 Jul 2006
Posts: 5510

PostPosted: Sat May 11, 2013 5:55 am    Post subject: Reply with quote

Добавлено: константы vbTCHAR, vbTSTR, vbTSIZE, vbX64 для использования в VBScript.

Added: constants vbTCHAR, vbTSTR, vbTSIZE, vbX64 for using in VBScript.


Scripts plugin v12.5
Back to top
View user's profile Send private message Send e-mail
KDJ



Joined: 06 Mar 2010
Posts: 1437
Location: Poland

PostPosted: Sun May 19, 2013 11:28 am    Post subject: Reply with quote

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)?
Back to top
View user's profile Send private message
Instructor
Site Admin


Joined: 06 Jul 2006
Posts: 5510

PostPosted: Wed May 22, 2013 1:49 pm    Post subject: Reply with quote

Изменено: методы GetSelText и GetTextRange получают текст напрямую из AkelEdit контрола.

Changed: methods GetSelText and GetTextRange retrieves text directly from AkelEdit control.


Scripts plugin v12.6
Back to top
View user's profile Send private message Send e-mail
KDJ



Joined: 06 Mar 2010
Posts: 1437
Location: Poland

PostPosted: Wed May 22, 2013 6:10 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Instructor
Site Admin


Joined: 06 Jul 2006
Posts: 5510

PostPosted: Tue Jun 18, 2013 8:06 am    Post subject: Reply with quote

Добавлено: методы WindowRegisterDialog, WindowUnregisterDialog - зарегистрировать диалог для обработки в цикле сообщений. Используется в случае, если диалог создан без WindowRegisterClass.

Added: methods WindowRegisterDialog, WindowUnregisterDialog - register dialog for message loop. Used if dialog created without WindowRegisterClass.


Scripts plugin v12.8
Back to top
View user's profile Send private message Send e-mail
KDJ



Joined: 06 Mar 2010
Posts: 1437
Location: Poland

PostPosted: Sat Jul 13, 2013 7:11 pm    Post subject: Reply with quote

Instructor wrote:
Только DT_BYTE unsigned, остальные signed.

http://akelpad.sourceforge.net/forum/viewtopic.php?p=9203#9203

I think it has been changed.
It seems that DT_WORD is also unsigned.
You could add it in the documentation of AkelPad.MemRead().
Back to top
View user's profile Send private message
KDJ



Joined: 06 Mar 2010
Posts: 1437
Location: Poland

PostPosted: Sun Aug 04, 2013 3:39 pm    Post subject: Reply with quote

A sample script run on x64:
Code:
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
Back to top
View user's profile Send private message
Instructor
Site Admin


Joined: 06 Jul 2006
Posts: 5510

PostPosted: Mon Aug 05, 2013 9:55 am    Post subject: Reply with quote

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
...
Back to top
View user's profile Send private message Send e-mail
KDJ



Joined: 06 Mar 2010
Posts: 1437
Location: Poland

PostPosted: Mon Aug 05, 2013 6:24 pm    Post subject: Reply with quote

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).

Quote:
//- JScript and VBScript doesn't understand __int64 in return value

This means that many scripts can not be converted into 64-bit version. Crying or Very sad
Back to top
View user's profile Send private message
KDJ



Joined: 06 Mar 2010
Posts: 1437
Location: Poland

PostPosted: Mon Aug 05, 2013 8:36 pm    Post subject: Reply with quote

Instructor
I think I found the problem solution. Very Happy
Instead AkelPad.SendMessage method, should use User32::SendMessage function.
Code:
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).
Back to top
View user's profile Send private message
Instructor
Site Admin


Joined: 06 Jul 2006
Posts: 5510

PostPosted: Sun Sep 08, 2013 6:33 am    Post subject: Reply with quote

Исправлено: передача отрицательных значений методу SendMessage на Windows x64.

Fixed: passing negative values to SendMessage method on Windows x64.


Scripts plugin v12.9
Back to top
View user's profile Send private message Send e-mail
KDJ



Joined: 06 Mar 2010
Posts: 1437
Location: Poland

PostPosted: Sun Sep 08, 2013 2:29 pm    Post subject: Reply with quote

It seems, that now can pass a text parameter directly eg.:
AkelPad.SendMessage(hWnd, 0x143 /*CB_ADDSTRING*/, 0, "Text");
Back to top
View user's profile Send private message
KDJ



Joined: 06 Mar 2010
Posts: 1437
Location: Poland

PostPosted: Sun Sep 08, 2013 8:46 pm    Post subject: Reply with quote

On Win7 does not work:
AkelPad.Exec("regedit.exe");
Back to top
View user's profile Send private message
Instructor
Site Admin


Joined: 06 Jul 2006
Posts: 5510

PostPosted: Mon Sep 09, 2013 4:30 am    Post subject: Reply with quote

KDJ
Probably UAC blocks. You can check it by running AkelPad.exe as admin.
Back to top
View user's profile Send private message Send e-mail
KDJ



Joined: 06 Mar 2010
Posts: 1437
Location: Poland

PostPosted: Mon Sep 09, 2013 7:58 pm    Post subject: Reply with quote

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");
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AkelPad Forum Index -> Plugins All times are GMT
Goto page Previous  1, 2, 3 ... 49, 50, 51 ... 56, 57, 58  Next
Page 50 of 58

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


SourceForge.net Logo Powered by phpBB © 2001, 2005 phpBB Group