Jump to content

Myicq

Active Members
  • Posts

    334
  • Joined

  • Last visited

Everything posted by Myicq

  1. @Phoenix: it's a label design software. I have a number of layouts I would like to re-purpose for other layout programs, so I need to get properties of the different text strings, as the dumb software has no export function other than previous versions of the same. And no API. I will try the WinSpy++ as suggested. Thank you.
  2. I would like to query an application about 3 checkboxes status. The Info tool tells me it's a listbox. >>>> Control <<<< Class: ListBox Instance: 1 ClassnameNN: ListBox1 Name: Advanced (Class): [CLASS:ListBox; INSTANCE:1] ID: 1008 ..but as far as I can see, only listView may have checkboxes on items ? I can get a handle for the control: this returns no error. $listboxHandle = ControlGetHandle($winTitle, "", "[CLASS:ListBox; INSTANCE:1]") If @error = 1 Then ConsoleWrite("ERROR GETTING LISTBOX" & @CRLF) Else ConsoleWrite("Handle for listbox: " & $listboxHandle & @CRLF) EndIf But there is no way I can get it to read out correct status. Tried both with code for listbox and listview, no result. Any suggestions ? Or do I simply have a non-native control here ?
  3. "pull data" is a question with many answers. You do not clearly specify what you want as result ? From mediaWiki you can directly do something like http://en.wikipedia.org/wiki/Special:Export/PageNameHere This will give you an XML dump with original wikiformat. Would you like HTML output ? http://en.wikipedia.org/w/index.php?title=test&action=render http://en.wikipedia.org/w/index.php?title=test&action=raw You can even get JSON out.. http://en.wikipedia.org/w/api.php?format=json&action=query&titles=Main%20Page&prop=revisions&rvprop=content In my view all much simpler than parsing an editbox. You may have your reasons for doing this though. Sorry that I do not have time to post AutoIT code. The links are broken on bold text, hope you get point. EDIT: forgot that this would be useful : http://www.mediawiki.org/wiki/API .. and this one.. http://www.mediawiki.org/w/api.php?action=help
  4. If it's a one-off-thing it may be even faster to just mark data, Ctrl-C, insert in Excel which automagically formats sort-of-correct, then do your math there. It's interesting to develop AutoIT apps for such things, but I often have to stop myself, and try not to invent a hammer that already exists If you do continue app development - there are also other ways. You could just download data using inetget, then operate on regex'es. All depends on initial formatting of data how simple that is. Probably other ways to do same thing as well.
  5. @mlipok: I have been battling a while with the same question, "how to make cleanest possible HTML into a CHM file". So far all editors I have tried, even commercial ones, have failed. All seem to produce insame amounts of noise and local styles in the code. My solution was to use a webpage to edit, embedded into an AutoIT script. Inside the webpage I had IE (of course) and an editor based on Javascript, I think CKEditor was the choice for me. FCKEditor is also good. The resulting code is stored in a database, SQLite. For CHM compilation, which I did not do, you can directly call the command line tool from Microsoft. (google HTML Help workshop if MS moves the link..again..) Essentially this is a do-it-yourself solution. But in my view it will give me best results. If your help files need less different markup, you can easily implement even simpler solution: create a simple markup language in autoit, then process before you compile. This is called a pre-processor, and is exactly what the help for AutoIT is made from. Example, using made-up markup: .code[ here is the code more code here ] there are countless of these "markdown" languages to study from. If you do this, you have full control of the resulting HTML code. And it's faster to write when you translate, compared to using a GUI. A bit like combining a Wiki with preprosessor with HTML editor. Hope this rambling makes sense to you or anyone - torben
  6. From GuiMenu.au3: ; Name...........: _GUICtrlMenu_CheckRadioItem ; Description ...: Checks a specified menu item and makes it a radio item ; Syntax.........: _GUICtrlMenu_CheckRadioItem($hMenu, $iFirst, $iLast, $iCheck[, $fByPos = True]) http://msdn.microsoft.com/en-us/library/aa922587.aspx So the function is there. Would think help file describes it as well.
  7. You can do everything you can do with VBA, since the entire object space is available to other software including AutoIT. The hardest part, at least for me, is to find the right way to use the object model. But once you figure out how to go from VBA code objects to AutoIT, the rest pretty much gives itself away. My suggestion: make yourself a cheat sheet with a few notes on how to use functions, assign values and iterate over things. It would perhaps help if you would post some sample VBA code of what you wish to do ?
  8. Melba, thank you so much! I should have known better, I face same problem with customer from time to time. Credits to you and guiness for helping out! I will make sure to learn lesson and post better code.
  9. Well, that is true. And I have to remember to always make sure to give illustrative and complete examples It does not have to be just 2, this is obvious. But if I have 4, 6 or more the "if" codes can be pretty elaborate. Sorry for posting such obvious example. And thank you for help so far, anyway.
  10. Given the following GUI part: $Group1 = GUICtrlCreateGroup("Direction of label", 320, 216, 257, 73) $radDirectionHorizontal = GUICtrlCreateRadio("Horizontal", 328, 240, 113, 17) $radDirectionVertical = GUICtrlCreateRadio("Vertical", 328, 264, 113, 17) GUICtrlSetState(-1, $GUI_CHECKED) GUICtrlCreateGroup("", -99, -99, 1, 1) .. can I ask the group somehow (perhaps using a UDF) which radio button is selected ? Something like $selectedRadio = _RadioGroupGetSelected($Group1) .. and have index value returned (here, 1 or 2 as last item is checked) Or do I have to manually loop over each radioctrl ? Btw: application is for generation of labels in a layout program.
  11. I also have had a case where some parts of the UI would be impossible to access. I solved the problem by sending key presses instead, simply tab / ctrl-tab and space to "click". I find that even custom controls sometimes support the old Win3.11 keyboard navigation. "most ways lead to Rome, somehow"
  12. I will look forward to viewing this example in detail when I have a bit more time. Looks real promising. I can see other good uses for it, such as a simple way to include necessary files in an installation, or an advanced way of storing ini file settings.
  13. M23, your thankful input inspired me to what I think will be the solution. Sort of along the way you suggest, but not quite. My solution was: Case $cUp for $i = $cInput1 to $cInput4 if _WinAPI_GetFocus() = GuiCtrlGetHandle($i) Then $iValue = GuiCtrlRead($i) +1 GuiCtrlSetData($i, $iValue) EndIf next That way I do not have to create variables for handle. Just need to make sure inputs are following each other in design. Similar for $cDown Thanks for your suggestions again, especially about the Accelerators ! That will come in handy many places. - myicq.
  14. M23, it did help me a long way, thanks. How can I make this code more generalized for use with 4-8 input boxes ? I have seen before that DummyControls have been used to "border off" other controls, like this $before = guictrlcreatedummy() $i1 = guictrlcreateinput(...) $i2 = guictrlcreateinput(...) ... $after = guictrlcreatedummy() then check the id of the control if it's between $before and $after. Just forgot how
  15. I am developing a small application to change various parameters in a program. The parameters are numeric only and can be integer. I would like the fine-tuning of these parameters to be as simple as possible. Of course I can just let the operator type in replacement value, but this gets tedious with 4-5 digit parameter values. I have two different ideas / paths: when the field has focus, use some keys to change to next/previous value, like a spinner. Preferably up/down keys. Adobe designsoftware works like this, if you have tried them. Probably different controls though.have some general up/down buttons (or the Windows up/down control ?) that change value that just had / has focus.Only I am not really sure how to deal with the focus / focus-lost issue. My program is not using onevent mode. Thanks for any help
  16. @ James: my intention was not to learn a different language, it was for a customer. I could create a proof of concept, showing that it would be possible. Thanks to the old source of AutoIT 3.1, and helpful comment from Richard (thanks!) the customer actually managed to make all work. So here, AutoIT really proved me helpful. No, I will not fix things that are not broke For others that may be interested, here is completed code (although in VB.NET, customer chose this instead...)
  17. @Guiness: yes I did check source for 3.1, and did see reference to SendMessage, but as I am not a C programmer I could not really see how the class/instance is used. A simple example of same using C or C++ or even powershell would be real helpful. I will check up on SendMessage meanwhile.
  18. I have a colleague who needs to activate a function in a software (create an export of data), where the software does not support an API directly. Only way to automate is to send Ctrl+F10 to a child window. App is written in Delphi, hence the [TChildLerred] class. I have created the following in AutoIT which works perfectly. ; just most important lines here... ; Match any substring in the title AutoItSetOption("WinTitleMatchMode",2) ; send Control+F10 to a control ControlSend("MyWindowTitleOfSoftware", "", "[CLASS:TChildLerred; INSTANCE:1]", "^{F10}") Question is what is equivalent in C or C++ (or Windows API) to ControlSend with a class/instance ? What is AutoIT doing behind the scenes in above controlSend line ? I am not a C programmer myself, so hope for some help here.
  19. Did not have time to study your code fully - but I myself sometimes find that external tools are better suited to process hugh data sets very fast - and I use them if I get there faster and better. AutoIT is perfect for many things, but many not be for all things. For data processing, have a look at f.ex GnuWin unixUtils for windows. Awk, sed, tr, grep and their relatives can grind data incredibly fast. Plus the SQLite DB in memory. Like a swiss knife can drive nails.. a hammer is often better.
  20. Did I understand the general idea right, that this example could be applied across scripts using something like #include <datastore.au3> ;; not yet existing UDF with proper procedures getvar() ;; initialize data storage msgbox(0,"Test", getvar("myvar")) ;; return content getvar("myvar", "New content") ;; store content The getvar() could f.ex use an external SQLite DB file, so that variables could be used across scripts etc. Or did I understand this concept completely wrong ?
  21. Firefox, coming back to this one.. In a very primitive way, something like this: #include <WindowsConstants.au3> $Gui = GUICreate('My program', 450, 250, 300, 300) $MsgBox = GUICtrlCreateButton("Button", 20, 20, 90, 30) $txt = GUICtrlCreateLabel("", 20, 90, 400, 40) GUICtrlSetFont(-1, 20) GUISetState() While 1 Switch GUIGetMsg() Case $MsgBox $r = _MsgBox() GUICtrlSetData($txt, $r) Case -3 Exit EndSwitch WEnd Func _MsgBox() $Gui1 = GUICreate('Message', 300, 300, 300, 300, $WS_CAPTION + $WS_SYSMENU + $WS_POPUP, -1, $Gui) GUICtrlCreateLabel('Return a value', 20, 10, 180, 23) $returnval = GUICtrlCreateButton('click me', 220, 40, 80, 22) $inputbox = GUICtrlCreateInput("", 10, 80, 220, 22) GUICtrlSetData(-1, @YEAR & "-" & @MON & "-" & @MDAY & " " & @HOUR & ":" & @MIN & ":" & @SEC) GUISetState(@SW_SHOW, $Gui1) While 1 Switch GUIGetMsg() Case $returnval $myval = GUICtrlRead($inputbox) GUISetState(@SW_ENABLE, $Gui) GUIDelete($Gui1) return ($myval) ;ExitLoop Case -3 GUISetState(@SW_ENABLE, $Gui) GUIDelete($Gui1) return ("") ExitLoop EndSwitch WEnd EndFunc ;==>_MsgBox Only, the child form should be modal (should be no problem). Child form should have different looks depending on need, see my mockup in first post. This is the kind of functionality I would imagine would already exist as UDF. If not, I have a hole to fill
  22. Real informative script, can't thank you enough. Odd that on WinXP, the Right-to-Left language descriptions are always missing a bracket, so that Arabic (Yemen) would appear as العربية (اليمن) Strange little bug, probably from Windows. Question: where do you get the numbers from for the index ? All MSDN documentation I can find do not list numeric values, only text constants ? I have found this list but not sure if it's for WIN_XP or Win_7, as it seems there are differences. (Yes, I did find the list in ApiConstants.au3, but it would be useful to know where such info is on MSDN offical documentation) Perhaps you can share some knowledge about that. Then your script provides an excellent step-stone for further investigation in the Windows Locale world. Thanks
  23. Did you check included help files (and their source code). Look at directories where AutoIT is installed, in ExamplesHelpFile They are actually quite informative, although sometimes short. But to the point. You should study f.ex _ExcelBookOpen.au3 _ExcelReadArray.au3 _ExcelReadCell.au3 _IEFormElementSetValue.au3 Then paste code here in [ autoit ] [ /autoit ] about how far you got. And.. start with PseudoCode on paper or similar. Structure what you want to do.
  24. Fixed now, it was the brackets that confused editor. Thanks, also for your script. (although on my XP machine, all entries in 3rd column were blank.. are they always on XP ?)
  25. Very very interesting. I have searched for a way to use this function for a while, without resorting to databases with static information. a few suggestions: * expand the UDF to return other info such as currency, separators, name of other languages / countries etc etc. * allow users to specify locale in standard format, such as _LocalDay("", "", "fr-fr"); get current day in French / France You wish to use these excellent resources http://www.nedcomp.nl/support/origdocs/vbscript/extracted/html/vsmsclcid.aspx [chart of LCID vs standard locale names] http://www.flounder.com/localeexplorer.htm [explore everything related to locales, and then some...] Once again, thanks.
×
×
  • Create New...