home *** CD-ROM | disk | FTP | other *** search
- declare function SendMessage lib "User" (hwnd as integer, w as integer,\
- wParam as integer, lp as any) as integer
- declare function IsWindow lib "User" (hwnd as integer) as integer
-
- DIM sI As SYSTEMINFO
- DIM rc As Rect
-
- WinInfoSystem(sI)
-
- Run("notepad.exe", NOWAIT)
- wNotepad% = WinActivate("", "Notepad",5)
- RectSet(rc, sI.si_wXScreen/2-200, sI.si_wYScreen/2-60,\
- sI.si_wXScreen/2+200, sI.si_wYScreen/2+60)
- WinSetPosSizeState(wNotepad%, rc, SBC_WINPOSSIZE or SBC_WINTOPMOST)
-
- SBV_PLAYTICK = 0
- Simulate("Close Notepad to stop this madness.")
- While IsWindow(wNotepad%)
- SendMessage(wNotepad%, WM_SETTEXT, 0, "Hello,")
- sleep 1
- If IsWindow(wNotepad%) then
- SendMessage(wNotepad%, WM_SETTEXT, 0, "World!")
- sleep 1
- EndIf
- If IsWindow(wNotepad%) then
- SendMessage(wNotepad%, WM_SETTEXT, 0, "Hello, World!")
- sleep 1
- EndIf
- Wend
-