Jump to content

Focus problem


Recommended Posts

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.

Link to comment
Share on other sites

  • Moderators

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:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

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

Spoiler

My Humble Contributions:
Personal Function Documentation - A personal HelpFile for your functions
Acro.au3 UDF - Automating Acrobat Pro
ToDo Finder - Find #ToDo: lines in your scripts
UI-SimpleWrappers UDF - Use UI Automation more Simply-er
KeePass UDF - Automate KeePass, a password manager
InputBoxes - Simple Input boxes for various variable types

Link to comment
Share on other sites

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

Link to comment
Share on other sites

8 hours ago, 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.

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

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Link to comment
Share on other sites

33 minutes ago, Danp2 said:

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

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

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Link to comment
Share on other sites

@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

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Link to comment
Share on other sites

  • Developers

I would call that Windows security and indeed isn't related to the FileStorage formatting. :) 

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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