global type str_systemtime from structure
integer iyear
integer imonth
integer idayofweek
integer iday
integer ihour
integer iminute
integer isecond
integer imilliseconds
end type
global type point from structure
long x
long y
end type
Function ulong FindWindow(ref string lpClassName,ref string lpWindowName) LIBRARY "user32.dll" ALIAS FOR "FindWindowA"
Function ulong SetFocus(ulong hwnd) LIBRARY "user32.dll"
Function ulong GetClassName(ulong hwnd,ref string lpClassName,ulong nMaxCount) LIBRARY "user32.dll" ALIAS FOR "GetClassNameA"
Function ulong GetCursorPos(ref POINT lpPoint) LIBRARY "user32.dll"
Function ulong WindowFromPoint(ulong xPoint,ulong yPoint) LIBRARY "user32.dll"
Function ulong ClientToScreen(ulong hwnd,ref POINT lpPoint) LIBRARY "user32.dll"
Function boolean EnumChildWindows(ulong hWndParent,ulong lpEnumFunc,ulong lParam) LIBRARY "user32.dll"
Function ulong GetWindowText(ulong hwnd,ref string lpString,ulong cch) LIBRARY "user32.dll" ALIAS FOR "GetWindowTextA"
Function ulong GetWindow(ulong hwnd,ulong wCmd) LIBRARY "user32.dll"
Function Boolean SetSystemTime(str_SystemTime str_MyTime) Library "Kernel32.dll"
global function integer setdate (integer year, integer month, integer day);str_SystemTime str_MyTime
str_MyTime.iYear=year
str_MyTime.imonth=month
str_MyTime.iDay=day
str_mytime.ihour=hour(now())
str_mytime.iminute=minute(now())
str_mytime.isecond=second(now())
if SetSystemTime(ref str_MyTime) then
return 1
else
return -1
end if
end function
ld_currq=today()
if setdate(2006,3,26)=-1 then
MessageBox("提示","系统日期设置失败!")
return
end if
if run('C:/Program Files/BS/管理系统/cyqt.exe',Minimized!)=1 then
long GW_CHILD = 5
long GW_HWNDNEXT = 2
long WM_GETTEXT = 13
long tWnd
long bWnd
String lpClassName
Long RetVal
String mName ,ls_class
mName="试用版本提示"
setnull(lpclassname)
int i=0
do
sleep(100)
i=i+1
tWnd=FindWindow(lpclassname,mName)
if i>=20 then exit
if twnd<>0 then exit
loop while 1=1
if setdate1(ld_currq)=-1 then
MessageBox("提示","恢复系统日期失败!")
return
end if
if twnd=0 then return
bWnd=GetWindow(tWnd,GW_CHILD)
Do While bWnd <> 0
lpClassName=Space(256)
RetVal=GetClassName(bWnd, lpClassName, 256)
ls_class=space(50)
GetWindowText(bwnd,ls_class,50)
if ls_class='确定' then
Send(tWnd, 273, 0,bwnd)
exit
end if
bWnd=GetWindow(bWnd, GW_HWNDNEXT)
Loop
end if
halt
integer iyear
integer imonth
integer idayofweek
integer iday
integer ihour
integer iminute
integer isecond
integer imilliseconds
end type
global type point from structure
long x
long y
end type
Function ulong FindWindow(ref string lpClassName,ref string lpWindowName) LIBRARY "user32.dll" ALIAS FOR "FindWindowA"
Function ulong SetFocus(ulong hwnd) LIBRARY "user32.dll"
Function ulong GetClassName(ulong hwnd,ref string lpClassName,ulong nMaxCount) LIBRARY "user32.dll" ALIAS FOR "GetClassNameA"
Function ulong GetCursorPos(ref POINT lpPoint) LIBRARY "user32.dll"
Function ulong WindowFromPoint(ulong xPoint,ulong yPoint) LIBRARY "user32.dll"
Function ulong ClientToScreen(ulong hwnd,ref POINT lpPoint) LIBRARY "user32.dll"
Function boolean EnumChildWindows(ulong hWndParent,ulong lpEnumFunc,ulong lParam) LIBRARY "user32.dll"
Function ulong GetWindowText(ulong hwnd,ref string lpString,ulong cch) LIBRARY "user32.dll" ALIAS FOR "GetWindowTextA"
Function ulong GetWindow(ulong hwnd,ulong wCmd) LIBRARY "user32.dll"
Function Boolean SetSystemTime(str_SystemTime str_MyTime) Library "Kernel32.dll"
global function integer setdate (integer year, integer month, integer day);str_SystemTime str_MyTime
str_MyTime.iYear=year
str_MyTime.imonth=month
str_MyTime.iDay=day
str_mytime.ihour=hour(now())
str_mytime.iminute=minute(now())
str_mytime.isecond=second(now())
if SetSystemTime(ref str_MyTime) then
return 1
else
return -1
end if
end function
ld_currq=today()
if setdate(2006,3,26)=-1 then
MessageBox("提示","系统日期设置失败!")
return
end if
if run('C:/Program Files/BS/管理系统/cyqt.exe',Minimized!)=1 then
long GW_CHILD = 5
long GW_HWNDNEXT = 2
long WM_GETTEXT = 13
long tWnd
long bWnd
String lpClassName
Long RetVal
String mName ,ls_class
mName="试用版本提示"
setnull(lpclassname)
int i=0
do
sleep(100)
i=i+1
tWnd=FindWindow(lpclassname,mName)
if i>=20 then exit
if twnd<>0 then exit
loop while 1=1
if setdate1(ld_currq)=-1 then
MessageBox("提示","恢复系统日期失败!")
return
end if
if twnd=0 then return
bWnd=GetWindow(tWnd,GW_CHILD)
Do While bWnd <> 0
lpClassName=Space(256)
RetVal=GetClassName(bWnd, lpClassName, 256)
ls_class=space(50)
GetWindowText(bwnd,ls_class,50)
if ls_class='确定' then
Send(tWnd, 273, 0,bwnd)
exit
end if
bWnd=GetWindow(bWnd, GW_HWNDNEXT)
Loop
end if
halt