 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
SKAN
Joined: 26 Dec 2005 Posts: 8688
|
Posted: Fri Jun 25, 2010 7:31 am Post subject: Re: Thanks |
|
|
| AaronStarr wrote: |
Great. Thanks for the pointing that out. Your code is Awesome too.
 |
Thanks!
BTW, Do you see the problem when I [Quote] your post ?!
Your need to put your signature in your profile: http://www.autohotkey.com/forum/profile.php?mode=editprofile |
|
| Back to top |
|
 |
lbl Guest
|
Posted: Sat Aug 14, 2010 10:03 pm Post subject: Re: TipsNTricks: How to retrieve File fullpath from Explorer |
|
|
Nice idea! I also propose an alternate solution, using the magic operation "Clipboard = %Clipboard%". Maybe others already mentioned that solution?
| Code: |
#c::
;Using this #c instead of the usual ^c will copy the full path of the file instead of the reference of the file
Clipboard =
Send, ^c
ClipWait, 1
Clipboard = %Clipboard%
ToolTip, Clipboard : %ClipBoard%
KeyWait, LWin
ToolTip
Return
|
|
|
| Back to top |
|
 |
fragman
Joined: 13 Oct 2009 Posts: 1199
|
Posted: Sun Aug 15, 2010 10:34 am Post subject: |
|
|
| I think using COM is the preferred way for explorer. Does not work with file dialogs or desktop though. It has been posted on the forums before, if you can't find it I can try to dig it up. |
|
| Back to top |
|
 |
TLM
Joined: 21 Aug 2006 Posts: 2926 Location: The Shell
|
Posted: Mon Aug 16, 2010 8:17 pm Post subject: |
|
|
I have a small request for how to brute force constants ( avoiding crashes if possible ).
I'd like to be able to find some undoc'd allusive magical hex if possible .
thnx _________________
paradigm.shift:=(•_•)┌П┐RTFM||^.*∞ |
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 8688
|
Posted: Tue Aug 17, 2010 6:26 am Post subject: |
|
|
| TLM wrote: | | I have a small request for how to brute force constants ( avoiding crashes if possible ). |
Them are made for each other
But if you want to know how constants work, then it is quite a story and maybe I can post a tut.  |
|
| Back to top |
|
 |
TLM
Joined: 21 Aug 2006 Posts: 2926 Location: The Shell
|
Posted: Tue Aug 17, 2010 3:32 pm Post subject: |
|
|
| SKAN wrote: | | TLM wrote: | | I have a small request for how to brute force constants ( avoiding crashes if possible ). |
Them are made for each other
But if you want to know how constants work, then it is quite a story and maybe I can post a tut.  |
Yes please !
I mean I think I get the part of ratcheting threw sequential hex vals and seeing what each returns.
Its knowing exactly what the return part/errorlevel is doing that seems like it would be confusing.
Anyhoo, I'm sure this would come in handy for many users ..
Thnx again in advance.. _________________
paradigm.shift:=(•_•)┌П┐RTFM||^.*∞ |
|
| Back to top |
|
 |
dotslashc
Joined: 28 Oct 2010 Posts: 9
|
Posted: Thu Oct 28, 2010 3:41 am Post subject: Re: How to Hook on to Shell to receive its messages ? |
|
|
| SKAN wrote: |
| Code: | Gui +LastFound
hWnd := WinExist()
DllCall( "RegisterShellHookWindow", UInt,hWnd )
MsgNum := DllCall( "RegisterWindowMessage", Str,"SHELLHOOK" )
OnMessage( MsgNum, "ShellMessage" )
Return ; // End of Auto-Execute Section //
ShellMessage( wParam,lParam ) {
; Execute a command based on wParam and lParam
}
|
|
Hi,
THanks for this. I have a question regarding this? How do I add this code to default Autohotkey script that I use (the one with my regular hotkey /hotstrings etc?)
I tried adding this code as it is at end of the file , it doesn't work however. |
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 8688
|
Posted: Thu Oct 28, 2010 3:48 am Post subject: Re: How to Hook on to Shell to receive its messages ? |
|
|
| dotslashc wrote: | | I tried adding this code as it is at end of the file , it doesn't work however. |
| Code: | | Return ; // End of Auto-Execute Section // |
Please refer AHK Documentation for 'auto-execute section'.
Revert back if you have a problem in understanding the concept.
 |
|
| Back to top |
|
 |
dotslashc
Joined: 28 Oct 2010 Posts: 9
|
Posted: Thu Oct 28, 2010 7:23 am Post subject: Re: How to Hook on to Shell to receive its messages ? |
|
|
| SKAN wrote: | | dotslashc wrote: | | I tried adding this code as it is at end of the file , it doesn't work however. |
| Code: | | Return ; // End of Auto-Execute Section // |
Please refer AHK Documentation for 'auto-execute section'.
Revert back if you have a problem in understanding the concept.
 |
Silly me.
Thanks for the pointer. |
|
| Back to top |
|
 |
dotslashc
Joined: 28 Oct 2010 Posts: 9
|
Posted: Thu Oct 28, 2010 7:53 am Post subject: |
|
|
Unfortunately not working for me still.
I am trying to include some other scripts i found here.
| Code: | #include %A_ScriptDir%\My Scripts\notifylockunlock.ahk
#include %A_ScriptDir%\My Scripts\iSwitcher.ahk
notify_lock_unlock()
; Calls function "on_lock()" when computer is locked and "on_unlock()" when computer is unlocked
|
Does location of these lines make difference? My understanding is that #include directive execute the script in included AHK file immediately. Will the return command in included file affect what I am trying to do?
If I put above code before the following code | Code: | Gui +LastFound
hWnd := WinExist()
DllCall( "RegisterShellHookWindow", UInt,hWnd )
MsgNum := DllCall( "RegisterWindowMessage", Str,"SHELLHOOK" )
OnMessage( MsgNum, "ShellMessage" )
Return |
Then only iSwitcher and notifyunlocklock works. If I put it later only the "RegisterShellHookWindow" code works.
I really want to keep my include files seperate. Any workaround?
Last edited by dotslashc on Thu Oct 28, 2010 7:59 am; edited 1 time in total |
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 8688
|
Posted: Thu Oct 28, 2010 7:58 am Post subject: |
|
|
| It is preferable that you use #include at the end of the script. |
|
| Back to top |
|
 |
dotslashc
Joined: 28 Oct 2010 Posts: 9
|
Posted: Thu Oct 28, 2010 8:04 am Post subject: |
|
|
| SKAN wrote: | | It is preferable that you use #include at the end of the script. |
Yup, tried this. Now my iSwitcher script is causing issue. The pretty UI of this script doesn't show up.
Edit: I guess I have no choice but to run iSwitcher in seperate script. |
|
| Back to top |
|
 |
Deo
Joined: 16 May 2010 Posts: 172
|
Posted: Fri Oct 29, 2010 10:51 am Post subject: |
|
|
hi all
Can anyone give a hint on how to track that files dragging is occuring over the gui?
I couldn't find any messages which would help me, the only one that related to dragging it is WM_DROPITEM (or something like that), but it occurs only when you release dragged item
If you have any thoughts about this, please don't hide
It seems i need to get this events:
http://msdn.microsoft.com/en-us/library/ms742859.aspx#Drag_and_Drop_Events
DragEnter and DragOver
how can i do this with COM? |
|
| Back to top |
|
 |
ruespe* Guest
|
Posted: Mon Nov 15, 2010 7:39 pm Post subject: ea2apaza |
|
|
| SKAN wrote: | How to search and replace a text string present in a Binary file ?
I have seen repeated requests for changing the ahk_class for compiled scripts' GUI.
Credit: The technique of string replacement in AutoHotkeySC.bin with a Hex editor was posted by Serenity here : Compiled scripts Window class
I present my pure AHK version of the said technique. It is neither very fast, nor too slow, but should suffice for quick toggling of the ahk_class:
| Code: | ; AutoHotkeySC.bin Patcher / Written by A.N.Suresh Kumar AKA "Goyyah", 24-Nov-2006.
SetBatchLines, -1
ahk_class_exi := "AutoHotkeyGUI" ; Hopefully not been changed already by the script.
ahk_class_new := "AHK-GUI " ; Pad enough spaces to match length of above var.
StringLeft, ahk_class_new, ahk_class_new, 15 ; Make sure of the writable length.
AHKSC := RegExReplace(A_AhkPath, "(.*)\\.*$", "$1") . "\Compiler\AutoHotkeySC.Bin"
IfNotExist, %AHKSC%, ExitApp ; Make sure that the file exists.
FileGetSize, binDataSz, %AHKSC% ; StrLen() does not work for Binary data
FileRead , binData , %AHKSC% ; Read the whole file into a variable
Loop, %binDataSz%
If ( *(&binData+(A_Index-1)) = 0 )
DllCall( "RtlFillMemory", UInt,&binData+(A_Index-1), Int,1, UChar,32 )
; The above loop tinkers the binData by replacing Null Characters with Spaces
StrOffset := InStr( binData, ahk_class_exi ) - 1
If (StrOffset < 0) {
MsgBox, 16, AutoHotkeySC.bin Patcher, String not found !? :: %ahk_class_exi%
ExitApp
}
; Following are obsolete 16Bit file IO functions that gets the patchwork done!
hFile := DllCall( "_lopen", Str,AHKSC, Int,0x2 )
DllCall( "_llseek", Int,hFile, Int,StrOffset, Int,0 )
DllCall( "_lwrite", Int,hFile, Int, &ahk_class_new, Int,StrLen(ahk_class_new) )
DllCall( "_lclose", Int,hFile )
MsgBox, 64, AutoHotkeySC.bin Patcher, Successfully Patched :: %ahk_class_new%, 10 |
That is it
PS: I am not satisfied. I have explained only about UCHAR that occupies a single memory byte. There are WORD ( 2 byte ) and DWORD ( 4 byte ) that stores 32 bit integers..... But, this post is already too long . Maybe later!
Regards,  |
Hi Skan,
you already mentioned, that there may be WORD and DWORD-Characters. Now with AHK_L it has happened. With the latest AHK_L-version of Autohotkey.bin the Autohotkey.bin patcher isn't running any more (Errormsg String not found !?). I think, it's only a small change for you, but a giant step for me. So would it be possible to adapt yout script to AHK_L and UTF-8?
Thanks in advance. |
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 8688
|
Posted: Tue Nov 16, 2010 1:11 pm Post subject: Re: ea2apaza |
|
|
| ruespe* wrote: | | would it be possible to adapt yout script to AHK_L |
| Code: | ; AutoHotkeySC.bin String Patcher for AHK_L 32b Unicode / by SKAN 16-Nov-2010.
PathToAHKSC := "E:\Lexikos\AutoHotkeySC.bin"
StrOld := "AutoHotkeyGUI"
StrNew := "MyGUI"
FileGetSize, Sz, %PathToAHKSC%
FileRead, Bin, *c %PathToAHKSC%
nLen := StrLen( StrOld ) * 2
VarSetCapacity( StrRep, nLen, 0 )
StringLeft, StrRep, StrNew, %nLen%
If ( ( Off := InBuf( &Bin,Sz, &StrOld,nLen ) ) < 0 ) {
MsgBox, 16, AutoHotkeySC.bin Patcher, String not found !? :: %StrOld%
ExitApp
}
hFile := DllCall( "_lopen", AStr,PathToAHKSC, Int,0x2 )
DllCall( "_llseek", UInt,hFile, UInt,Off, Int,0 )
DllCall( "_lwrite", UInt,hFile, UInt,&StrRep, UInt,nLen )
DllCall( "_lclose", UInt,hFile )
Return ; // end of auto-execute section //
InBuf( hayP,hayS, neeP,neeS, sOff=0 ) { ; slightly altered version of InBuf() by wOxxOm
Static InBuf ; Original version available @ www.autohotkey.com/forum/topic25925.html
If ( ! VarSetCapacity( InBuf )) {
FiH =
( LTrim Join
530CEC83E58955|5D8B9C57565251|C28E0F00FB8314|8B104D8B000000|41D929C1291845|8B000000
B18E0F|0C758BC701087D|2A744BACFCC031|4B36744B2D744B|AD933F754B1474|008B850FAEF293|E
BF4751F390000|7F75AEF2AD4E75|68EBF775FF4739|8A62EB7475AEF2|27386C75AEF226|AD669356E
BF875|39665E75AEF293|434E47EBF7751F|C1DA89FC7589AD|E283F45D8902EB|87DF87F8558903|AE
F2CA87FB87D1|F775FF47393775|03C783CA89FB89|85F44D8BFC758B|DE75A7F30474C9|0474C985F8
4D8B|4FDF89D375A6F3|5F9D08452BF889|14C2C95B595A5E|F0EBD0F7C03100
)
VarSetCapacity( InBuf,224,0 )
Loop, Parse, FiH, |
NumPut( "0x" A_LoopField, InBuf,(7*(A_Index-1)), "Int64" )
}
Return DllCall( &InBuf, UInt,hayP, UInt,neeP, UInt,hayS, UInt,neeS, UInt,sOff )
}
; "AutoHotkeyGUI" in Unicode hex: 4100750074006F0048006F0074006B0065007900470055004900
|
|
|
| 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
|