Sign in to follow this  
Followers 0
yehia

Windowless controls

17 posts in this topic

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?

Share this post


Link to post
Share on other sites



@yehia

Activate the window and try :

Send("^a")
Send("^c")
Msgbox(64, '', "text : " & ClipGet())

And for count message you can count + 1 when the window exists then close it and when another or it reappears count +1 etc..

Cheers, FireFox.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

@Zedna

I dont see why you are suggesting IE udf for a msn window :) Can you explain it to me im stupid :o

Cheers, FireFox.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

@Zedna

I dont see why you are suggesting IE udf for a msn window :) Can you explain it to me im stupid :o

Cheers, FireFox.

I don't know/use MSN window in any way. I have never seen it.

I just saw DirectUIHWND ClassName mentioned in above post.

Share this post


Link to post
Share on other sites

@Zedna

Ha... ok thanks for explaination

Cheers, FireFox.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
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?

Share this post


Link to post
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.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

@yehia

Dont try to bump your topic by deleting your old post and reply with the same thing, and its not the first time :) if you continue I will have to advert mods...

Cheers, FireFox.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

#13 ·  Posted (edited)

@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

 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
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 ...

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
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
Sign in to follow this  
Followers 0