Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 12/13/2012 in all areas

  1. The following code is an adaptation of the IE.au3 UDF. By including this, you will be able to access Iframes and their content based on their ID's instead of their Names. As always, Critisism is welcome! Regards. Orrin Gradwell #include-once #include "WinAPIError.au3" ; #FUNCTION# ==================================================================================================================== ; Name...........: _IEFrameGetObjById ; Description ...: Returns an object reference to a Frame by ID ; Parameters ....: $o_object - Object variable of an InternetExplorer.Application, Window or Frame object ; $s_id - ID of the Frame you wish to match ; Return values .: On Success - Returns an object variable pointing to the Window object in a Frame, @EXTENDED = Frame count ; On Failure - Returns 0 and sets @ERROR ; @ERROR - 0 ($_IEStatus_Success) = No Error ; - 3 ($_IEStatus_InvalidDataType) = Invalid Data Type ; - 4 ($_IEStatus_InvalidObjectType) = Invalid Object Type ; - 7 ($_IEStatus_NoMatch) = No Match ; @Extended - Contains invalid parameter number ; Origional Author ........: Dale Hohm ; Adapted By ..............: Orrin Gradwell ; =============================================================================================================================== Func _IEFrameGetObjById(ByRef $o_object, $s_id) If Not IsObj($o_object) Then __IEErrorNotify("Error", "_IEFrameGetObjById", "$_IEStatus_InvalidDataType") Return SetError($_IEStatus_InvalidDataType, 1, 0) EndIf ; Local $oTemp, $oFrames If Not __IEIsObjType($o_object, "browserdom") Then __IEErrorNotify("Error", "_IEFrameGetObjById", "$_IEStatus_InvalidObjectType") Return SetError($_IEStatus_InvalidObjectType, 1, 0) EndIf If __IEIsObjType($o_object, "document") Then $oTemp = $o_object.parentWindow Else $oTemp = $o_object.document.parentWindow EndIf If _IEIsFrameSet($oTemp) Then $oFrames = _IETagNameGetCollection($oTemp, "frame") Else $oFrames = _IETagNameGetCollection($oTemp, "iframe") EndIf If $oFrames.length Then For $oFrame In $oFrames If $oFrame.id = $s_id Then Return SetError($_IEStatus_Success, 0, $oTemp.frames($s_id)) Next __IEErrorNotify("Warning", "_IEFrameGetObjById", "$_IEStatus_NoMatch", "No frames matching Id") Return SetError($_IEStatus_NoMatch, 2, 0) Else __IEErrorNotify("Warning", "_IEFrameGetObjById", "$_IEStatus_NoMatch", "No Frames found") Return SetError($_IEStatus_NoMatch, 2, 0) EndIf EndFunc ;==>_IEFrameGetObjById
    2 points
  2. Having logic on your server is as secure as it gets gets, but this raises the problem of server downtime. I don't think paying customers would appreciate their paid application failing because your server is having issues/being maintained/whatever. How many different hosts are enough when failure occurs on one. The end of this question is always the same. You have to weigh up the pro's and con's of your particular circumstances and act accordingly. If your application is going to make enough money for instance, you might consider getting two or maybe three hosts to apply your logic server side <- example Believe it or not, there are still people in there hundreds of thousands who are honest paying customers for a good product with support and updates. Not everybody knows how to attack/crack a script, or where to find a cracked script, or even where to look, and wouldn't even get it if they did. My advice is always this: (which I probably read on here) Make some basic authentication checks and focus on the quality of the product rather than it's security. Ask Bill Gates how he protects windows.
    2 points
  3. Example#AutoIt3Wrapper_Au3Check_Parameters= -d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 #include <GuiRichEdit.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <Color.au3> Opt('MustDeclareVars', 1) Global $lblMsg, $hRichEdit Main() Func Main() Local $hGui = GUICreate("Example (" & StringTrimRight(@ScriptName, 4) & ")", 320, 350, -1, -1) $hRichEdit = _GUICtrlRichEdit_Create($hGui, "", 10, 10, 300, 220, _ BitOR($ES_MULTILINE, $WS_VSCROLL, $ES_AUTOVSCROLL)) $lblMsg = GUICtrlCreateLabel("", 10, 235, 300, 60) GUISetState() _GUICtrlRichEdit_SetText($hRichEdit, "Hello, my name is John") ;11-14 18-22 _GUICtrlRichEdit_SetSel($hRichEdit, 10, 14) _GUICtrlRichEdit_SetCharColor($hRichEdit, 0x0000FF) _GUICtrlRichEdit_SetSel($hRichEdit, 17, 22) _GUICtrlRichEdit_SetCharColor($hRichEdit, 0xdaa520) While GUIGetMsg() <> -3 Sleep(10) WEnd _GUICtrlRichEdit_Destroy($hRichEdit) EndFunc ;==>Main
    1 point
  4. UEZ

    Edit box indent and color

    As far as I know it is not possible to achieve it with an edit control but using the RichtTextFormat it should be possible. Look in the help file to find more information about RTF. Br, UEZ
    1 point
  5. Hold down Alt and type 14. ♫♫ ♫♫ That doesn't necessarily mean they are ascii char 14 (in fact they aren't, 0-20 are non-printing (Edit: Slightly in-accurate, 0-32 are control characters. That includes whitespace)). ClipPut(ChrW(0x266b)) I actually put the character in notepad, then saved as a unicode text file, then opened in a hex editor. Must be an easier way, but ah well.
    1 point
  6. Upgraded version 2. I have updated the source code on the first post. Basically I added the ability to save the current grid pattern and load it at will with Ctrl + s and Ctrl + l That way you can have as many tries on a particular grid pattern you want.
    1 point
  7. _GUICtrlHeader_GetOrderArray, _GUICtrlHeader_SetOrderArray Corrected Example #include <GUIConstantsEx.au3> #include <GuiHeader.au3> $Debug_HDR = False ; Check ClassName being passed to functions, set to True and use a handle to another control to see it work Global $iMemo _Main() Func _Main() Local $hGUI, $hHeader, $aOrder[5] = [4, 3, 1, 2, 0] ; Create GUI $hGUI = GUICreate("Header", 400, 300) $hHeader = _GUICtrlHeader_Create($hGUI) $iMemo = GUICtrlCreateEdit("", 2, 24, 396, 274, 0) GUICtrlSetFont($iMemo, 9, 400, 0, "Courier New") GUISetState() ; Add columns _GUICtrlHeader_AddItem($hHeader, "Column 1", 100) _GUICtrlHeader_AddItem($hHeader, "Column 2", 100) _GUICtrlHeader_AddItem($hHeader, "Column 3", 100) _GUICtrlHeader_AddItem($hHeader, "Column 4", 100) ; Set order array _GUICtrlHeader_SetOrderArray($hHeader, $aOrder) ; Show order array $aOrder = _GUICtrlHeader_GetOrderArray($hHeader) For $iI = 1 To $aOrder[0] MemoWrite("Index: " & $iI-1 & ", Order: " & $aOrder[$iI] & ' (' & _GUICtrlHeader_GetItemText ($hHeader, $iI-1) & ')') Next ; Loop until user exits Do Until GUIGetMsg() = $GUI_EVENT_CLOSE EndFunc ;==>_Main ; Write a line to the memo control Func MemoWrite($sMessage) GUICtrlSetData($iMemo, $sMessage & @CRLF, 1) EndFunc ;==>MemoWrite In all the examples (_GUICtrlHeader_...) you need to add support for Unicode. Otherwise, the column names are not displayed. _GUICtrlHeader_SetUnicodeFormat ($hHeader, True) _GUICtrlHeader_GetItemAlign, _GUICtrlHeader_SetItemAlign, _GUICtrlHeader_GetItemFormat, _GUICtrlHeader_SetItemFormat ; Reset column ; Set column
    1 point
×
×
  • Create New...