Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2005
    Location
    WA 'wait a while' - Australia
    Posts
    872

    Accessing and modifying the Debug Window

    The Debug Window is a buitin handy resource to tap into while
    still enabling the end user to interact with your main APP
    here's a couple of code chuncks to customise the debug window

    some global funcs:

    Code:
    function SetDebugHwnd(wndTitleIn,SetwndTitle)
    
    --to set or change the Title of the builtin 'debug window' and get and return its Window Handle for future use 
     
    local tHwnds = Window.EnumerateTitles(false);
    	for hWnd, wtitle in tHwnds do    
        		if (String.CompareNoCase(wtitle, wndTitleIn) == 0) then
        			if (String.ToNumber(DLL.CallFunction(_SystemFolder.."\\user32.dll", "GetParent", hWnd, 1, 1)) == Application.GetWndHandle()) then
        				Window.SetText(hWnd, SetwndTitle); return hWnd; --set title and return the debug handle
    			end	
        		end
    	end
    end
    
    
    function IsDebugActive(nHwnd)
    
    --to discover if the debug window is the current active window
    
    	if (String.ToNumber(DLL.CallFunction(_SystemFolder.."\\User32.dll", "GetActiveWindow", "", 1, 1)) == nHwnd) then
    		return true;
    	end
    return false;	
    end
    some example calls:

    Code:
    nDBHwnd = SetDebugHwnd("Debug","- Information -"); -- a global var
    Code:
    if (not IsDebugActive(nDBHwnd)) then
    	--do something here
    end
    Code:
    if IsDebugActive(nDBHwnd) then
    	--do something here
    end

    Code:
    Window.SetSize(nDBHwnd, 500, 350);
    --get or set the text you wish to display in the debug window
    local sText = "Display this string in the debug window";
    --local sText = TextFile.ReadToString("FullpathandFilename");
    Debug.Clear(); Debug.Print(sText); Debug.ShowWindow(true);
    have a play and modify to suit

    I've also put in a request to control the 'right click' functionality here:

    http://www.indigorose.com/forums/showthread.php?t=20954

  2. #2
    Join Date
    Oct 2007
    Posts
    44
    Thanks Eagle, it's useful

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts