6 posts in this topic
I have created a bit of code to enable a script to find named controls on a userform, even though the MS CLASS description changes between machines.
e.g. The CLASS "WindowsForms10.EDIT.app.0.24b689f_r14_ad1" for a text box on one PC is different on another.
The below code, (a cut-down version of the code from jdelaney original post) loops through all the controls and finds the first one with the desired string in the control class name - in this case "EDIT". This name is then usable for setting the text using ControlSetText.
#include <array.au3> WinActivate("Edit Part Rule") $TheClassName = GetAllWindowsControls(WinGetHandle("Edit Part Rule"), "EDIT") ;Sleep(500) ControlSetText("Edit Part Rule", "", "[CLASS:" & $TheClassName & "; INSTANCE:3]", $CmdLine) ControlSetText("Edit Part Rule", "", "[CLASS:" & $TheClassName & "; INSTANCE:4]", $CmdLine) Func GetAllWindowsControls($hCallersWindow, $sStringIncludes) ; Get all list of controls $sClassList = WinGetClassList($hCallersWindow) ; Create array $aClassList = StringSplit($sClassList, @CRLF, 2) ; Sort array _ArraySort($aClassList) _ArrayDelete($aClassList, 0) ; Loop For $i = 0 To UBound($aClassList) - 1 If StringInStr($aClassList[$i], $sStringIncludes) Then Return $aClassList[$i] EndIf Next EndFunc ;==>GetAllWindowsControls If anyone has any suggestions to improve it, or a better way to achieve the same thing, please let me know.
I was looking around the forum if there were some customizable solutions about creating a PDF from "0" to something like a report...
What I'd like to do is something with a header ( 2 logos and a title ), with a table which contains data read from a file
At the moment, I was working with HTML, since I know it and it's very simple to do a table with some data inside...
But know, I'm a bit stuck about the exporting the HTML page to PDF... And, here too, if someone knows how to do it, please, I'm here listening
A UDF with Extended Functions for Window Management
This UDF is still in the development phase. All code works and should be generally bug free, however function names and parameters are subject to change.
Fixes _WindowGetClassList's barbaric returning of a @LF separated string instead of an array.
Automating applications that change their controls' handles/classes on each launch (e.g. half of Cisco's programs)
10/04/2016 (v0.4): _WinGetClassNNList Fixed : Not Returning an Index when using $2D_ARRAY _WinGetClassNNList Fixed : Not Properly returning $aArray[x] on Classes with instances > 9 when using $2D_ARRAY 10/03/2016 (v0.3): _WinGetClassList Added : Exactly the same as WinGetClassList but returns a more civilized Array _WinGetClassNNList Added : Returns Classes and their instances in either a 1D or 2D array depending on Flags _WindowGetHandleList Renamed: _WinGetHandleList SCRIPT BREAKING! _WindowGetHandleListFromPos Renamed: _WinGetHandleListFromPos SCRIPT BREAKING! 10/01/2016 (v0.2): WindowsExConstants.au3 Added : Flags in _WindowGetHandleListFromPos _WindowGetHandleListFromPos Removed: ConsoleWrite left in during debug _WindowGetHandleListFromPos Added : Flag for if part of a Control is at $X, $Y return it as well. 10/01/2016 (v0.1): _WindowGetHandleList Added : Retrieves the handles of classes from a window. _WindowGetHandleListFromPos Added : Retrieves the handles of classes at a specific position from a window. Known and Reported Bugs:
None reported To Do:
To Be Decided. Opinions welcome! Upcoming Changes:
To Be Decided.
Please tell me, who knows how to apply and cancel styles in RTF?
The following code does not work:
#include <GuiRichEdit.au3> #include <WindowsConstants.au3> $hGUI = GUICreate("RichEdit Style", 500, 500, -1, -1) $hRichEdit = _GUICtrlRichEdit_Create($hGui, "Test", 20,40,460,400) GUISetState(@SW_SHOW, $hGUI) Sleep(3000) GUICtrlSetStyle($hRichEdit, $ES_RIGHT) Sleep(3000) GUICtrlSetStyle($hRichEdit, -1) Sleep(3000) Thanks!
Tell me, please, why in the application of different styles($SS_BLACKFRAME, $SS_BLACKRECT, etc.) of frames stops working function Msg().
And why in the application of certain frame styles($SS_BLACKFRAME) do not even picture displayed?
#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <StaticConstants.au3> Opt("GUIOnEventMode", 1) Example() Func Example() GUICreate("My GUI picture", 350, 300, -1, -1) ; will create a dialog box that when displayed is centered GUISetOnEvent($GUI_EVENT_CLOSE,"Quit") $idPic = GUICtrlCreatePic("D:\Program Files\AutoIt3\Examples\GUI\mslogo.jpg", 50, 50, 200, 50, $SS_SUNKEN) GUICtrlSetOnEvent(-1,"Msg") GUISetState(@SW_SHOW) ; Loop until the user exits. While 1 WEnd EndFunc ;==>Example Func Msg() MsgBox(0,0,0) EndFunc Func Quit() Exit EndFunc