Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
window and text
I'm trying to create a macro that will dislpay a window with only one word in it and then change that word every so often. I think I have the method but I can't seem to figure out a way to create the window.
Does anyone have any ideas how i can create that window?

How this window should look? What purpose? Maybe you can give a simple algorithm (sequence of actions) for whole macro? What method would you use to change the text? From the same macro or from other macro? You for example can use a custom dialog, or CreateWindowEx function, or MainWindow function.
Here's my idea.
Several years ago I saw a story on CNN/MS-NBC or whatever, that if you displayed just one word at a time and in the same place as the previous word people can read much faster than usual (it may be due to the constant movement of the eyes accross the page/screen). So what I was hoping to do is grab a chunk of text and copy it into the clipboard then start the macro that "getclip"s that text and then places it into the window one word at a time with a predetermined pause between each word.

Does that help at all? I was working on it last night and kicking around the best way to pull out consecutive words from the string but haven't settled on that yet.

Thanks for your input.
Did you tried it in QM output?

;Copy some text and run this macro ...

double wordspeed=0.15
double sentencespeed=0.5

str s.getclip
ARRAY(str) a
int i n=tok(s a -1 " [9][][160]")
for i 0 n
,ifk(C) break
,out a[i]
,if(a[i].end(".")) wait sentencespeed
,else wait (a[i].len*(wordspeed/10)+wordspeed)

That is exactly what I was looking for!!!!

I had thought of using the Output but didn't remember about the clearoutput cmd. I there a way to adjust the font attributes in the output and then reset them after the macro finishes?

I'm just looking through and adding some bells like word count and expected read time.

PS: I just caught the code that adjusts the time it waits between words in proportion to the length of the word.... VERY NICE!!! Big Grin
int hwnd=id(2201 _hwndqm)
int+ g_hfont g_hfontprev
if(!g_hfontprev) g_hfontprev=SendMessage(hwnd WM_GETFONT 0 0)
if(!g_hfont) g_hfont=CreateFont2("Verdana" 15 700)
SendMessage(hwnd WM_SETFONT g_hfont 1)
SendMessage(hwnd WM_SETFONT g_hfontprev 1)

Function CreateFont2:
function $font [size] [weight] ;;weight: 400 is normal

dll gdi32 #GetObject hgdiobj cbBuffer !*lpvObject

GetObject(GetStockObject(SYSTEM_FONT) sizeof(LOGFONT) &lf)
if(size) lf.lfHeight=-MulDiv(size GetDeviceCaps(GetDC(0) LOGPIXELSY) 72)
else lf.lfHeight=0
strncpy(&lf.lfFaceName font 31)

ret CreateFontIndirect(&lf)
Wow, your really cooking now!

I'm having a variable issue maybe you can help me with.
The output should be the same value in this code but when I try to put the double into the out cmd suddenly the value is 0. Can you tell me why?

str s.getclip
ARRAY(str) a
int i n=tok(s a -1 " [9][][160]")
double nd
out nd
out "nd value = %d " nd
%d is for integers (the same as %i). Use %g, or %e, or %f.

Forum Jump:

Users browsing this thread: 1 Guest(s)