Class RichEdit - update on 2015-04-14 (v0.1.05.00)

Post your working scripts, libraries and tools
just me
Posts: 5082
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: Class RichEdit - rich edit control for AHK (Unicode)

13 Mar 2015, 01:35

Hi iPhilip,

not the class as is, but you might use the wrapped messages. However, to work with controls of other applications you'll have to put the structures used with the mesages into the memory of the remote process and get the results from there, considering the bitness of the remote process.
iPhilip
Posts: 248
Joined: 02 Oct 2013, 12:21

Re: Class RichEdit - rich edit control for AHK (Unicode)

13 Mar 2015, 10:15

I guess it's harder than the simple attempt below. I am not sure how to "put the structures used with the messages into the memory of the remote process".

Code: [Select all] [Expand] [Download] (Script.ahk)GeSHi © Codebox Plus

Windows 7 Pro (64 bit) - AutoHotkey v1.1+ (Unicode 32-bit)
just me
Posts: 5082
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: Class RichEdit - rich edit control for AHK (Unicode)

13 Mar 2015, 11:16

Do you want to use the FindText dialog with an Edit of another application? That's not actually related to the class.
m3user
Posts: 107
Joined: 17 Jan 2014, 18:11

Re: Class RichEdit - rich edit control for AHK (Unicode)

16 Mar 2015, 14:30

Thank you for this great class!

I have one question: after some text is entered in the control - is to possible to determine if the text was actually formatted in any way (contains any rtf formatting) or is it just a plain non-formatted text?
m3user
Posts: 107
Joined: 17 Jan 2014, 18:11

Re: Class RichEdit - rich edit control for AHK (Unicode)

19 Mar 2015, 10:38

Pasting images actually works on my Win 8.1 64bit, however not on Win 7. Any idea what might be the issue?
just me
Posts: 5082
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: Class RichEdit - rich edit control for AHK (Unicode)

20 Mar 2015, 02:19

m3user wrote:I have one question: after some text is entered in the control - is to possible to determine if the text was actually formatted in any way (contains any rtf formatting) or is it just a plain non-formatted text?
I do not understand the question. All text contained in the control is RTF formatted.

Any idea what might be the issue?
Yes, with Win 8 new features where added to the rich edit control and others.
m3user
Posts: 107
Joined: 17 Jan 2014, 18:11

Re: Class RichEdit - rich edit control for AHK (Unicode)

20 Mar 2015, 19:18

Sorry, I mean is there a way to determine if the text in the control is still in default format or the formatting has changed?

Regarding pictures, does this mean it is not possible to paste pictures to Rtf controls in Win 7 at all or this is just AutoHotkey issue?
just me
Posts: 5082
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: Class RichEdit - rich edit control for AHK (Unicode)

21 Mar 2015, 01:11

You might use GetCharFormat() and/or GetParaFormat().

You're running the same script and the control isn't one of AHK's built-in. How could it be an AHK issue?
m3user
Posts: 107
Joined: 17 Jan 2014, 18:11

Re: Class RichEdit - rich edit control for AHK (Unicode)

26 Mar 2015, 06:42

Thanks just me, this helped!

Another question: I'm sometimes using russian language layout and when a western only font is selected it automatically changes a keyboard layout to EN. Is there a way to correct this? The language layout should not change. Thanks!
just me
Posts: 5082
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: Class RichEdit - rich edit control for AHK (Unicode)

26 Mar 2015, 09:23

I cannot see how the script would change the keyboard layout.
m3user
Posts: 107
Joined: 17 Jan 2014, 18:11

Re: Class RichEdit - rich edit control for AHK (Unicode)

26 Mar 2015, 09:48

I do this (default language RU)
- run RichEdit_sample.ahk
- select one word and open a font dialog,
- select a font with Script=Western

Now whenever if I move a cursor to this word, language layout changes to EN, when I move cursor to other words, it goes back to RU.

I tried msgbox % RE2.GetRTF() and the rtf code shows lang changes.
just me
Posts: 5082
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: Class RichEdit - rich edit control for AHK (Unicode)

26 Mar 2015, 21:34

OK, this might be caused by

Code: [Select all] [Download] GeSHi © Codebox Plus

      ; Initialize control
; EM_SETLANGOPTIONS = 0x0478 (WM_USER + 120)
; IMF_AUTOKEYBOARD = 0x01, IMF_AUTOFONT = 0x02
SendMessage, 0x0478, 0, 0x03, , ahk_id %HWND%
within the __New() method. You might try to comment it out.
m3user
Posts: 107
Joined: 17 Jan 2014, 18:11

Re: Class RichEdit - rich edit control for AHK (Unicode)

27 Mar 2015, 17:01

thanks, this did the trick. Thanks for your support just me!
m3user
Posts: 107
Joined: 17 Jan 2014, 18:11

Re: Class RichEdit - rich edit control for AHK (Unicode)

07 Apr 2015, 06:45

possible bug?
- select few lines of text and change the font size and color,
- apply Format/Numbering to the same text
The last line numbering is not formatted with the same font/size.
just me
Posts: 5082
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: Class RichEdit - rich edit control for AHK (Unicode)

08 Apr 2015, 04:00

Format/Numbering just sends a WM_SETPARAFORMAT message to the control which does not specify a font. You might try to exclude the line feed of the last line from the selection. Maybe it helps?
m3user
Posts: 107
Joined: 17 Jan 2014, 18:11

Re: Class RichEdit - rich edit control for AHK (Unicode)

12 Apr 2015, 12:05

Thanks just me, makes sense.

I tried to use a class in my script and it works great! There is still a thing I cannot figure out: I have difficulty to delete a file which is/was opened in Rich edit. For example, I tried to add a FileDelete, %Open_file% at the end of a FileClose label. Unfortunately the file is not deleted as it obviously requires some extra permissions. Sometimes it gets deleted after the script is closed.

Is there any command which can be used to un-lock or release the previously opened file for deleting? Thanks.
just me
Posts: 5082
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: Class RichEdit - rich edit control for AHK (Unicode)

13 Apr 2015, 02:52

Hi m3user,

I suppose it happens only for RTF files. It might be caused by a glitch with the file handling in the LoadRTF() method. I revised both the LoadRTF() and the LoadRTFProc() callback function. Would you please test and tell me whether it fixes your problem?

Code: [Select all] [Download] GeSHi © Codebox Plus

; Removed test code.
Last edited by just me on 14 Apr 2015, 00:38, edited 1 time in total.
m3user
Posts: 107
Joined: 17 Jan 2014, 18:11

Re: Class RichEdit - rich edit control for AHK (Unicode)

13 Apr 2015, 12:40

Hi just me, I tested your solution and it now works as expected. Thank you!
just me
Posts: 5082
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: Class RichEdit - update on 2015-04-14 (v0.1.05.00)

14 Apr 2015, 00:37

Hi m3user, thanks for testing. I've updated the script.
User avatar
BGM
Posts: 389
Joined: 20 Nov 2013, 20:56
GitHub: bgmCoder
Contact:

Re: Class RichEdit - update on 2015-04-14 (v0.1.05.00)

14 May 2015, 19:59

Oh, I'm missing a step somewhere just trying to get the control to appear. When the GUI shows there is no control present. What am I missing?

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

Last edited by BGM on 14 May 2015, 21:32, edited 1 time in total.

Return to “Scripts and Functions”

Who is online

Users browsing this forum: No registered users and 15 guests