Hi everybody,
i have a question, i don't know if it is in the right section of the forum but feel free to move it mr the mods if it isn't.
Is it possible to create a button class on a button or parameter of a window application witch doesn't have one? I want the button class control and not a mouse type control or imagesearch or FindText, to be able to control the specific button or parameter even if it is out of the screen or if the window application is minimised. Let's take the exemple of the play button of windows media player for win 7 witch doesn't show or have a button class. Could it be possible with a script on any other application to create an "injected button class" so i could control it even if the player is reduced or the play button is not shown in the screen?
Thanks in advance for your replies.
Is it possible to "Inject a button class" on a window?
Re: Is it possible to "Inject a button class" on a window?
I don't think this is possible. If a GUI button is not accessible by its name or ID or (in case of IE) through the DOM, there's not much AHK can do with it directly.
A workaround would be to bind a single hotkey to:
- activate and resize the window
- click the location of the button
- minimise the window
Which would only take a split second but it's not really an answer to your question. Just suggesting it as the only behaviour I can think of that kinda comes close.
A workaround would be to bind a single hotkey to:
- activate and resize the window
- click the location of the button
- minimise the window
Which would only take a split second but it's not really an answer to your question. Just suggesting it as the only behaviour I can think of that kinda comes close.
Re: Is it possible to "Inject a button class" on a window?
Thanks for your reply.
I know about that workaround, but was wondering if that could be possible even with another software or language than Autohotkey. That's unfortunate if that's not possible. I hope some programmer expert can enlighten us
I know about that workaround, but was wondering if that could be possible even with another software or language than Autohotkey. That's unfortunate if that's not possible. I hope some programmer expert can enlighten us
-
- Posts: 1472
- Joined: 05 May 2018, 12:23
Re: Is it possible to "Inject a button class" on a window?
with some programs including chrome you could do things via ACC.
Re: Is it possible to "Inject a button class" on a window?
Thanks that's good to know. I'm gonna do some researches but when you say chrome, do you talk about Google Chrome or another application named like that? Can you explain us a little bit what's that ACC?
-
- Posts: 2
- Joined: 06 Jan 2021, 03:36
Re: Is it possible to "Inject a button class" on a window?
I read your then I researched that when after research to about my knowledge I have two buttons, both without links, and want to add a link to one when the other is clicked. How can I make one button with an onclick give a link attribute to something else on the page? If not a button, maybe a div
The following is my current code:
<div class="container">
<div class="jumbotron" style="background-color:#000000 !important;">
<img id="myImage" src="images/closed.png" style="width:100%">
<p id="texthere"></p>
<div class="container">
<div class="row">
<div class="col">
<button onclick="document.getElementById('myImage').src='images/open.png'" class="btn btn-primary active btn-block">Open Eyes</button>
</div>
<div class="col">
<button onclick="document.getElementById('myImage').src='images/closed.png'"class="btn btn-primary active btn-block">Close eyes</button>
</div>
</div>
</div>
Thank You!!
The following is my current code:
<div class="container">
<div class="jumbotron" style="background-color:#000000 !important;">
<img id="myImage" src="images/closed.png" style="width:100%">
<p id="texthere"></p>
<div class="container">
<div class="row">
<div class="col">
<button onclick="document.getElementById('myImage').src='images/open.png'" class="btn btn-primary active btn-block">Open Eyes</button>
</div>
<div class="col">
<button onclick="document.getElementById('myImage').src='images/closed.png'"class="btn btn-primary active btn-block">Close eyes</button>
</div>
</div>
</div>
Thank You!!
-
- Posts: 1472
- Joined: 05 May 2018, 12:23
Re: Is it possible to "Inject a button class" on a window?
Google Chrome
ACC lets you control windows well beyond what you could do with the standard built in AHK commands. For example, with ACC you could change chrome tabs even when its minimized, with ACC you could get data that controlgettext cannot etc.
Without knowing what app you are talking about, its really just theoretical as to what is possible.
Re: Is it possible to "Inject a button class" on a window?
That's seems the way to go, thanks for your lights, I will investigate that ACC.
The applications that I want to control are mainly music softwares, somethings like mixers with many buttons that don't have any buttons class, only a main window (like FL Studio for example) or some music player like windows media player.
The applications that I want to control are mainly music softwares, somethings like mixers with many buttons that don't have any buttons class, only a main window (like FL Studio for example) or some music player like windows media player.
Re: Is it possible to "Inject a button class" on a window?
I don't know if your question is for me, and I would like to help you but what your wrote is out of my knowledgeRao Shaheryar wrote: ↑29 Jan 2021, 07:07I read your then I researched that when after research to about my knowledge I have two buttons, both without links, and want to add a link to one when the other is clicked. How can I make one button with an onclick give a link attribute to something else on the page? If not a button, maybe a div
The following is my current code:
<div class="container">
<div class="jumbotron" style="background-color:#000000 !important;">
<img id="myImage" src="images/closed.png" style="width:100%">
<p id="texthere"></p>
<div class="container">
<div class="row">
<div class="col">
<button onclick="document.getElementById('myImage').src='images/open.png'" class="btn btn-primary active btn-block">Open Eyes</button>
</div>
<div class="col">
<button onclick="document.getElementById('myImage').src='images/closed.png'"class="btn btn-primary active btn-block">Close eyes</button>
</div>
</div>
</div>
Thank You!!
Who is online
Users browsing this forum: Bing [Bot], Mateusz53, MrHue, mstrauss2021, Rohwedder and 313 guests