AutoHotkey Community

It is currently May 27th, 2012, 5:48 am

All times are UTC [ DST ]




Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 1036 posts ]  Go to page Previous  1 ... 49, 50, 51, 52, 53, 54, 55 ... 70  Next
Author Message
 Post subject:
PostPosted: August 21st, 2010, 5:50 am 
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?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: August 21st, 2010, 5:59 am 
No.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: August 22nd, 2010, 12:12 am 
Offline

Joined: July 14th, 2006, 12:31 am
Posts: 290
Location: Berlin
what is the eighth icon good for?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 22nd, 2010, 9:13 am 
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?!


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: August 22nd, 2010, 9:23 am 
Offline

Joined: June 18th, 2008, 8:36 am
Posts: 4923
Location: AHK Forum
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 :wink:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 22nd, 2010, 10:39 am 
@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!


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: August 22nd, 2010, 2:06 pm 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7503
Location: Australia
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." ;)


Report this post
Top
 Profile  
Reply with quote  
PostPosted: August 22nd, 2010, 7:35 pm 
Offline

Joined: August 3rd, 2007, 8:01 am
Posts: 555
Location: Houston, TX
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 22nd, 2010, 9:36 pm 
Offline

Joined: June 18th, 2008, 8:36 am
Posts: 4923
Location: AHK Forum
Seems to work fine for me :?

_________________
AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun :wink:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 22nd, 2010, 10:45 pm 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7503
Location: Australia
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 29th, 2010, 9:42 am 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7503
Location: Australia
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 29th, 2010, 10:38 am 
Offline
User avatar

Joined: May 24th, 2009, 5:35 am
Posts: 2099
Location: Iowa, USA
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 :) .

_________________
Image
Recommended: AutoHotkey_L
Basic Webpage Controls


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 29th, 2010, 12:31 pm 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7503
Location: Australia
    Ahk2Exe64 8)
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. ;)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 29th, 2010, 2:07 pm 
Offline
User avatar

Joined: May 5th, 2007, 7:24 pm
Posts: 1240
Location: Seville, Spain
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
Highly recommended: AutoHotkey_L (see why) (all my code snippets require it)
Formal request to polyethene - I support the unity of the AutoHotkey community
Get SciTE4AutoHotkey v3.0.00 (Release Candidate)
[My project list]


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 29th, 2010, 10:37 pm 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7503
Location: Australia
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?


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 1036 posts ]  Go to page Previous  1 ... 49, 50, 51, 52, 53, 54, 55 ... 70  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 3 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group