AutoHotkey Community

It is currently May 27th, 2012, 10:27 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 414 posts ]  Go to page Previous  1 ... 17, 18, 19, 20, 21, 22, 23 ... 28  Next
Author Message
 Post subject:
PostPosted: December 18th, 2009, 9:00 am 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7503
Location: Australia
Anonymous wrote:
Kinda limits the cosmetic options when it comes to compiled scripts then huh. Guess I'll need to find a way to work around having images in the gui. ):
I take it this means you were using file paths, not actually referencing the resources? I suggest you take a look at one or both of the following posts by SKAN: Embed images in compiled AutoHotkey scripts and How to convert Image data (JPEG/PNG/GIF) to hBITMAP.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 18th, 2009, 8:10 pm 
Lexikos wrote:
Anonymous wrote:
Kinda limits the cosmetic options when it comes to compiled scripts then huh. Guess I'll need to find a way to work around having images in the gui. ):
I take it this means you were using file paths, not actually referencing the resources? I suggest you take a look at one or both of the following posts by SKAN: Embed images in compiled AutoHotkey scripts and How to convert Image data (JPEG/PNG/GIF) to hBITMAP.


A lot of hassle for a branding watermark, is all. Thanks anyway.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: December 18th, 2009, 9:29 pm 
pekkle wrote:
poetbox wrote:
Guest2 wrote:
Quick Question.

What are the benefits using this complier over the standard supplied compiler ?

Is the source more secure ? Faster / Smaller etc ?

Thx

you can make it smaller,add icon,add version info ,or other which you maybe like

To add to the above, you can modify Manifest for Vista Administrator Exection Level (User Account Control) easily, instead of using the "standard" compiler, which you need to change the Manifest by using Reshacker manually. 8)


Thanks for taking the time to reply !

How about encrypting the source code ? to make it harder to decode ?

Thanks again.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: December 19th, 2009, 3:53 am 
Offline

Joined: January 20th, 2009, 3:29 am
Posts: 13
Guest2 wrote:
pekkle wrote:
poetbox wrote:
Guest2 wrote:
Quick Question.

What are the benefits using this complier over the standard supplied compiler ?

Is the source more secure ? Faster / Smaller etc ?

Thx

you can make it smaller,add icon,add version info ,or other which you maybe like

To add to the above, you can modify Manifest for Vista Administrator Exection Level (User Account Control) easily, instead of using the "standard" compiler, which you need to change the Manifest by using Reshacker manually. 8)


Thanks for taking the time to reply !

How about encrypting the source code ? to make it harder to decode ?

Thanks again.

For encrypting the source, I find no great benefit for using this compiler. The standard one already have that field allowing you to input the password ("N/A" to disable decompiling). However, with this compiler, you could specify the password (and version no.) to use for compiling in the source code and no need to input again everytime.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 11th, 2010, 4:25 am 
Offline

Joined: October 3rd, 2008, 9:42 pm
Posts: 9
very cool. thank you for sharing!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 24th, 2010, 1:44 pm 
Offline
User avatar

Joined: October 31st, 2008, 9:39 am
Posts: 641
Location: France
It's possible to include .wav file into WAVE group, and not RCData ?

For use PlaySound easly ?
http://msdn.microsoft.com/en-us/library/aa910369.aspx

And to rename resource before compile ? not 1, 2, 3, ...


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 26th, 2010, 10:37 am 
Offline
User avatar

Joined: October 31st, 2008, 9:39 am
Posts: 641
Location: France
at line 2402
Code:
      } Else If s_Resources_Ext = WAV
      {
         WAVE_I++
         WAVE_I += 0.0
         
         s_Target := "WaveX , Wav" . WAVE_I . "X ,"  ;X for debug


To use:
Code:
flags := (SND_ASYNC := 0x1) | (SND_RESOURCE := 0x40004) | (SND_NODEFAULT := 0x2)
hMod := DllCall("LoadLibrary", "str", "MyApp.exe")
DllCall( "winmm.dll\PlaySoundA", Str, "WAV01", UInt, hMod, UInt, flags ) ; don't use UPX
return

escape::
DllCall("FreeLibrary", "UInt", hMod)
exitapp


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 19th, 2010, 1:46 pm 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7503
Location: Australia
I have a request for an option: "Compile as console application."

I think the uses are fairly obvious, but can elaborate if you need me to.

The following (somewhat rudimentary) script can be used (via Run if desired) to change the subsystem of the AutoHotkeySC.bin file before the script is compiled. Ideally it would be used to modify Compile_AHK's temporary copy of the bin file rather than the original. Using it directly on a compiled script exe invalidates its checksum and prevents the script from working.
Code:
; Args:
;   1   filename of bin/exe file to switch
;   2   subsystem, i.e. "C" (console) or "G" (gui).  if omitted, switches between the two.
ifNotExist %1%
    ExitApp -1
file = %1%
if 2 not in ,C,G
    ExitApp -1

; Define Win32 constants.
GENERIC_READ  := 0x80000000
GENERIC_WRITE := 0x40000000
OPEN_EXISTING := 0x3
IMAGE_DOS_SIGNATURE := 0x5A4D
IMAGE_NT_SIGNATURE := 0x4550
IMAGE_SIZEOF_FILE_HEADER := 20
IMAGE_SUBSYSTEM_WINDOWS_GUI := 2
IMAGE_SUBSYSTEM_WINDOWS_CUI := 3

; Open file for read/write.
hfile := DllCall("CreateFile", "str", file, "uint", GENERIC_READ|GENERIC_WRITE, "uint", 0, "uint", 0, "uint", OPEN_EXISTING, "uint", 0, "uint", 0)
if hfile = -1
    ErrorExit("CreateFile failed")

; Verify EXE signature.
e_magic := SeekNumRead(hfile, 0, "ushort")
if (e_magic != IMAGE_DOS_SIGNATURE)
    ErrorExit("Bad exe file: no DOS sig")

; Get offset of IMAGE_NT_HEADERS.
e_lfanew := SeekNumRead(hfile, 60, "int")

; Verify NT signature.
ntSignature := SeekNumRead(hfile, e_lfanew, "uint")
if (ntSignature != IMAGE_NT_SIGNATURE)
    ErrorExit("Bad exe file: no NT sig")

; Calculate offset of IMAGE_OPTIONAL_HEADER and its Subsystem field.
offset_optional_header := e_lfanew + 4 + IMAGE_SIZEOF_FILE_HEADER
offset_Subsystem := offset_optional_header + 68

; Read current subsystem.
Subsystem := SeekNumRead(hfile, offset_Subsystem, "UShort")
; Toggle subsystem (do this even if it will be overridden, to validate):
if (Subsystem = IMAGE_SUBSYSTEM_WINDOWS_GUI)
    Subsystem := IMAGE_SUBSYSTEM_WINDOWS_CUI
else if (Subsystem = IMAGE_SUBSYSTEM_WINDOWS_CUI)
    Subsystem := IMAGE_SUBSYSTEM_WINDOWS_GUI
else
    ErrorExit("Bad subsystem: " Subsystem)

; Allow override on command-line:
if 2 !=  ; i.e. it is C or G
    Subsystem := IMAGE_SUBSYSTEM_WINDOWS_%2%UI

; Write new subsystem.
SeekNumWrite(Subsystem, hfile, offset_Subsystem, "UShort")

DllCall("CloseHandle", "uint", hfile)

MsgBox Changed subsystem to %Subsystem%.


; SeekNumRead: Seek to absolute offset and read a number of the specified type.
SeekNumRead(hfile, offset, type) {
    Seek(hfile, offset)
    VarSetCapacity(v,8), bytesToRead := NumPut(0,v,0,type)-&v
    if !(DllCall("ReadFile", "uint", hfile, "uint", &v, "uint", bytesToRead, "uint*", bytesRead, "uint", 0) && bytesRead == bytesToRead)
        ErrorExit("Read failed")
    return NumGet(v,0,type)
}

; SeekNumWrite: Seek to absolute offset and write a number of the specified type.
SeekNumWrite(num, hfile, offset, type) {
    Seek(hfile, offset)
    VarSetCapacity(v,8), bytesToWrite := NumPut(num,v,0,type)-&v
    if !(DllCall("WriteFile", "uint", hfile, "uint", &v, "uint", bytesToWrite, "uint*", bytesWritten, "uint", 0) && bytesWritten == bytesToWrite)
        ErrorExit("Write failed")
}

Seek(hfile, offset) {
    static FILE_BEGIN := 0
    if DllCall("SetFilePointer", "uint", hfile, "int", offset, "uint", 0, "uint", FILE_BEGIN) = -1
        ErrorExit("Seek failed")
}

ErrorExit(msg) {
    MsgBox %msg%`n  ErrorLevel=%ErrorLevel% A_LastError=%A_LastError%
    global hfile
    if (hfile != "" && hfile != -1)
        DllCall("CloseHandle", "uint", hfile)
    ExitApp
}


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 20th, 2010, 9:49 am 
Offline

Joined: February 2nd, 2008, 4:35 am
Posts: 643
3 minor things...

1) Icons tab .. Select
Maybe should disable gui momentaritly (or at least the "Compile" button) until icon's image appears (else can get an error)

2) Have script loaded into Notepad++ (haven't edited) --> Compile with Options --> Get below message
---------------------------
Reload
---------------------------
C:\<path><filename>.ahk

This file has been modified by another program.
Do you want to reload it?
---------------------------
Yes No
---------------------------

3) The en-us tab should be "Resources" not "Ressources"


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 14th, 2010, 5:18 am 
Offline

Joined: February 2nd, 2008, 4:35 am
Posts: 643
Compiler tab .. Exe file .. C:\...\SCRIPT.exe (source is SCRIPT.ahk)
--> Manually changed to C:\...\MyScript.exe

Result...
MyScript.exe
SCRIPT.ahk.ini

Should the result be...
MyScript.exe
MyScript.ahk.ini

:?:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 14th, 2010, 10:50 am 
No, really not. It's the ini for compiling script.ahk and has nothing to do with MyScript.exe.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 29th, 2010, 4:03 pm 
Offline

Joined: March 20th, 2010, 9:49 am
Posts: 224
thx so much for this
editing the RC of an AHK executable makes it corrupt

but with this its all too easy and working


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 29th, 2010, 7:27 pm 
Offline

Joined: April 20th, 2009, 1:10 pm
Posts: 817
Location: North Dakota, USA
Not sure if anyone's answered this, but how was the scrolling feature in the credits accomplised!? That's awesome!

_________________
-Jeremiah


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 29th, 2010, 7:39 pm 
Offline

Joined: May 2nd, 2006, 11:16 pm
Posts: 800
Location: Greeley, CO
Jeremiah wrote:
Not sure if anyone's answered this, but how was the scrolling feature in the credits accomplised!? That's awesome!

http://www.autohotkey.com/forum/viewtopic.php?t=6752

_________________
Image
SoggyDog
Dwarf Fortress:
"The most intriguing game I've ever played."


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 29th, 2010, 7:46 pm 
Offline

Joined: December 10th, 2008, 3:56 am
Posts: 98
ok so I dont really want to install anything as I have auto hotkey and all other programs for auto hotkey on my usb key, is there a way getting this without having to install something?


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 414 posts ]  Go to page Previous  1 ... 17, 18, 19, 20, 21, 22, 23 ... 28  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: XX0 and 21 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