I had a use for this recently, it was for making Window class names obscure and different each time an app starts. It is also useful for registering private messages.
PM_CHANNEL1 = RegisterWindowMessage(randstr(128))
szClassName = randstr(64)
What you end up with is an ugly pile of binary crap that is different each time the app starts.
' ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
FUNCTION randstr(ByVal ccnt as DWORD) as STRING
#REGISTER NONE
LOCAL var as DWORD
LOCAL cnt as DWORD
! rdtsc
! bswap eax
! mov var, eax
randomize var
src$ = ""
cnt = 0
! mov esi, ccnt
lbl:
src$ = src$ + chr$(rnd(0,255))
! add cnt, 1
! cmp cnt, esi
! jne lbl
FUNCTION = src$
End FUNCTION
' ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤