[futurebasic] Fix for White Dot on Refresh problem

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : June 1999 : Group Archive : Group : All Groups

From: Jamin <benjamen@...>
Date: Mon, 28 Jun 1999 09:57:18 +1000
> Jamin:
>
> It would be nice if there was a command or statement that one could use to
> defeat the update event caused by FB Runtime (i.e., gUpdate = _false).
>
> tedd
>

Since the eraserect call _SEEMS_ to do nothing other than draw the dot, here is a little patch that will fix any FB app.  It just No-Ops the phantom call to eraserect call within the FB runtime -of that app-.  I have tested it on the source provided by robert earlier, and it works OK, but as always, use at your own risk (its a 5 second hack, just to prove a point).  Whatever you do, dont patch your copy of FB itself!, otherwise all compiled apps will have the fix in them permanently!!

Jamin

PS: Please Staz don't sue me for reverse-engineering your runtime :-)


--- cut here for source code ----
WINDOW OFF
COORDINATE WINDOW
WIDTH = _NoTextWrap
DEFSTR LONG

DIM gUserQuits%
END GLOBALS

filename$ = FILES$(_fOpen,"APPL",,volRefNum%)

LONG IF LEN(filename$) > 0
  WINDOW 1,"Fix EraseRect in FB Runtime",(0,0)-(400,200),_Doc_NoGoAway
  TEXT _Monaco,9,0,0

  resFile% = FN OPENRFPERM(filename$,volRefNum%,_FSRdWrPerm)
  LONG IF resFile% <> -1
    myResHandle& = FN GET1RESOURCE(_"CODE",5)
    LONG IF myResHandle& <> 0
      DeReffed& = [myResHandle&]

      IsAnFBapplication% = _True

      testWord% = PEEK WORD(DeReffed&+11424)
      IF testWord% <> 18554 THEN IsAnFBapplication% = _False
      testWord% = PEEK WORD(DeReffed&+11426)
      IF testWord% <> 12306 THEN IsAnFBapplication% = _False
      testWord% = PEEK WORD(DeReffed&+11428)
      IF testWord% <> -22365 THEN IsAnFBapplication% = _False

      LONG IF IsAnFBapplication% = _True
        PRINT "Looks like a valid FB app, changing..."

        _NoOperation = 20081
        POKE WORD DeReffed&+11424,_NoOperation
        POKE WORD DeReffed&+11426,_NoOperation
        POKE WORD DeReffed&+11428,_NoOperation

        CALL CHANGEDRESOURCE(myResHandle&)
        CALL WRITERESOURCE(myResHandle&)
      XELSE
        PRINT "Doesn't look like an FB app to me,"
        PRINT "no change performed"
        PRINT "(Might already be patched?)"
      END IF

    XELSE
      PRINT "Had a problem finding the CODE 5 resource"
    END IF
    CALL CLOSERESFILE(resFile%)
  XELSE
    PRINT "Had a bit of trouble opening the resource fork?"
  END IF

  PRINT "Done, Command & Period to Quit"

  DO
    HANDLEEVENTS
  UNTIL gUserQuits%
END IF
END

----- end of code snippett -------