Sign in to follow this  
Followers 0
Daavis

Trying to get x and y pos of windows without borders

3 posts in this topic

Hi, I'm trying to get x and y pos of browser(firefox) but without borders and window title.
I tried ControlGetPos but it doesn't work. _FFGetPostion from FF.au3 also doesn't work. I was thinking: hey can I disable the window title and border? and I found answer: yes
So I copy some function of anygui.au3 and I got this:
 

$Style = 0x00C00000
$ExStyle = -1
$result = _TargetStyle("unset", 1, $Style, $ExStyle, $handle)

I like it but in windows 10 there is a little white bar on top, like 5px.
I tested this on old computer with classic theme windows and it works fine.
I know that I can count these pixels and it works but only on my computer.
I want universal script that always work.

So my question is: Can I change window theme to classic but only one which I want?
Or if you know how can I get this pos in another way please let me know.

Share this post


Link to post
Share on other sites



33 minutes ago, Daavis said:

Hi, I'm trying to get x and y pos of browser(firefox) but without borders and window title.
I tried ControlGetPos but it doesn't work. _FFGetPostion from FF.au3 also doesn't work.

Didn't work is no error description which helps solving the issues you had. So, please make runable reproduser scripts showing your issues.

Share this post


Link to post
Share on other sites
#include <FF.au3>
#include <Array.au3>

_FFStart("https://www.google.com")
$Handle = _FFWindowGetHandle()
WinMove($Handle, "", 0, 0)
$Pos = _FFGetPosition()
_ArrayDisplay($Pos)

This code return me this:
Row|Col 0
[0]|-1
[1]|-1
[2]|-8
[3]|-31
[4]|700
[5]|650

As you can see I moved window to 0, 0 so this return position is wrong
[1] should be greater then 0 not -8
FF.au3 using ControlGetPos for this function so something goes wrong.

Local $aContent = ControlGetPos(_FFCmd(".title"), "", _FFWindowGetHandle())

 

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