function DOS(string s)
======================
string c
STARTUPINFO infs
PROCESS_INFORMATION infp
if s then c="cmd.exe /c" else c="cmd.exe"
CreateProcess null,c+s,0,0,0,0,0,0,@infs,@infp
CloseHandle infp.hProcess
CloseHandle infp.hThread
end function
function Exec(string c,s,a)
===========================
STARTUPINFO infs
PROCESS_INFORMATION infp
if s="" then exit function
string d=c
if a then
d+=" "+a
putfile a,s
end if
CreateProcess c,d,0,0,0,0,0,0,@infs,@infp
CloseHandle infp.hProcess
CloseHandle infp.hThread
end function
'MICROSECOND TIMER
==================
'
quad ts,te,freq
QueryPerformanceFrequency @freq
'
function Timer(quad*t)
QueryPerformanceCounter @t
end function
'
function TimeLapse(quad *ts,*te) as double
return (te-ts)/freq 'SECONDS
end function
'
'KEYSHIFTS
==========
function ShiftKey() as sys
return 0xffff and GetAsyncKeyState(VK_SHIFT)
end function
function CtrlKey() as sys
return 0xffff and GetAsyncKeyState(VK_CONTROL)
end function
function IsAlphaNum(sys a) as sys
=================================
if ((a>47)and(a<58))or((a>64)and(a<91))or((a>96)and(a<123)) then return -1
end function
Function GetText(sys hwnd) as string
====================================
sys le
bstring s
le=SendMessage hwnd,WM_GETTEXTLENGTH,0,0
s=nuls le
SendMessage hwnd,WM_GETTEXT,le+1,strptr s
return s
end function