Posts: 1,769
Threads: 410
Joined: Feb 2003
i would like to create a window that has minimal screen realestate (maybe a thick edge for the nice 3d look) that would display a global variable in a scrolling manner. it would have to check the variable value every so often (about 1-5 seconds)....
any thoughts how i can do this?
:roll:
im such a post whore today!!!
Posts: 12,072
Threads: 140
Joined: Dec 2002
Use toolbar with hook function.
Toolbar TB_ShowVariable:
Hook function TB_ShowVariable2:
;/
function# hWnd message wParam lParam
sel message
,case WM_CREATE
,_s=g_var
,CreateControl 0 "Static" _s 0 0 0 50 20 hWnd 111
,SetTimer hWnd 21990 1000 0
,
,case WM_TIMER
,sel wParam
,,case 21990
,,_s=g_var; _s.setwintext(id(111 hWnd))
Test macro:
int+ g_var
mac "TB_ShowVariable"
rep 10
,g_var+1
,1
Posts: 1,769
Threads: 410
Joined: Feb 2003
works great!
is there a way to show long string like about 50+ char?
thanks
Posts: 12,072
Threads: 140
Joined: Dec 2002
;/
function# hWnd message wParam lParam
sel message
,case WM_CREATE
,CreateControl 0 "Static" 0 0 0 0 50 20 hWnd 111
,SetTimer hWnd 21990 1000 0
,goto g1
,
,case WM_TIMER
,sel wParam
,,case 21990
,,;g1
,,_s.format("The g_var variable now is %i" g_var)
,,_s.setwintext(id(111 hWnd))
,
,case WM_SIZE
,RECT r; GetClientRect(hWnd &r)
,siz r.right r.bottom id(111 hWnd)