Jump to content

Recommended Posts

Posted

Hi guys. I have the same problem. Here is a simple code I want to execute:

#include <AutoItConstants.au3>

MouseClick("right", 916, 522)
Sleep(1000)
Send("0");

I have the scite editor window minimized to 200x300px so the position of the right click should happen in my desired window. But it doesnt, what happens is it presses the right click but not on my desired window and then presses the Key "0" in the editor. So to me it seems like the focus is always on the scite editor.

 

Here is my scite config:

1.png.26f2eaa59a5e91601026d39215e93d5a.png

 

I would be really thankful for any suggestions.

  • Moderators
Posted

ice_Q,

Welcome to the AutoIt forums.

But in future, do not multiple necro-post in unrelated threads - just open a new thread as I have now done for you.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

  Reveal hidden contents

 

Posted

@Melba23 Seems that forked threads don't have the original poster as a 'Follower', so you might want to @ them :)

@ice_Q Using mouse clicks usually isn't the best way to automate something. Can you explain a bit more so we can help better?

If you are forced into using MouseClicks on a particular window, I'd suggest using WinActivate, WinWaitActive, and possibly even restricting the use of the mouse through BlockInput (though this requires admin permissions). After these steps, finally use the MouseClick since you can then be sure the correct window is active

All my code provided is Public Domain... but it may not work. ;) Use it, change it, break it, whatever you want.

  Reveal hidden contents
Posted

@seadoggie01 
My Problem was that the code in the script was executed in the editor and not on my desired window.
I found the solution. I tried starting scite editor with admin rights and it worked. Strange though, I was logged in as an admin.

Posted (edited)
  On 5/4/2021 at 12:49 AM, ice_Q said:

@seadoggie01 
My Problem was that the code in the script was executed in the editor and not on my desired window.
I found the solution. I tried starting scite editor with admin rights and it worked. Strange though, I was logged in as an admin.

Expand  

AutoIt need rights, if you want to touch a window that is actually elevated with admin rights. 

 

You could reproduce this with any software that use remote control. This is a NTFS rule. Not sure about MSRA witch would be an exception. 

Edited by caramen

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

  Reveal hidden contents

 

Posted

Yeah the file system is not the problem and even though the poster was thinking he’s an admin he’s not

My resources are limited. You must ask the right questions

 

Posted
  On 5/4/2021 at 12:17 PM, Danp2 said:

You sure about that? I don't see how the file system would be involved here. 🤨

Expand  

This is an abuse of language which means that it is the rules of Microsoft which manages the rights of windows why complicate matters.

 

 

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

  Reveal hidden contents

 

Posted (edited)

@Danp2 How is called the management of windows rights in Windows ? 

What is managing windows Rights ? Any kind of ACL or something ?

 

EDIT : I have to admit I said NTFS because I don't even asked myself about this. 

Edited by caramen

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

  Reveal hidden contents

 

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
  • Recently Browsing   0 members

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