 |
AutoHotkey Community Let's help each other out
|
AutoHotkey_L: Arrays, Debugger, x64, COM, #If expression ...
Goto page Previous 1, 2, 3 ... 51, 52, 53 ... 68, 69, 70 Next
|
| View previous topic :: View next topic |
| Author |
Message |
guest3456 Guest
|
Posted: Sat Aug 21, 2010 4:50 am Post subject: |
|
|
i'm currently using vanilla ahk and this script to accomplish my problem here
i now saw that LowLevel had previously had similar functionality with __expr, but it now doesn't work
does AHK_L have __expr built in functionality? |
|
| Back to top |
|
 |
lexios Guest
|
Posted: Sat Aug 21, 2010 4:59 am Post subject: |
|
|
| No. |
|
| Back to top |
|
 |
ladiko
Joined: 13 Jul 2006 Posts: 290 Location: Berlin
|
Posted: Sat Aug 21, 2010 11:12 pm Post subject: |
|
|
| what is the eighth icon good for? |
|
| Back to top |
|
 |
TomXIII n-l-i Guest
|
Posted: Sun Aug 22, 2010 8:13 am Post subject: |
|
|
Hi everyone!
I'm sorry if it's a noob question or if the topic already exists but I have problem to display french (standard) chars like é,è,à... with both MsgBox and Send methods.
Is there someone who could help me, please?! |
|
| Back to top |
|
 |
HotKeyIt
Joined: 18 Jun 2008 Posts: 4653 Location: AHK Forum
|
Posted: Sun Aug 22, 2010 8:23 am Post subject: |
|
|
| TomXIII n-l-i wrote: | Hi everyone!
I'm sorry if it's a noob question or if the topic already exists but I have problem to display french (standard) chars like é,è,à... with both MsgBox and Send methods.
Is there someone who could help me, please?! | Are you using Unicode version and have you saved your file in UTF-8? _________________ AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun  |
|
| Back to top |
|
 |
TomXIII n-l-i Guest
|
Posted: Sun Aug 22, 2010 9:39 am Post subject: |
|
|
@HotkeyIt: Thx, it works fine now!
I'm learning new features of AHKL for 2days and I don't even know how to do the basics, lol!
PS: I really like AHKL features! |
|
| Back to top |
|
 |
Lexikos
Joined: 17 Oct 2006 Posts: 7299 Location: Australia
|
Posted: Sun Aug 22, 2010 1:06 pm Post subject: |
|
|
| ladiko wrote: | | what is the eighth icon good for? | Did you forget? I suggest you re-read from this post to the post where you said "aah now i understand."  |
|
| Back to top |
|
 |
tinku99
Joined: 03 Aug 2007 Posts: 513 Location: Houston, TX
|
Posted: Sun Aug 22, 2010 6:35 pm Post subject: ComObjConnect example not working |
|
|
The example in the documentation is not working (I am running windows xp, sp2, IE7): | Code: | ie := ComObjCreate("InternetExplorer.Application")
; Connects events to corresponding script functions with the prefix "IE_".
ComObjConnect(ie, "IE_")
ie.Visible := true
ie.Navigate("http://www.autohotkey.net/~Lexikos/AutoHotkey_L/")
#Persistent
IE_DocumentComplete(ieEventParam, url, ieFinalParam) {
global ie
if (ie != ieEventParam)
s .= "First parameter is a new wrapper object.`n"
if (ie == ieFinalParam)
s .= "Final parameter is the original wrapper object.`n"
if ((disp1:=ComObjUnwrap(ieEventParam)) == (disp2:=ComObjUnwrap(ieFinalParam)))
s .= "Both wrapper objects refer to the same IDispatch instance.`n"
ObjRelease(disp1), ObjRelease(disp2)
MsgBox % s . "Finished loading " ie.Document.title " @ " url ; not shown
ie.Quit()
ExitApp
} | The messagebox is never shown inside IE_DocumentComplete.
Using com.ahk, this works: | Code: | #persistent
COM_Init()
pwb := COM_CreateObject( "InternetExplorer.Application" )
COM_Invoke( pwb, "Visible", "True" )
sink := COM_ConnectObject( pwb, "IE_" ), loading = 1 ; Connect IE object & set var "loading" as TRUE
COM_Invoke( pwb, "Navigate", "www.AutoHotkey.com" )
Return
IE_DocumentComplete() { ; the "IE_" prefix corresponds to the COM_ConnectObject() function above
MsgBox, DONE!
}
!q::
COM_DisconnectObject( sink ) ; Disconnect IE object
COM_Release( pwb ), COM_Term()
exitapp
#include com.ahk |
|
|
| Back to top |
|
 |
HotKeyIt
Joined: 18 Jun 2008 Posts: 4653 Location: AHK Forum
|
|
| Back to top |
|
 |
Lexikos
Joined: 17 Oct 2006 Posts: 7299 Location: Australia
|
Posted: Sun Aug 22, 2010 9:45 pm Post subject: |
|
|
| It works on IE8 and IE6 (except that IE6 doesn't show the page until the event handler returns; which is never if the event handler quits). IE7 seems to spawn a second window which doesn't fire the event handlers. If anyone can come up with a better example (preferably one that is commonly useful), I might replace that one. |
|
| Back to top |
|
 |
Lexikos
Joined: 17 Oct 2006 Posts: 7299 Location: Australia
|
Posted: Sun Aug 29, 2010 8:42 am Post subject: |
|
|
| Quote: | Revision 56 - August 29, 2010
Added support for x64 compiled scripts. Requires Ahk2Exe_L and x64 AutoHotkeySC.bin.
Fixed: Deref operator (*addr) rejected addresses outside 32-bit range.
Fixed: #If expression memory allocation error on x64.
Fixed: Custom hotstring end chars with code points greater than U+00FF.
Fixed: Special characters being sent out of sequence by SendInput/Play.
Fixed: */ being discarded in continuation sections (see L54). |
I've added a 64-bit option to the installer, enabled only if you're on a 64-bit system.
Currently Ahk2Exe_L is required to compile 64-bit scripts. This is included in the installer. Ahk2Exe_L has a few other changes:
- Passing /bin binfile on the command-line tells it to use a specific AutoHotkeySC.bin file.
- MPRESS is used instead of UPX as it works with 64-bit executables and offers more protection against reverse-engineering.
- Ahk2Exe cuts one character off the end of each resource name. Ahk2Exe_L doesn't.
- No "Compression" menu since it's purpose was never clear and it doesn't apply to 64-bit scripts. The option is still there and can be set via the registry.
- /NoDecompile is not supported, even with the official AutoHotkeySC.bin. AutoHotkey_L never supported it.
Currently 32-bit compiled scripts use the same "black box" library used by standard AutoHotkey to embed/extract the script and FileInstalls in the executable. Since this can't be used for 64-bit compiled scripts, the script and FileInstalls are embedded as RCDATA resources. The script is stored as plain text, so anyone wishing to hide the source would need to compress the executable with MPRESS or something similar. (Ahk2Exe_L does this by default.)
One advantage to the resource method is that it's very simple to compile a script without Ahk2Exe. All it requires is DllCall and a copy of AutoHotkeySC.bin (or a previously-compiled, uncompressed script). I can provide a demonstration script if there is any interest. If this method proves to be an adequate replacement for the old method, I may enable it in 32-bit builds. |
|
| Back to top |
|
 |
jethrow
Joined: 24 May 2009 Posts: 1907 Location: Iowa, USA
|
Posted: Sun Aug 29, 2010 9:38 am Post subject: |
|
|
| Lexikos wrote: | | I can provide a demonstration script if there is any interest. If this method proves to be an adequate replacement for the old method, I may enable it in 32-bit builds. |
I would be interested in this. ( if nothing else, would be nice to not have to look at the AutoIt logo each time I compile ) And of course, thanks for the Revisions & Updates . _________________
- in case I forgot to smile
Basic Webpage Controls
COM Object Reference |
|
| Back to top |
|
 |
Lexikos
Joined: 17 Oct 2006 Posts: 7299 Location: Australia
|
Posted: Sun Aug 29, 2010 11:31 am Post subject: |
|
|
Ahk2Exe64
| Code: | infile = Script.ahk
binfile = AutoHotkeySC.bin
outfile = Script.exe
; Copy base executable.
FileCopy %binfile%, %outfile%, 1
; Read script file.
FileRead script, %infile%
; Convert to UTF-8.
VarSetCapacity(script_utf8, script_utf8_len := StrPut(script, "UTF-8"))
StrPut(script, &script_utf8, "UTF-8")
; Embed script.
hUpdate := DllCall("BeginUpdateResource", str, outfile, int, false, ptr)
DllCall("UpdateResource", ptr, hUpdate, int, RT_RCDATA:=10, str, ">AUTOHOTKEY SCRIPT<"
, ushort, 0x409, ptr, &script_utf8, uint, script_utf8_len)
DllCall("EndUpdateResource", ptr, hUpdate, int, false) ; Commit.
|
I used this to test before I added support to Ahk2Exe_L.
Binfile should point to a 64-bit build of AutoHotkeySC, since that's currently the only one that uses the resource method. Alternatively it can point to a previously compiled 64-bit script, which could be copied or have its script updated -- as long as it isn't compressed.
If the resource name ">AHK WITH ICON<" is used, the main icon will be used unconditionally. Normally AutoHotkey uses some low-detail ones on older versions of Windows and AutoHotkey_L uses a separate icon for the tray. Ahk2Exe uses this name when you specify a custom icon.
A "complete" compiler would need to do the following at a minimum:
- Pre-process the script, merging all #includes into a single file or string of text. Function libraries can be supported by invoking AutoHotkey.exe with the /iLib switch.
- Insert each FileInstall source file using the same method as for the main script. FileInstall's first parameter should be converted to upper-case and used as the resource name. UpdateResource can be called many times between Begin' and End'.
- Handle errors.
|
|
| Back to top |
|
 |
fincs
Joined: 05 May 2007 Posts: 1163 Location: Seville, Spain
|
Posted: Sun Aug 29, 2010 1:07 pm Post subject: |
|
|
Lexikos, great release
I suggest we get rid of the HS_EXEArc blob altogether (& get real Unicode compat. for free!), although "decompiling" scripts is now just matter of using LoadLibrary() and the resource functions on the resulting .exe file... (Exe2Ahk_L anyone?)
With that said, we could also just replace Ahk2Exe with a scripted version & natively add features to it. _________________ fincs
Get SciTE4AutoHotkey v3.0.00 (Release Candidate)
[My project list] |
|
| Back to top |
|
 |
Lexikos
Joined: 17 Oct 2006 Posts: 7299 Location: Australia
|
Posted: Sun Aug 29, 2010 9:37 pm Post subject: |
|
|
| fincs wrote: | | ... although "decompiling" scripts is now just matter of using LoadLibrary() and the resource functions on the resulting .exe file... | Have you tried "decompiling" an MPRESS-compressed exe? |
|
| 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
|