Jump to content

Windowless controls


yehia
 Share

Recommended Posts

well i was trying to make a script to get the text from msn chat window but found out that MSN is using a windowless control named "DirectUIHWND1" so this script totally failed:

While 1
    
    $b = ControlGetHandle("[CLASS:IMWindowClass]","","DirectUIHWND1")
    WinActivate("[CLASS:IMWindowClass]","")
    $a = GUICtrlRead($b,1)
    
    If $a <> "0" Then
        MsgBox(0,"",$a)
    EndIf
    
    ;ControlSend("- Conversation", "", "DirectUIHWND1", $Gesprek&"{ENTER}{ESC}")
WEnd

if there is any way to get the text in the chat window?

and since IE uses windowless controlls too can IE funcs be helpful in this case?

Link to comment
Share on other sites

thats what i expected

y didnt they just created there own windowless controls?

anyway this makes my job easier

but i've never used the IE udfs can anyone point meh and btw i was checking the IE controls after u said the DirectUIHWND is related to IE and i found it

can someone point me, maybe i write a new MSN.au3 cos the old one never works now

and btw i saw an article about something called accessibility in VB that makes a user able to handle a windowless control, can autoit do this?

Link to comment
Share on other sites

@yehia

you want to get text of wlm window (windows live messenger) right ?

If you tried my example you would have this :

If Not WinExists("[CLASS:IMWindowClass]") Then
    MsgBox(64, "WLM get text", "Any IM window exists !")
Else
    WinActivate("[CLASS:IMWindowClass]")
    WinWaitActive("[CLASS:IMWindowClass]", '', 3)
    $IMwgp = WinGetPos("[CLASS:IMWindowClass]", '')
    MouseClick("left", $IMwgp[0] + 75, $IMwgp[1] + 190, 1, 0)
    Send("^a")
    Sleep(250)
    Send("^c")
    MsgBox(64, "WLM get text", ClipGet())
EndIf

And works fine !

Cheers, FireFox.

Link to comment
Share on other sites

its not the smart thing to do but its the same as posting a bump word but in a clean way without making my topic looks messy

Dim $oldclip, $counter1

If Not WinExists("[CLASS:IMWindowClass]") Then
    MsgBox(64, "WLM get text", "Any IM window exists !")
Else
    Do
    If WinActive("[CLASS:IMWindowClass]") Then
        Sleep(250)
        ;WinWaitActive("[CLASS:IMWindowClass]", '', 3)   ; "[CLASS:IMWindowClass]")SciTEWindow
        $IMwgp = WinGetPos("[CLASS:IMWindowClass]", '')
        ;MouseClick("left", $IMwgp[0] + 75, $IMwgp[1] + 230, 1, 0)
        ControlClick("[CLASS:IMWindowClass]","","DirectUIHWND", "left",1,$IMwgp[0],$IMwgp[1] + 230)
        Send("^a")
        Sleep(100)
        Send("^c")
        $clip = ClipGet()
        If $oldclip <> $clip Then
            $counter = TimerDiff($counter1)
            ToolTip($counter/1000)
            $counter1 = TimerInit()
        EndIf
        $oldclip = $clip
        Sleep(1000)
    EndIf
    Until 1 = 5
EndIf

thats how i got so far but it keeps coping what i type in the edit control since both of them r the same control can we get around this?

Edited by yehia
Link to comment
Share on other sites

@yehia

Ok its the better way to bump your topic but not before 24hours of your last reply ...

Edit : Instead of doing that for get text, try to enable history and read text from it...

Cheers, FireFox.

Edited by FireFox
Link to comment
Share on other sites

this is my script now

HotKeySet("{F1}", "Getit")
HotKeySet("{F4}", "Stopit")

Dim $oldclip, $counter1
ToolTip("F1 to start, F4 to stop",0,0, "Ma3lomat L NANA")
Do

Until 1 = 5

Func Getit()
    If Not WinExists("[CLASS:IMWindowClass]") Then
        MsgBox(64, "WLM get text", "Any IM window exists !")
    Else
        If Not WinActive("[CLASS:IMWindowClass]") Then
            WinSetState("[CLASS:IMWindowClass]","",@SW_HIDE)
            sleep(100)
            WinSetState("[CLASS:IMWindowClass]","",@SW_SHOW)
            WinActivate("[CLASS:IMWindowClass]") ; "[CLASS:IMWindowClass]")SciTEWindow
        EndIf
        Do
            $IMwgp = WinGetPos("[CLASS:IMWindowClass]", '')
            If WinExists("[CLASS:IMWindowClass]") Then
                ControlClick("[CLASS:IMWindowClass]", "", "DirectUIHWND1", "left", 1, $IMwgp[0] + 25, $IMwgp[1] + 200)
            EndIf
            Send("^a")
            Sleep(100)
            Send("^c")
            $clip = ClipGet()
            If $oldclip <> $clip Then
                $counter = TimerDiff($counter1)
                $no = Round($counter / 1000, 1)
                ToolTip(""&$no&" Sec")
                $counter1 = TimerInit()
                $oldclip = $clip
            EndIf
        Until 1 = 5
    EndIf
EndFunc

Func Stopit()
    Do
        
    Until 1 = 5
EndFunc

still its too lame :/ if there is anyway i can type or enter text :/

im still getting info about windowless controls

should i continue or did anyone tried it and got nothing so i would just discard it ...

Link to comment
Share on other sites

  • 4 months later...

Sorry for bumping this topic, but I am also looking for a more efficient means of reading and writeing text into a DirectUIHWND control

0x616e2069646561206973206c696b652061206d616e20776974686f7574206120626f64792c20746f206669676874206f6e6520697320746f206e657665722077696e2e2e2e2e

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...