background preloader

Objects & Classes, AHK

Facebook Twitter

CLSID List (Windows Class Identifiers) Certain special folders within the operating system are identified by unique strings.

CLSID List (Windows Class Identifiers)

Some of these strings can be used with FileSelectFile, FileSelectFolder, and Run. For example: The "Yes" entries in the last column are not authoritative: the Run command might support different CLSIDs depending on system configuration. To open a CLSID folder via Run, simply specify the CLSID as the first parameter. CLSID Key (GUID) Shortcuts List for Windows 10. Hyperlink. Shell shortcuts. Objects. An object in AutoHotkey is an abstract datatype which provides three basic functions: GET a value.

Objects

SET a value. CALL a method (that is, a function which does something with the target object). An object reference is a pointer or "handle" to a particular object. Like strings and numbers, object references can be stored in variables, passed to or returned from functions and stored in objects.

Classes in AHK

Attenction. Structures. A structure is simply a section of memory that contains structured data.

Structures

Each piece of data in the structure is known as a “member” of the structure. Structures and their members have no meaning on their own; they are simply blocks of data. size of structures The size of a given structure is equal to the sum of the sizes of each member. For example, the Rect structure is defined as follows: typedef struct _RECT { LONG left; LONG top; LONG right; LONG bottom; } RECT, *PRECT; This shows to following information: The name of the structure (RECT) The names of the members (“left”, “top”, “right”, and “bottom”) The types of the members (LONG, LONG, LONG, and LONG) Let’s look at the last point in detail. Note: Those “struct definitions” in this chapter are not AutoHotkey code, they’re C / C++. Structure members In order to access a member of a structure, one must know its type and offset.

The offset starts at 0. Since we now know the type and offset of the member, we are now able to access it. Follow. Windows Data Types (Windows) Source Link. [advanced] Using raw COM interfaces in AHK - Tutorials - AutoHotkey Community. IntroductionCOM is a very powerful way to automate things on your computer.

[advanced] Using raw COM interfaces in AHK - Tutorials - AutoHotkey Community

This tutorial will show you a way to use the very powerful COM technology even in situations whre it seems impossible at first sight. You may know the COM.ahk library by Sean or have used COM to automate IE, Word, Excel etc. But this is only a very small subset of COM. If you look around msdn, you will find plenty COM interfaces. If you know object oriented programming, you will know that interfaces define the methods and properties a class must have. Some of them, like IE or Office products, can be used easily from within AutoHotkey - either through COM.ahk or, as of AutoHotkey_L, natively. Native COM in AutoHotkey_L and AutoHotkey v2With AutoHotkey_L's native COM functions, you can do quite a lot: You can create class instances with ComObjCreate(), you can call these instance's methods, and you can interact with them in other ways. As first step, we search the interface on msdn. Ptr := ComObjCreate(CLSID, IID)

[advanced] Using raw COM interfaces in AHK - Page 2 - Tutorials - AutoHotkey Community. My DLLcall() tutorial for beginners(Messagebox) - Tutorials - AutoHotkey Community. First of all lets see the following diagram We have the green box,the ahk the red box which is c++ and blue box which includes windows API Users of AHK can expend the limits of AHK's commands by using API's functions.

My DLLcall() tutorial for beginners(Messagebox) - Tutorials - AutoHotkey Community

So dllcall can be used to make possible the things that we cant do with AHKs commands. Many people (including me)afraid of dllcall.I think it is because of the help file(by my opinion) so lets open help file and get to dll call... the first thing we see is Result := DllCall("[DllFile\]Function" [, Type1, Arg1, Type2, Arg2, "Cdecl ReturnType"]) Dont panic...

Lets edit that line a little bit Result := DllCall("DllFile\Function", "Type1", Arg1, "Type2", Arg2,..... My DLLcall() tutorial for beginners(Messagebox) - Page 2 - Tutorials - AutoHotkey Community. !42 - The Tutorial - AutoHotkey Community. Calling conventionsNow comes the really important part of this tutorial.We are going to discuss calling conventions.

!42 - The Tutorial - AutoHotkey Community

What are they? Well when you call a function you wrote in C++ or in any other language it has to be compiled.There has to be a certain standard how the function receives it's parameters and returns a value.How this is done is defined by the calling convention that is used.I'm going to tell you about cdecl, stdcall. stdcall is the standard windows API calling convention. It is the default calling convention of the DllCall function.Imagine you have the following C++ function: (Note this is Visual C++ notation)There are 2 parameters both 32 bit integers the return type is also a 32 bit integer.The calling convention is explicitly stated.

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus The cdecl convention is basically the same.

AutoHotkey, WinAPI & DllCall's

STRUCTURES, in AHK. Access Violation [verbose: DllCall RegisterCallback 0xC0000005 a. DLLCall & HIDs.