RexxScrlr
BGNDCOL=CCCCCC;TEXTCOL=000084;FONT=9.WarpSans;COLOR1=00FF00;COLOR2=FFFF00;COLOR3=FF0000;SCRIPT=/* Clipboard Monitor */%0D%0A%0D%0AAudible %3D 1%0D%0A%0D%0A/* do not modify code from here */%0D%0Aif scrlr.user%3D'' then do%0D%0A%09call RxFuncAdd 'VRLoadFuncs', 'VROBJ', 'VRLoadFuncs'%0D%0A%09call VRLoadFuncs%0D%0A%09XWPPath%3Dstrip(SysIni('USER','XWorkplace','XFolderPath'),'T','0'x)%0D%0A%09scrlr.user%3Dcopies(' ',50)||XWPPath%0D%0Aend%0D%0AXWPPath%3Dsubstr(scrlr.user,51,)%0D%0A%0D%0Ascrlr.text %3D ''%0D%0Anewtooltip %3D VRMethod( "Application", "GetClipboard" ) %0D%0A%0D%0Aif left(newtooltip,50)<>left(scrlr.user,50) then %0D%0A%09if Audible then do%0D%0A%09%09RunStr%3D"call '"XWPPath"\bin\PlaySnd.CMD' 591"%0D%0A%09%09interpret RunStr%0D%0A%09end%0D%0A%0D%0Ascrlr.user %3D left(newtooltip, 50)||XWPPath%0D%0Ascrlr.tooltip %3D  newtooltip%0D%0A%0D%0Aif scrlr.tooltip %3D '' then do%0D%0A%09scrlr.tooltip %3D 'empty or no text'%0D%0A%09bmp%3D'E'%0D%0Aend%0D%0Aelse bmp%3D'T'%0D%0Ascrlr.bitmap %3D XWPPath||'\Icons\clip'bmp'.bmp';DBLCLK=/* Edit clipboard */%0D%0A%0D%0Aif VRMethod( "Application", "GetClipboard" )%3D'' then do%0D%0A%09call beep 880, 40%0D%0A%09ok%3DSysSetObjectData("<WP_CLIPV>","OPEN%3DDEFAULT")%0D%0Aend%0D%0Aelse do /* Custom mainline for macro */%0D%0A%09_VREVersion%3DSubWord( VRVersion( "VRObj" ), 1, 1 )%0D%0A%09if( _VREVersion < 2.14 )then do%0D%0A%09%09call VRMessage "", "VROBJ version 2.14 required to run.", "Error!"%0D%0A%09%09return 32000%0D%0A%09end%0D%0A%0D%0A%09signal on SYNTAX name _VRESyntax%0D%0A%09signal _VREMain%0D%0A%0D%0A_VRESyntax:%0D%0A%09parse source . . _VRESourceSpec%0D%0A%09call VRMessage "", "Syntax error in" _VRESourceSpec "line" SIGL":" ErrorText(rc), "Error!"%0D%0A%09call VRFini%0D%0A%09exit 32000%0D%0A%0D%0A_VREMain:%0D%0A%0D%0AMain: %0D%0A%09call VROptions 'ImplicitNames'%0D%0A%09call VROptions 'NoEchoQuit'%0D%0A%0D%0A%09InitArgs.0%3D4%0D%0A%09do I%3D1 to 4%0D%0A%09%09InitArgs.I%3Darg(i) /* VX-REXX compatibility */%0D%0A%09end%0D%0A%0D%0A%09call VRInit /* Load the windows */%0D%0A%09_VREPrimaryWindowPath%3DSysSearchPath('PATH','ClipEdit.VRW')%0D%0A%09_VREPrimaryWindow%3DVRLoad("", _VREPrimaryWindowPath )%0D%0A%0D%0A%09if( _VREPrimaryWindow %3D%3D "" )then do%0D%0A%09%09call VRMessage "", "Cannot load window:" VRError(), "Error!"%0D%0A%09%09_VREReturnValue%3D32000%0D%0A%09%09signal _VRELeaveMain%0D%0A%09end%0D%0A%0D%0A/* Process events%0D%0A*/%0D%0A%09call Init%0D%0A%09signal on halt%0D%0A%09do while( \ VRGet( _VREPrimaryWindow, "Shutdown" ) )%0D%0A%09%09_VREEvent%3DVREvent()%0D%0A%09%09interpret _VREEvent%0D%0A%09end%0D%0A_VREHalt:%0D%0A%09_VREReturnValue%3DFini()%0D%0A%09call VRDestroy _VREPrimaryWindow%0D%0A_VRELeaveMain:%0D%0A%09call VRFini%0D%0Aexit _VREReturnValue%0D%0A%0D%0AVRLoadSecondary:%0D%0A%09__vrlsWait%3Dabbrev( 'WAIT', translate(arg(2)), 1 )%0D%0A%09if __vrlsWait then call VRFlush%0D%0A%09__vrlsHWnd%3DVRLoad( VRWindow(), VRWindowPath(), arg(1) )%0D%0A%09if __vrlsHWnd%3D'' then signal __vrlsDone%0D%0A%09if __vrlsWait \%3D 1 then signal __vrlsDone%0D%0A%09call VRSet __vrlsHWnd, 'WindowMode', 'Modal' %0D%0A%09__vrlsTmp%3D__vrlsWindows.0%0D%0A%09if( DataType(__vrlsTmp) \%3D 'NUM' ) then __vrlsTmp%3D1%0D%0A%09%09else __vrlsTmp%3D__vrlsTmp + 1%0D%0A%09%0D%0A%09__vrlsWindows.__vrlsTmp%3DVRWindow( __vrlsHWnd )%0D%0A%09__vrlsWindows.0%3D__vrlsTmp%0D%0A%09do while( VRIsValidObject( VRWindow() )%3D1 )%0D%0A%09%09__vrlsEvent%3DVREvent()%0D%0A%09%09interpret __vrlsEvent%0D%0A%09end%0D%0A%09__vrlsTmp%3D__vrlsWindows.0%0D%0A%09__vrlsWindows.0%3D__vrlsTmp - 1%0D%0A%09call VRWindow __vrlsWindows.__vrlsTmp %0D%0A%09__vrlsHWnd%3D''%0D%0A__vrlsDone:%0D%0Areturn __vrlsHWnd%0D%0A%0D%0A/*:VRX Fini%0D%0A*/%0D%0AFini:%0D%0A%09ok%3DVRSet(VRWindow(),"Visible",0)%0D%0Areturn 0%0D%0A%0D%0A/*:VRX Halt%0D%0A*/%0D%0AHalt:%0D%0A%09signal _VREHalt%0D%0Areturn%0D%0A%0D%0A/*:VRX Init%0D%0A*/%0D%0AInit:%0D%0A%09window%3DVRWindow()%0D%0A%09call VRMethod window, "CenterWindow"%0D%0A%09call VRSet window, "Visible", 1%0D%0A%09call VRMethod window, "Activate"%0D%0A%09drop window%0D%0Areturn%0D%0A%0D%0A/*:VRX PB_Cancel_Click%0D%0A*/%0D%0APB_Cancel_Click: %0D%0A%09call Quit%0D%0Areturn%0D%0A%0D%0A/*:VRX PB_Clear_Click%0D%0A*/%0D%0APB_Clear_Click: %0D%0A%09ok%3DVRMethod( "Application", "PutClipboard", "")%0D%0A%09call Quit%0D%0Areturn%0D%0A%0D%0A/*:VRX PB_OK_Click%0D%0A*/%0D%0APB_OK_Click: %0D%0A%09ok%3DVRMethod( "Application", "PutClipboard", VRget("MLE_Clip","Value") )%0D%0A%09call Quit%0D%0Areturn%0D%0A%0D%0A/*:VRX Quit%0D%0A*/%0D%0AQuit:%0D%0A%09ok%3DVRSet(VRWindow(),"Shutdown",1)%0D%0Areturn%0D%0A%0D%0A/*:VRX Window1_Close%0D%0A*/%0D%0AWindow1_Close:%0D%0A%09call Quit%0D%0Areturn%0D%0A%0D%0A/*:VRX Window1_Create%0D%0A*/%0D%0AWindow1_Create: %0D%0A%09ok%3DVRset("MLE_Clip","Value",VRMethod( "Application", "GetClipboard" ))%0D%0Areturn%0D%0Aend;TITLE=Clipboard Monitor;FILLED=1;HEIGHT=10;WIDTH=20;REFRESH=1000;