Jump to content

GUICtrlCreateObj IE


 Share

Recommended Posts

Hi...

1. How to create IE obj to have $WS_EX_CLIENTEDGE ?

Posted Image

2. And how to made IE obj without Hscroll - to have wordwrap (when is word too large) ?

#include <GUIConstants.au3>
#include <IE.au3>
#include <ButtonConstants.au3>
#include <WindowsConstants.au3>

$XT_oIE = _IECreateEmbedded()
$MainGui = GUICreate("Chat",604, 440)
$Obj_RCV = GUICtrlCreateObj($XT_oIE, 2, 2, 600, 346)
_IENavigate($XT_oIE, "about:blank")
$oBody = _IETagNameGetCollection($XT_oIE, "body", 0) ; <---------- This is new
$EditSend = GUICtrlCreateEdit("dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd",2, 350, 539, 20,0)
$Send = GUICtrlCreateButton("Send", 542, 349, 60, 22, $BS_DEFPUSHBUTTON)
GUICtrlSetState($EditSend,$GUI_FOCUS)
GUISetState(@SW_SHOW)
$begin = TimerInit()
_IEHeadInsertEventScript($XT_oIE, "document", "oncontextmenu", "return false")

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Send
            XSkinText(GUICtrlRead($EditSend))
            GUICtrlSetData($EditSend,"")
            GUICtrlSetState($EditSend,$GUI_FOCUS)
    EndSwitch
WEnd

Func XSkinText($msg = "", $color = "black", $size = "3")
    If $msg == "/clr"  Then Return _IEDocWriteHTML($XT_oIE, "")
    If $msg == "/exit"  Then Exit
    If StringInStr($msg,"/goto:",1)  Then
        $URL=StringSplit($msg,":")
        Return _IENavigate($XT_oIE,StringStripWS($URL[2],8) ,0)
    EndIf
    $sAppend = "<font face=""Verdana"" color=""#" & $color & """ size=""1"">°" & @HOUR & ":" & @MIN & ":" & @SEC & "° Nick: </font>" & "<font face=""Verdana"" color=""#" & $color & """ size=""1""> " & $msg & "</font><br>"
    _IEDocInsertHTML($oBody, $sAppend)
    $iVisibleHeight = $XT_oIE.document.body.clientHeight
    $XT_oIE.document.parentwindow.scrollBy(0, $iVisibleHeight)
    ; End New code
EndFunc
Edited by n3nE

[quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :)

Link to comment
Share on other sites

For client edge, See here: http://www.autoitscript.com/forum/index.ph...ient+edge\

A textArea element has a wrap property that defaults to off and can be set to hard or soft (hard converts line breaks to CRLF)

$oTextArea.wrap = "soft"

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...