include win32lib.ew
without warning

constant
zFlashWindow=registerw32Function(user32,
             "FlashWindow",{C_INT,C_INT},C_INT),
Win1=create(Window,"Two in One",0,10,10,225,180,0),

secret={WS_CHILD,WS_VISIBLE,ES_LEFT,ES_PASSWORD},
txt=create(EditText,"Your Secret, eh ?",Win1,5,10,205,22,secret),
Button1=create(PushButton,"See Password",Win1,5,40,100,25,0),
Button2=create(PushButton,"Hide Password",Win1,110,40,100,25,0),
Button3=create(PushButton,"Flash Window",Win1,5,80,100,25,0),
timer1=1

atom jk
integer flashing,state
flashing=0
state=1

atom id
id=getHandle(Win1)

procedure flash(integer timer_id)
if state=1 then
jk=w32Func(zFlashWindow,{id,1})
else
jk=w32Func(zFlashWindow,{id,0})
state=-state
end if
end procedure
--
onTimer[Win1]=routine_id("flash")

procedure see_it()
jk=sendMessage(txt,EM_SETPASSWORDCHAR,0,0)
repaintWindow(txt)
end procedure
--
onClick[Button1]=routine_id("see_it")

procedure hide_it()
jk=sendMessage(txt,EM_SETPASSWORDCHAR,42,0)
repaintWindow(txt)
end procedure
--
onClick[Button2]=routine_id("hide_it")

procedure on_Button3()
if flashing=0 then
setTimer( Win1, timer1, 300 )
setText(Button3,"Stop Flashing")
flashing=1
else
killTimer(Win1,timer1)
setText(Button3,"Flash Window")
flashing=0
jk=w32Func(zFlashWindow,{id,0})
end if
end procedure
--
onClick[Button3]=routine_id("on_Button3")

--

WinMain(Win1,Normal)