Can you please help
is it possible to take a ScreenShot without using keys and shortcuts, only by AHK script? Similar like you just open any file
so to say, that a s cript is a stand-alone program with 1 function
I searched in the web,
but the majority of topics about {PrintScreen} are about re-mapping the keyboard shortcut,
like this
Code: Select all
F11:: Send {PrintScreen}
Code: Select all
Space::Send <#{PrintScreen}
I bet there should be just a command for PrintScreen.
I suggest I shoud use
Code: Select all
Run, Target
Code: Select all
Run ::{20d04fe0-3aea-1069-a2d8-08002b30309d}
The required behaviour is similar to this (by @teadrinker
(this script opens Windows10 calendar just by opening the ".ahk file)
Code: Select all
ControlGet, hClock, hwnd,, TrayClockWClass1, ahk_class Shell_TrayWnd
accClock := AccObjectFromWindow(hClock, OBJID_CLIENT := 0xFFFFFFFC)
accClock.accDoDefaultAction(0)
AccObjectFromWindow(hWnd, idObject = 0) {
static IID_IDispatch := "{00020400-0000-0000-C000-000000000046}"
, IID_IAccessible := "{618736E0-3C3D-11CF-810C-00AA00389B71}"
, OBJID_NATIVEOM := 0xFFFFFFF0, VT_DISPATCH := 9, F_OWNVALUE := 1
, h := DllCall("LoadLibrary", "Str", "oleacc", "Ptr")
VarSetCapacity(IID, 16), idObject &= 0xFFFFFFFF
DllCall("ole32\CLSIDFromString", "Str", idObject = OBJID_NATIVEOM ? IID_IDispatch : IID_IAccessible, "Ptr", &IID)
if DllCall("oleacc\AccessibleObjectFromWindow", "Ptr", hWnd, "UInt", idObject, "Ptr", &IID, "PtrP", pAcc) = 0
Return ComObject(VT_DISPATCH, pAcc, F_OWNVALUE)
}
thanks