Posts: 1,058
Threads: 367
Joined: Oct 2007
The right arrow character in the following macro, is copied/pasted from a word document. I would need some help - advice : is it possible to arbitrarily reproduce this character in a QM macro and then key it (or outp paste it) in a notepad (.txt) file?
Many thanks in advance.
Function
tempf15
str sa="→" ;; Character right arrow is copied/pasted from an MS-Word .doc file
Posts: 12,097
Threads: 142
Joined: Dec 2002
Macro
Macro2713
act "Notepad"
str sa="→"
paste sa
key (sa)
Posts: 1,058
Threads: 367
Joined: Oct 2007
Dear Gintaras,
Many thanks for this extremely prompt answer. I am sorry if I was misunderstood. My question was if there is a way to reproduce this symbol, without having to write the statement
Quote:str sa="..."
More specifically how could I find the unicode character code to reproduce this character. If possible.
Posts: 12,097
Threads: 142
Joined: Dec 2002
Macro
Macro2716
spe 1
str sa
int i
for i 256 0x10000
,sa.format("%C" i)
,key (sa)
,if(i%100=0) key Y
,
Posts: 12,097
Threads: 142
Joined: Dec 2002
Posts: 12,097
Threads: 142
Joined: Dec 2002
Macro
Macro2723
str sa="→"
BSTR b=sa
int charCode=b[0]
out "%i 0x%X" charCode charCode
str s2.format("%C" charCode)
out s2
Posts: 1,058
Threads: 367
Joined: Oct 2007
Perfect ! Many thanks indeed.
Posts: 1,058
Threads: 367
Joined: Oct 2007
Dear Gintaras,
I set the text in a notepad window (he) using a string (s) in which a character like "sa" above was included.
Quote:SendMessageW he WM_SETTEXT 0 @s
The text was displayed perfectly.
However when I repeated the same task to display the text in a window produced by ShowNote, it fails in that "sa" character is displayed only as non-recognized character.
I understand that it has to do something with ShowNote window. I read carefully post
Font Settings in ShowNote
but I failed to find a solution.
I would appreciate it if you could kindly advise.
Posts: 12,097
Threads: 142
Joined: Dec 2002
My QM 2.4.3.4 displays it correctly.
Macro
Macro2726
ShowNote
1
int w=win("NOTE1" "QM_toolbar")
int he=id(1 w) ;;editable text
outw he ;;4919558 RichEdit20W ""
SendMessageW he WM_SETTEXT 0 @"→"
;str s="→"
;s.setwintext(he)
Maybe in older QM the class name is not RichEdit20W.
Posts: 1,058
Threads: 367
Joined: Oct 2007
Dear Gintaras,
Many thanks for your time. Actually, I was using exactly the same procedure (both techniques) as you suggested, but still I cannot display the symbol in the note's window. Nevertheless, an outw statement following SendMessageW displays correctly this symbol in QM output. I wonder whether it has something to do with the font used by the note. I will report any further findings.
Posts: 12,097
Threads: 142
Joined: Dec 2002
Not all fonts support all Unicode characters. You can see it in charmap.exe.
Also, control class name should be RichEdit20W.
Posts: 1,058
Threads: 367
Joined: Oct 2007
Class is correct, as shown in outw. How can I check and/or change the font of the note?
Posts: 1,058
Threads: 367
Joined: Oct 2007
Many thanks, I found how to change the font, now it works perfectly.
Have a nice weekend!