AHK How to completely hide ApplicationFrameHost.exe window (such as Windows 10 Settings, Photos, Mail) - autohotkey

I have tried WinHide but it only hides the window and the taskbar icon remains.
Before WinHide
After WinHide
Here's my code:
WinHide, ahk_class ApplicationFrameWindow ahk_exe ApplicationFrameHost.exe, Settings
MsgBox, Hidden but the taskbar icon remains
WinShow, ahk_class ApplicationFrameWindow ahk_exe ApplicationFrameHost.exe, Settings
MsgBox, Shown

Related

What window is active after click toast notification - AHK

i'm browsing google chrome then toast notification appears on bottom right.
i click it and it disappears.
after that i can see google chrome as top window, it looks like a active window but it's not activated.
then sometimes i press ctrl+t to open new tab in google chrome but it doesnt work because its not activated.
its annoying.
i want to make like below one.
#If WinActive("After Click Toast")
^t::
WinActivate ahk_exe chrome.exe
WinWaitActive ahk_exe chrome.exe
Send %A_ThisHotkey%
return
after click toast, windows spy doesnt show anything.
MsgWinTitle(){
WinGet, ExStyle, ExStyle, A
MsgBox % ExStyle
return
}
but with this shows 0x08200000
i dont know how can i use this though.
thanks for read.
thanks for help.
Thanks for Big advise
now i solved it with this
#If WinActive("ahk_class Windows.UI.Core.CoreWindow")
~LButton:: return
~LButton Up::
Send {Alt Down}{Tab}{Alt Up}
return

AutoHotkey script to right click and save an image in Word

I am trying to make a script to allow me to right click on an image and use the context menu to save it as an image at the default location and with the default image name that Word selects. I am trying to reduce a (Right Click -> Button press -> Enter) sequence to just a Ctrl + RClick combo.
Context menu screenshot
Default location and image name
This is what I have right now, which does not work:
^RButton::
MouseClick, right
Sleep, 500
Send, s
Sleep, 500
Send, {Enter}
return
Apologies if I am doing something stupid, I just started using ahk today.
Try
#IfWinActive ahk_exe WINWORD.EXE ; only if MS Word is the active window
^RButton::
KeyWait, Ctrl, L ; wait for the Control key to be released
Click right
WinWait, ahk_class Net UI Tool Window ; Word's context menu
WinActivate, ahk_class Net UI Tool Window
WinWaitActive, ahk_class Net UI Tool Window
Send, s
WinWait, Save As Picture
WinActivate, Save As Picture
WinWaitActive, Save As Picture
Send, {Enter}
return
#IfWinActive
https://www.autohotkey.com/docs/commands/_IfWinActive.htm

Make borderless window behaves alwaysontop [Autohotkey]

I want to create a borderless window, but alwaysontop didn't work if the window is borderless, how to make borderless window behave alwaysontop ?
gui, Tool: add, button, x0 y0 h20 w140 gxub, TOOLS
gui, Tool: show, w150, TOOLS
WinGet, id1, ID, A ; GET ahk_id of active window
WinSet, Style, -0xC00000, A ; hide title bar
Winset, Alwaysontop, ON, ahk_id %id1%
Adding one line on the top will satisfy your need
gui, +alwaysontop

How to activate a window after it has lost focus?

So i am using this great software called Website-Watcher, which is rss feed reader and web content tracker.
I have configured it to open external links in firefox, which is opening tabs in the background.
BUT the problem is that Website-Watcher looses focus after i hit some link, so is there a way to open a link, regain lost focus and send click to be able to scroll, i have found a script that activates window on mouse scroll BUT the scroll functionality of program is not regained.
Please, give me some ideas!
EDIT UPDATE::: I have finally made it work, the problem was with the Windows 8.1 Admin rights, because i run Website-Watcher elevated, script that i was using stopped working.
The scripts are here:
http://www.autohotkey.com/board/topic/6292-send-mouse-scrolls-to-window-under-mouse/
http://www.autohotkey.com/board/topic/99405-hoverscroll-verticalhorizontal-scroll-without-focus-scrollwheel-acceleration/?p=623967
With those scripts you can perform scroll without activating windows or if you use the former you can even activate windows with mouse scroll.
Use WinActivate
For example, WinActivate Untitled - Notepad would activate (bring focus to) the window "Untitled - Notepad". This title must be exact and is case-sensitive.
It might be easiest to do this in a low-tech way. I'm not familiar with Website-Watcher, so I'll share a script I use that you should be able to adapt.
I use Feedly in Chrome for RSS reading, and hitting "v" in Feedly opens the story in a new tab. I use my Media Play button to hit "v" and bring me back to Feedly:
Media_Play_Pause::
send v
sleep 50
send {Ctrl Down}{Shift Down}{Tab}{Shift Up}{Ctrl Up}
return
So, define your hotkey, have it trigger the link to open in Firefox, and then hit Alt-Tab to jump back:
X::
send y
sleep 50
send {Alt Down}{Tab}{Alt Up}
return
Obviously, replace "X" and "y" above.
I don't care about using my Media Play button for anything else, but if you want your hotkey to be context sensitive, use #IfWinActive.
Use "WinGet, variableName , List, yourWindowName" (without quote)
then call your variableName contate it with 1 in every ControlSend
for example :
WinGet, nexid, List, myHyperTerminal
ControlSend, , {shift down}at=cmgs{shift up}=303{ENTER}, ahk_id %nexid1%
sleep, 1000
ControlSend, , {shift down}sms{shift up}{space}10000, ahk_id %nexid1%
sleep, 1000
if you want to use control key such as shift, ctrl, alt, don't forget to add "SetKeyDelay, intDelay, intPressDuration" (without quote)
for example the script will be list this
#usehook on
SetKeyDelay, 50, 20
WinGet, nexid, List, zz1
$F6::
ControlSend, , {shift down}at=cmgs{shift up}=303{ENTER}, ahk_id %nexid1%
sleep, 1000
ControlSend, , {shift down}sms{shift up}{space}10000, ahk_id %nexid1%
sleep, 1000
return
$F7::pause
it will be sent to active/inactive window "zz1" as :
AT+CMGS=303
SMS 10000

Press a button with postmessage

There is a way to make a mouse click with postmessage, a solution without moving the mouse (no click x, y)?
For example:
loop{
hotkey,ctrl,pressb
}
pressb:
msgbox a button
PostMessage, 0x0201, , 9765141, ahk_class #32770
PostMessage, 0x0202, , 9765141, ahk_class #32770
; or ControlClick, x95 y115, ahk_class #32770
return
Functions PostMessage and ControlClick don't work, the button is not pressed.
Each of these should work
ControlClick, Button1, ahk_class #32770
ControlClick, OK, ahk_class #32770
I had the same problem (until just recently). Most of the AutoHotKey interactive commands (such as SendMessage, ControlClick, SendRawMessage and so on) does not work within a 32700 window (a dialog) as well as other windows.
Solution: If you're running Windows 7. You need to run your AHK script as an administrator. To do this, right click on your AutoHotKey Script and click on 'Run as administrator'.