Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
encrypt decrypt a function from another function
can some 1 give me a code of how 2 decrypt a function from another function then encrypt it again

I would suggest using Johns Encrypt/Decrypt Function.

Auto Encrypt Decrypt
Taking on Quick Macros one day at a time
yeah i looked at that but i need 2 do it on the fly programatically
i think i just read something about this earlier ill try and find it again see if its what u mean
i dont think this will help but maybe you can do this with exsisting items and some how use a decrypted macros has template then when you want it encrypted use a encrypted macros has template i dnt have a clue how to code it or even if it would work

Site Admin


Use an encrypted macro as template. Then the new macro also will be encrypted.

newitem "name" "text" "encrypted item"
Kevin Wrote:yeah i looked at that but i need 2 do it on the fly programatically

As of now there is no way of programmatically decrypted a macro or function, you can use newitem to make a new function that copies the encryption of another function.
Try to automate encryption/decryption using the Options dialog.

Function EncryptDecryptMacro
Copy      Help
function encrypt ~password [$macro]

;Automates encrypting or decrypting a macro or other QM item.

;encrypt - 1 to encrypt, 0 to decrypt.
;password - password.
;macro - name of the macro. If "" or omitted - macro that is currently open.

;EncryptDecryptMacro 1 "password" ;;encrypt current macro
;EncryptDecryptMacro 0 "password" ;;decrypt current macro
;EncryptDecryptMacro 1 "password" "Dialog33" ;;encrypt Dialog33

int w1=act(win("" "QM_Editor")) ;;activate QM
,int currentmacro=qmitem
,mac+ macro ;;open the macro, if specified
int w2=win("Options" "#32770" "qm") ;;is Options already open?
if(w2) ;;yes, remember that
,int optionsopen=1
else ;;no, open it
,men 2010 w1 ;;Options ...
,w2=wait(5 win("Options" "#32770" "qm"))
SelectTab id(12320 w2) 4 ;;select Security tab
password.setwintext(id(1051 w2)); password.setwintext(id(1053 w2)) ;;enter password
but iif(encrypt 1106 1107) w2 ;;click Encrypt or Decrypt button
if(!optionsopen) but 2 w2; wait 10 -WC w2 ;;close
if(currentmacro) mac+ currentmacro ;;open current macro again

err+ end _error
wow great code there gint...not just used to do wut u made it for but soem interesting stuff in there Big Grin 8)
ty vm this will work perfectly for what i need 2 do 1 note though
if users are using any version below 2.2
they need to remove this line from the code or it will error each time
; password.setwintext(id(1053 w2))
This should be compatible with all versions

password.setwintext(id(1051 w2)); password.setwintext(id(1053 w2)); err ;;enter password
When I use the code listed i get an error
Copy      Help
Error (RT) in EncryptDecryptMacro:  exception
I can get it to work when i take out
Copy      Help
end _error
but it will keep running so i have to shut Qm down is there any hints you can tell me i am using
version would that have something to do with it.
Download the latest version of QM and try it again. Post back and let us know if it works or not.
Taking on Quick Macros one day at a time
I have updated and still same problem. So i uninstalled everything rebooted then installed Version and still same problem. Anymore ideas?? And Thank you for the help
Quote:but it will keep running

where it stops?
To discover it, you can insert this at the beginning: Deb 100
Or insert out 1, out 2 ... in several places.
Got IT thank you very much. This is great.

Forum Jump:

Users browsing this thread: 1 Guest(s)