IndyUK Posted March 6, 2010 Share Posted March 6, 2010 Hi All, I'm developing a script where I use the ControlSetText function to pass values to a fields on a form. However, the problem I've discovered is that none of the controls save their values when I save the form. Why is this? I then went and tried the ControlSend function which seems to work but the problem with this is the text is all lowercase. This I suppose is because this is sending keystrokes rather than a literal value. Can someone recommend a fix/workaround to this? If there isn't one then I will begin work on writing a wrapper for the ControlSend function where it will send each key stroke based on the ASCII value of the text. Thanks Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted March 6, 2010 Share Posted March 6, 2010 I don't understand what you mean, ControlSetText() do support uppercased characters, see: $hWnd = GUICreate("test", 200, 100) $hInput = GUICtrlCreateInput("", 20, 20, 160, 22) GUISetState() ControlSetText($hWnd, "", $hInput, "AaBbCc") Do Sleep(10) Until GUIGetMsg() = -3 .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
IndyUK Posted March 6, 2010 Author Share Posted March 6, 2010 I don't understand what you mean, ControlSetText() do support uppercased characters, see: $hWnd = GUICreate("test", 200, 100) $hInput = GUICtrlCreateInput("", 20, 20, 160, 22) GUISetState() ControlSetText($hWnd, "", $hInput, "AaBbCc") Do Sleep(10) Until GUIGetMsg() = -3 The syntax I'm using is correct and the values I pass do get sent to the textbox. Problem seems to be that the application I'm controlling isn't setting the value instead just displaying it. I think the application is written in Borland so I don't know if that makes any difference. Link to comment Share on other sites More sharing options...
somdcomputerguy Posted March 6, 2010 Share Posted March 6, 2010 ControlSend works with uppercase also, if the (not created by you) application doesn't save form values, maybe use ControlGetText to get those values and do something with them. - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
Bowmore Posted March 6, 2010 Share Posted March 6, 2010 The reason the application is not saving the values you enter on the form using ControlSetText() is probably because the application only reads the content of the field when the user presses enter or tabs to another field. "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook Link to comment Share on other sites More sharing options...
IndyUK Posted March 6, 2010 Author Share Posted March 6, 2010 The reason the application is not saving the values you enter on the form using ControlSetText() is probably because the application only reads the content of the field when the user presses enter or tabs to another field.That's what I first thought, but then when I tried the ControlSend command that seems to work. I will however try once more as per your suggestion and see if I've missed something. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now