Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Reproduce and key in notepad a special character
#1
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
Code:
Copy      Help
str sa="→" ;; Character right arrow is copied/pasted from an MS-Word .doc file
#2
Macro Macro2713
Code:
Copy      Help
act "Notepad"
str sa="→"
paste sa
key (sa)
#3
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.
#4
Macro Macro2716
Code:
Copy      Help
spe 1
str sa
int i
for i 256 0x10000
,sa.format("%C" i)
,key (sa)
,if(i%100=0) key Y
,
#5
Macro Macro2720
Code:
Copy      Help
run "charmap.exe"
#6
Macro Macro2723
Code:
Copy      Help
str sa="→"
BSTR b=sa
int charCode=b[0]
out "%i 0x%X" charCode charCode

str s2.format("%C" charCode)
out s2
#7
Perfect ! Many thanks indeed.
#8
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.
#9
My QM 2.4.3.4 displays it correctly.

Macro Macro2726
Code:
Copy      Help
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.
#10
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.
#11
Not all fonts support all Unicode characters. You can see it in charmap.exe.
Also, control class name should be RichEdit20W.
#12
Class is correct, as shown in outw. How can I check and/or change the font of the note?
#13
Many thanks, I found how to change the font, now it works perfectly.

Have a nice weekend!


Forum Jump:


Users browsing this thread: 1 Guest(s)