Join The Works program to have access to the most current content, and to be able to ask questions and get answers from Revelation staff and the Revelation community

At 16 MAR 2005 04:27:15PM Wayne Shepard wrote:

Is it possible to turn OENGINE's logging facility on and off programmatically? Of course it is! How?

Wayne


At 17 MAR 2005 12:43AM [url=http://www.sprezzatura.com]The Sprezzatura Group[/url] wrote:

Wayne,

compile subroutine exec_OE_Log( startLog )

   declare function getEngineWindow, getWindow
   declare function getWindowTextLength, getWindowText
   $insert logical
   
   equ GW_HWNDFIRST$       to 0
   equ GW_HWNDLAST$        to 1
   equ GW_HWNDNEXT$        to 2
   equ GW_HWNDPREV$        to 3
   equ GW_OWNER$           to 4
   equ GW_CHILD$           to 5
   equ GW_ENABLEDPOPUP$    to 6
   equ GW_MAX$             to 6
   
   equ BM_CLICK$           to 0x00F5
   
   if startLog then
      logText=StartLog"
   end else
      logText=StopLog"
   end
   
   hwndOE =getEngineWindow()
   hwndLog=0
   if hwndOE then
      hwndNext=GetWindow( hwndOE, GW_CHILD$ )
      loop
      while ( hwndNext )
      
         * // We could check the window's class to see if it's a button
         * // but as this is quick and dirty we'll just look for the
         * // text string ...
         
         cchTextLen=GetWindowTextLength( hwndNext )
         if cchTextLen then
            textBuf=str( \00\, cchTextLen );
            call GetWindowText( hwndNext, textBuf, cchTextLen + 1 )
            
            if ( textBuf1,\00\ _eqc logText ) then
               hwndLog=hwndNext
            end
            
         end
      until hwndLog
         hwndNext=GetWindow( hwndNext, GW_HWNDNEXT$ )
      repeat
   end
   
   if hwndLog then
      * // Simulate a click event
      call sendMessage( hwndLog, BM_CLICK$, 0, 0 )
   end
   
return

The Sprezzatura Group

World leaders in all things RevSoft


At 17 MAR 2005 08:12PM Wayne Shepard wrote:

Ah, I knew you'd come through for me! Thanks!

Wayne

View this thread on the Works forum...

  • third_party_content/community/commentary/forums_works/c36854b6095b51c385256fc600705bbf.txt
  • Last modified: 2024/01/04 20:57
  • by 127.0.0.1