 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
unnamed.ahk Guest
|
|
| Back to top |
|
 |
Hardeep
Joined: 02 Jul 2006 Posts: 87
|
|
| Back to top |
|
 |
Sean
Joined: 12 Feb 2007 Posts: 1255
|
Posted: Wed Jul 04, 2007 5:35 pm Post subject: |
|
|
| Hardeep wrote: | | Thanks for sharing this wonderful work of yours (assuming the site in the link belongs to you). |
Hmm... Can you read Japanese? If so, would you tell us that there are any comments about the credits on the original scripts?
As far as I checked, most, if not all, of the scripts on that site are modifications of the scripts already posted in this forum.
As a matter of fact, I was about recommending it to the users having little knowlege on COM, but ...
Anyway, there is one thing here I didn't know about: the COM event is callbacked really via Dispatch interface, not via VTable interface.
It'll reduce lots of work on COM sink implementation. |
|
| Back to top |
|
 |
BoBoĻ Guest
|
Posted: Fri Jan 11, 2008 1:57 pm Post subject: |
|
|
| Quote: | | Hmm... Can you read Japanese? | I recall that PhiLho once mentioned to be able to speak 'Nippon style'  |
|
| Back to top |
|
 |
COM TTS Guest
|
Posted: Fri Jan 11, 2008 3:13 pm Post subject: |
|
|
above link contains very interesting scripts.
I translated contents into English through Goole.
History and description
| Code: |
COM library operations managed by people here build buzz
Ver 0.3 β
Specifications are subject to change will be.
● Overview
WSH and used to be able to handle a COM object
Using ●
RAIBURARIFORUDA script (AutoHotkey.exe folder in the "Lib" folder)
In the script want to use in "ActiveX ()" function to perform
Alternatively, the script into the same folder,
# Include A_ScriptDir%% \ ActiveX.ahk
Written.
* # Include A_ScriptDir%% i \ ActiveX.ahk
ActiveX ()
Then, either to work.
● samples
Sample_IE.ahk
IE contents of the page to start writing, in response to the event
Sample_JScript.ahk
Control script generation and JScript Heredoc embedded code to run
Sample_SpeechRecognition
Calls speech recognition component, word recognition and word corresponding to the event to perform work
● provide functions
ActiveX ActiveX initialize ()
CreateObject (ProgID, IID = "", CLSCTX = 5) to create objects
Inv (pIDisp the name [, p1, p2 ..., p10]) object to the method of execution
Gp (pIDisp the name [, p1, p2 ..., p10]) to obtain the properties of objects
Pp (pIDisp, name, p1 [, p2, p3 ..., p10]) set the object's properties
VNull inv () / gp / pp null arguments used to obtain values
VObj inv () object / gp / pp argument for the value of transformation
ConnectObject (pIDisp, prefix, itf) function to assign event
EvArgc event arguments (prm) structure to obtain the number of elements
EvArgv (prm the index) in the event to win the argument structure elements
EvReturn (res, value) return value of the event to set up a structure
CreateDispatchObject (prefix, exsize = 0) IDispatch object to create and
Assigned functions in the script
COM CoInitialize initialize ()
COM liberation CoUninitialize ()
Release reduce reference counter (pObj)
ReleaseL (p1, p2 ..., p10]) multiple objects at once liberating
AddRef object reference counter (pObj) Increases
QueryInterface (pObj, strIID = "") interface to gain
M (pObj the index) of the object function pointer to get vTable
CoTaskMemAlloc COM (size) of memory to ensure work
CoTaskMemFree work for COM (ptr) Free memory
● Prepare function
ActiveX ()
Summary
Perform initialization ActiveX.ahk
Return Value
None
Supplement
CreateObject needed to be run in,
# Include if you use a good read
● IDispatch related functions
CreateObject (strProgID, strIID = "", CLSCTX = 5)
Summary
COM object and interface to create a win
Argument
StrProgID
Create an object ID to indicate strings program
(Example: "InternetExplorer.Application")
"(0002DF01-0000-0000-C000-000000000046)" can specify like CLSID
StrIID
Get interface specifies the interface ID
(Example: "(00020400-0000-0000 - C000-000000000046)")
IDispatch of default will be obtained.
CLSCTX
Management of the newly created object code to be executed context
The sum of the following
0x01 (CLSCTX_INPROC_SERVER)
0x02 (CLSCTX_INPROC_HANDLER)
0x04 (CLSCTX_LOCAL_SERVER)
0x16 (CLSCTX_REMOTE_SERVER)
Return value
Interface obtained (data storing a pointer to the memory area)
0 failure
Inv (pIDisp the name [, p1, p2 ..., p10])
Summary
IDispatch calling object methods to obtain the return value
Argument
PIDisp
CreateObject and obtained by IDispatch interface
Name
The method name
P10 ... p1
Methods to give arguments.
Usually, as a string given to the methods side will be converted to the appropriate value.
Value truth, "" true "" "" false "and" do as he.
IDispatch null object and the following vNull (), () vObj
Identify and give value to convert.
Return value
Return Value Method
If the object, a pointer to the object
Supplement
Treatment convenience, some arguments in the range of 64-bit integers is not granted,
Usually, more than 32 bit integer is used because it is not a problem.
Gp (pIDisp the name [, p1, p2 ..., p10])
Summary
IDispatch object from getting a property
Argument
PIDisp
CreateObject and retrieve object pointer by IDispatch
Name
Name of the property
P10 ... p1
Properties arguments (index) if you have specified
Return value
The value of property acquired
If the object, a pointer to the object
Pp (pIDisp, name, p1 [, p2, p3 ..., p10])
Summary
IDispatch set object properties
Argument
PIDisp
CreateObject and retrieve object pointer by IDispatch
P10 ... p1
Argument.
The last argument is the set value.
Otherwise, the array index.
Example
Obj.Item (row, col) = value; like to do assignments
"Pp (obj," Item ", row, col, value)".
VNull ()
Summary
Inv / pp / gp null argument to specify the value of gain
Return Value
0x7FFFFFFF00000000.
This value is treated as VT_NULL
VObj (pIDisp)
Summary
Inv / pp / gp IDispatch object to the argument to pass to get the value of
Argument
PIDisp
CreateObject and retrieve object pointer by IDispatch
Return Value
0x7FFFFFF00000000 | pIDisp.
The lower value of 32 bits, treated as an object pointer
● Events Related Functions
ConnectObject (pIDisp, prefix, itf = "")
Summary
IDispatch connect object of the event
Argument
PIDisp
CreateObject and obtained by IDispatch interface
Prefix
Event entity function name prefix
Itf
The first allocation interfaces. Usually Unnecessary. Default is the default.
Return Value
Success "0"
Supplement
Event occurs, the prefix name for the event and consolidated the functions called by name
Function in the event source object, the parameters,
Return value of the destination to receive three arguments
(Example: "ev_onunload (this, prm, res)")
EvArgc following the evArgv, evReturn, you can return value parameters
The event registration, etc. # Persistent state resident to leave
EvArgc (prm)
Summary
Parameter structure that preserves the values of gain
Argument
Prm
The second event function argument address given structure
Return Value
The number of values
EvArgv (prm the index)
Summary
Parameter structure holding it to obtain values
Argument
Prm
The second event function argument address given structure
Index
The index values
Start with a "0"
Return Value
Had been stored value
EvReturn (res, value)
Summary
Return value structure set value
Argument
Res
The third event function argument address given structure
Value
Set
● Creating object-Dispatch
CreateDispatchObject (prefix, exsize = 0)
Summary
IDispatch to create objects and methods begin with a prefix assigned functions
Argument
Prefix
Method and substantive prefix function
Exsize
Object structure secure additional capacity.
Assigned functions in the NumPut (100, this +16) and
NumGet (+16 this) way, any information can be stored.
Expansion is partially offset "16" starts.
Return Value
IDispatch created object pointer
Supplement
Prefix "MyObj_" to the object created "MyMethod"
Is invoked, the function is called MyObj_MyMethod.
Function pointer to the object itself, the parameters, return values destination,
Calling the flag receive four arguments
(Example: "MyObj_MyMethod (this, prm, res, flag)")
Which of the following flag?
1 = method calls
2 = property acquisition
3 = Configuration Properties
4 = refer to assign properties
● COM generic function
CoInitialize ()
Summary
COM to make arrangements for the use
Supplement
() Called ActiveX, which ordinarily is not required
CoUninitialize ()
Summary
Clean up when done using COM conduct
AddRef (pObj)
Summary
Object reference count increase
Argument
PObj
Pointer to the object
Return Value
PObj return itself
Release (pObj)
Summary
Refer to reduce object count
Argument
PObj
Pointer to the object
Supplement
Gp inv () () and the object is returned,
Release () always needed when you have
QueryInterface (pObj, strIID = "")
Summary
Object to get another interface
Argument
PObj
Object
StrIID
Get interface interface specified in the ID string CLSID
Default is IDispatch
Return value
The new interface pointer
0 failure
M (pObj, index)
Summary
Method object to the number specified in the function pointer to win
Argument
PObj
Object
Index
Function pointer index table
Start with a "0"
Which interface also QueryInterface = 0, 1 = AddRef, because Release 2 =
Usually specify more than 3
Return value
Function pointer (DllCall mainly used as the first argument)
Notes
PObj index and unfair to specify a fatal error may be so careful
CoTaskMemAlloc (size)
Summary
COM for use in secure memory
Argument
Size
Number of bytes of memory secure area
Return Value
Pointer to the allocated memory area
CoTaskMemFree (ptr)
Summary
COM used to free up memory
Argument
Ptr
Pointer memory
Return Value
None
Notes
IShellFolder ITEMIDLIST also returned to the caller and accordingly should be freed.
● unpopulated element
Array
Named arguments
To avoid needless to speed up processing
● History
2007/07/04 v0.3 β
CreateDispatchObject Add ()
2007/07/03 v0.21 β
To fix does not work evArgv
VNull (), () to add vObj
2007/07/03 v0.2 β
AutoHotkey v1.0.47.00 features using efficiency
Event-related features
2007/03/17 v0.1 β
Tentative completion
|
|
|
| Back to top |
|
 |
COMTTS Guest
|
Posted: Fri Jan 11, 2008 3:20 pm Post subject: |
|
|
| Code: | #Persistent
#include %A_ScriptDir%\ActiveX.ahk
ActiveX()
ie:=CreateObject("InternetExplorer.Application")
pp(ie,"Visible","true")
inv(ie,"Navigate","about:blank")
doc:=gp(ie,"Document")
win:=gp(doc,"parentWindow")
inv(doc,"write","Hello!<br><br>")
ConnectObject(doc,"Document_")
ConnectObject(win,"Window_")
Release(doc)
Release(win)
Release(ie)
return
Document_onfocusin(this,prm,res){
inv(this,"write","focuse in<br>")
}
Document_onfocusout(this,prm,res){
inv(this,"write","focuse out<br>")
}
Window_onbeforeunload(this,prm,res){
MsgBox, iexplorer is closing.
SetTimer,quit,-100
}
quit:
ExitApp |
|
|
| Back to top |
|
 |
majkinetor
Joined: 24 May 2006 Posts: 3600 Location: Belgrade
|
Posted: Fri Jan 11, 2008 3:27 pm Post subject: |
|
|
There are bunch of highly proffesional scripts on that page.... surprise surprise...
However, there is no single e-mail, and original site is (xrea.com) is jap web free hosting. So, this guy who did bunch of really nice scripts remains hidden for some reason. Most of the scripts were done on AHK forum one way or another, but dude presented many real modules that can be reused. _________________
 |
|
| Back to top |
|
 |
COM TTS Guest
|
Posted: Fri Jan 11, 2008 3:57 pm Post subject: |
|
|
yeah. I don't know it's from Ahk Fourum or not.
But it was easy for me to understand.
| Code: |
Document_onfocusin(this,prm,res){ ; <-- working, interesting!
inv(this,"write","focuse in<br>")
}
Document_onfocusout(this,prm,res){ ; <-- not working in ie7
inv(this,"write","focuse out<br>")
}
Window_onbeforeunload(this,prm,res){ <--- working, good
MsgBox, iexplorer is closing.
SetTimer,quit,-100
}
| [/code] |
|
| Back to top |
|
 |
Guest
|
Posted: Fri Jan 11, 2008 3:57 pm Post subject: |
|
|
I again received the notification mail, on the subject I couldn't recognize. Now I can recall.
You may check the dates and the contents of those scripts. Is it sensible?
BTW, if you happen to keep the originally posted ActiveX in the forum, could you post it in this thread? I'd like to compare it with the current one in that web page. The date seems to remain the same. |
|
| Back to top |
|
 |
Sean
Joined: 12 Feb 2007 Posts: 1255
|
Posted: Fri Jan 11, 2008 4:00 pm Post subject: |
|
|
The previous message was by me.
BTW, this script will suffer the same problem as WScript's event handler. It'll not work with all events, like InternetExplorer.Application, Excel.Application, etc.
Last edited by Sean on Fri Jan 11, 2008 4:14 pm; edited 1 time in total |
|
| Back to top |
|
 |
COMTTS Guest
|
Posted: Fri Jan 11, 2008 4:09 pm Post subject: |
|
|
oh, you were Sean.
I don't know I just followed the link
and read the readme.txt , but it was Japanse,.
Above is ReadMe.txt included in the linked file.
So I put that japapnese readme.txt into Google Translation service.
And I posted for someone who is interested in that.
'cause I could understand only a littlbe of the script.
I can barely understand most of it. |
|
| Back to top |
|
 |
Sean
Joined: 12 Feb 2007 Posts: 1255
|
Posted: Fri Jan 11, 2008 4:25 pm Post subject: |
|
|
| COMTTS wrote: | | Above is ReadMe.txt included in the linked file. |
I became cautious to comment on those scripts as I don't understand Japanese either. The one thing I was pretty sure was that the dates of the scripts seemed wrong, but I can't really tell. That's the reason why I requested to post the original ActiveX if keeping it. |
|
| Back to top |
|
 |
COMTTS Guest
|
Posted: Fri Jan 11, 2008 5:00 pm Post subject: |
|
|
At frist, I didn't know why you were asking.
Now I understand what you are meaning.
I didn't even think about that
'cause I have been just a just code copy-pate man, maybe will always be.
But what you are saying is important, I guess.
Maybe he doesen't know the fact he posted here in the past.  |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|