Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

[Recycle bin] SKAN's Tips and Tricks


  • Please log in to reply
43 replies to this topic
SKAN
  • Administrators
  • 9115 posts
  • Last active:
  • Joined: 26 Dec 2005
I am one of those thankful to you for your Tutorial on posting messages to Windows.

Many Regards, :D
kWo4Lk1.png

SKAN
  • Administrators
  • 9115 posts
  • Last active:
  • Joined: 26 Dec 2005

How to check for an AutoHotkey update ?
<!-- m -->http://www.autohotke... ... 5583#95583<!-- m -->

The following Hotkey goes into my always-running-script ( already 1361 lines long ). I wrote it for myself, and later, I realised it could be of interest to someone. Hence I am posting it:

#NumpadEnter::
 tb := Chr(9)    ,   lf := Chr(10)   ,   URL := "http://www.autohotkey.com/download/"
 UrlDownloadToFile, % URL "CurrentVersion.txt" , % A_Temp "\autohotkey.version"
 Fileread, data, % A_Temp "\autohotkey.version"
 StringSplit, ln, data, %lf%
 ln2 := SubStr(ln2,1,4) "-" SubStr(ln2,5,2) "-" SubStr(ln2,7,2),     ln3 := ln3//1024
 msg := A_AhkPath lf lf "Version:" tb ln1 lf "Rel.Dt.:" tb ln2 lf "Size-KB:" tb ln3
 IfNotEqual, ln1, %A_AhkVersion%, Run, iexplore.exe %URL%,, Max
 tt := ( ln1 = A_AhkVersion ) ? "No Update Available..." : "NEW VERSION AVAILABLE !!"
 MsgBox, 262208, %tt%, %msg%
 tb:= "", lf:="",   URL:="", data:="",   ln1:="", ln2:="", ln3:="",   msg:="", tt:=""
Return

It checks for a new release, and if available, opens the download page in Internet Explorer.

Credit: See Serenity's Post. You can understand it better.


kWo4Lk1.png

polyethene
  • Members
  • 5519 posts
  • Last active: May 17 2015 06:39 AM
  • Joined: 26 Oct 2012
That looks really* confusing lol. I don't see why you had to use tb := Chr(9) for a tab char and a bunch of SubStrs for the second line when FileReadLine/Regex would have worked. Here's a simplified version:
file = %A_Temp%\ahk-cv.txt

url = http://www.autohotkey.com/download/

UrlDownloadToFile, %url%CurrentVersion.txt, %file%

FileRead, v, %file%

FileDelete, %file%

FileGetVersion, c, %A_AhkPath%

StringSplit, v, v, .`n

n := 0, RegExMatch(v, "m)^([\d.]+)", d)

Loop, Parse, c, .

	n += v%A_Index% > A_LoopField

FormatTime, d, %d2%, LongDate

If n {

	MsgBox, 4, New updates available, Would you like to download AutoHotkey %d1%?

	IfMsgBox, Yes

		Run, %url%

} Else MsgBox, , No new updates

	, You are running the latest version of AutoHotkey. `n`nVersion: %d1%`nReleased: %d%

autohotkey.com/net Site Manager

 

Contact me by email (polyethene at autohotkey.net) or message tidbit


SKAN
  • Administrators
  • 9115 posts
  • Last active:
  • Joined: 26 Dec 2005

That looks really* confusing lol.


Yes! I too thought so after posting it. But it looked beautiful while I was coding it. :(

I don't see why you had to use tb := Chr(9) for a tab char


In some instances that makes me to understand my code better and readable, like:

; CSV listing of the Windows Folder

; q=quote, c=comma, s=space, lf=linefeed, tb=htab. rt=carriage return
q:=Chr(34), c:=Chr(44), s:=Chr(32), lf:=Chr(10), tb:=Chr(9), rt:=Chr(13)

Loop %WinDir%\*.*
CSV .= q A_LoopFileName q s c s q A_LoopFileTimeModified q s c s q A_LoopFileSizeKB q lf

MsgBox, % CSV

a bunch of SubStrs for the second line when FileReadLine/Regex would have worked.


Oh! SubStr() is a FoxPro command and it comes to me naturally.. I just wanted to crop the first 8 digits and there was some space left on the line.. and so .. you see. :D

Thanks for your version. That can be better understood.

:)
kWo4Lk1.png

SKAN
  • Administrators
  • 9115 posts
  • Last active:
  • Joined: 26 Dec 2005
Hi Friends, :)

I never knew until today that Control+S toggles the size of Volume Control dialog. I was googling for something more serious and I accidentally came to know about this. Thought this might be of some information. Or maybe, many of you already know :?: :roll:

Anyways.. I was quick to try whether the following works:

Run, SndVol32.exe /S

It works !!! :D

Regards, :)
kWo4Lk1.png

  • Guests
  • Last active:
  • Joined: --
i don't know how inserting own menu to system context menu would be done.
but it would be good if we can see that tutorial on this superb tutorial list
whatever many thanks SKAN!

Maria-
  • Members
  • 17 posts
  • Last active: Jul 22 2009 09:05 PM
  • Joined: 29 May 2009
similar topic. sound alert whenver a network cable is unplugged. any idea?

Username is taken
  • Guests
  • Last active:
  • Joined: --
Nice

  • Members
  • 234 posts
  • Last active: Dec 30 2011 11:24 PM
  • Joined: 08 Nov 2009

How to Refresh " Icons Display " in System Tray ?
<!-- m -->http://www.autohotke... ... 5641#55641<!-- m -->


See TrayIcon_Cleanup() for nicer way. (Tested on XP, prob not OK on Win7)

TLM
  • Administrators
  • 3864 posts
  • Last active:
  • Joined: 21 Aug 2006
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

Posted Image

don't duplicate, iterate!


SKAN
  • Administrators
  • 9115 posts
  • Last active:
  • Joined: 26 Dec 2005

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. :)

TLM
  • Administrators
  • 3864 posts
  • Last active:
  • Joined: 21 Aug 2006

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. :)

Posted Image
Yes please :mrgreen:!

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..

Posted Image

don't duplicate, iterate!


Deo
  • Members
  • 199 posts
  • Last active: Jan 31 2014 03:19 PM
  • Joined: 16 May 2010
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:
<!-- m -->http://msdn.microsof... ... rop_Events<!-- m -->
DragEnter and DragOver
how can i do this with COM?

jonathan scott james
  • Members
  • 24 posts
  • Last active: May 04 2018 03:25 PM
  • Joined: 23 Feb 2015

I GET ERRORS ON ALL THE LINKS TO SKAN'S TIPS AND TRICKS.oops caps