Posts: 331
Threads: 60
Joined: May 2006
This macro Is meant to toggle Encrypt/Decrypt. If your macro selected is not Encrypted it will Encrypt it, if it is Encrypted it will Decrypt it.
NOTE THIS WILL NOT DECRYPT A MACRO THAT YOU DO NOT HAVE THE PASSWORD FOR.
Also note the password has to be the same in this macro as the macro you are going to Encrypt/Decrypt.
Function ( AED_John )
Trigger ( F12 /QM )
str pw="yourpw1";; change this to the password you would like
;DO NOT! LEAVE AS "yourpw1" or someone may guess your password.
int hwnd;str enct;Acc a
men 2010 _hwndqm
hwnd=wait(5 WC win("Options" "#32770"))
if hwnd=0
,out 1
,end
act hwnd
a=acc("Security" "PAGETAB" hwnd "SysTabControl32" "" 0x1001)
a.Select(SELFLAG_TAKEFOCUS|SELFLAG_TAKESELECTION)
pw.setwintext(id(1051 hwnd))
pw.setwintext(id(1053 hwnd))
enct.getmacro("" 5)
if val(enct)=0
,but+ id(1106 hwnd)
else
,but+ id(1107 hwnd)
act hwnd
but+ id(1 hwnd)
Posts: 473
Threads: 33
Joined: Aug 2007
Once again John, this is pretty nifty. Keep the cool macros coming.
Taking on Quick Macros one day at a time
Posts: 67
Threads: 24
Joined: Feb 2009
Posts: 160
Threads: 43
Joined: Sep 2007
how can i make this toggle through a llist of my macros and encrypt or decrypt them all
Posts: 12,073
Threads: 140
Joined: Dec 2002
not tested
replace 5 lines starting from enct.getmacro
Macro
str s mlist="macro1[]macro2[]..."
foreach s mlist
,mac+ s
,enct.getmacro("" 5)
,if val(enct)=0
,,but+ id(1106 hwnd)
,else
,,but+ id(1107 hwnd)
Posts: 160
Threads: 43
Joined: Sep 2007
nice works better than my way thx
Posts: 23
Threads: 8
Joined: Aug 2005
Do these older macros still work? This one would be really useful but I'm getting a wait timeout at
hwnd=wait(5 WC win("Options" "#32770"))
Posts: 12,073
Threads: 140
Joined: Dec 2002
Replace
men 2010 _hwndqm
with
men 2007 _hwndqm
or
key AF12
Posts: 23
Threads: 8
Joined: Aug 2005
06-08-2019, 03:37 AM
(This post was last modified: 06-08-2019, 03:39 AM by Davidovsky.)
Works, thanks!
The Options menu was persisting until mouse-over for some reason, so I added at the end:
int w=win("Options" "#32770")
clo w
This macro is super-useful.