Indigo Rose Software

Professional Software Development Tools

 
+ Reply to Thread
Results 1 to 8 of 8
  1. #1
    Join Date
    Feb 2006
    Posts
    346

    Hosts File Help!

    Trying to creata a simple app that will open a text file that hosts file entry that will load into input1. Once loaded you can add, delete etc... My attached project allows me to delete but, not manually type anything into the input object. Not sure why this is not working when it works in another project. Can someone explain to me what I did wrong? Thanks
    Attached Files

  2. #2
    Join Date
    Oct 2009
    Location
    127.0.0.1
    Posts
    279
    I'm going to go out on a limb here and say it looks like you have too much text in your input object and it is not allowing you to add any more text.
    There are 10 types of people in the world: those who understand binary, and those who don't.

  3. #3
    Join Date
    Feb 2006
    Posts
    346
    So, the input object has a limited amount of text that can be edited? Good to know - Thanks

  4. #4
    Join Date
    Apr 2007
    Location
    Raalte, OV, Netherlands
    Posts
    3,287
    Quote Originally Posted by abnrange View Post
    So, the input object has a limited amount of text that can be edited? Good to know - Thanks
    The max number of allowed characters could be something containing a 3... I can't remember at all XD But could it be 32000 characters? or 320000?
    Bas Groothedde
    Imagine Programming :: Blog :: Familiar people here

    My AMS Plugins:

  5. #5
    Join Date
    May 2006
    Posts
    5,380
    the default length is 30,000 chars, but you can change this to whatever you want, use "SendMessageA" with "EM_SETLIMITTEXT" and "EM_GETLIMITTEXT"

    EG:
    Code:
    EM_GETLIMITTEXT = 213
    EM_SETLIMITTEXT = 197
    
    function Input.GetMaxLen(sObject)
    
    	local tProps = Input.GetProperties(sObject);
    	if tProps then
    		local result = DLL.CallFunction("User32.dll", "SendMessageA", tProps.WindowHandle..","..EM_GETLIMITTEXT..",0,0", DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL);
    		return result
    	else
    		return 0
    	end
    	
    end
    
    function Input.SetMaxLen(sObject, nLen)
    
    	local tProps = Input.GetProperties(sObject);
    	if tProps then
    		DLL.CallFunction("User32.dll", "SendMessageA", tProps.WindowHandle..","..EM_SETLIMITTEXT..","..nLen..",0", DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL);
    	end
    	
    end
    
    Input.SetMaxLen("Input1",100000000)
    Easy
    Open your eyes to Narcissism, Don't let her destroy your life!!

  6. #6
    Join Date
    May 2006
    Posts
    5,380
    here, your APZ works now
    Open your eyes to Narcissism, Don't let her destroy your life!!

  7. #7
    Join Date
    Feb 2006
    Posts
    346
    Thanks RizlaUK!!! Works great!!!!

  8. #8
    Join Date
    Oct 2009
    Location
    127.0.0.1
    Posts
    279
    Nice work around Riz, thanks for posting that.
    There are 10 types of people in the world: those who understand binary, and those who don't.

Posting Permissions

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