Jump to content

Meerecat

Active Members
  • Posts

    92
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Meerecat's Achievements

Wayfarer

Wayfarer (2/7)

0

Reputation

  1. Many thanks for your help guys. Guess I should have tried it first rather than taken the help file as gospel. Thanks again MC Edit: Sure it won't surprise you, but it works perfectly. Feeling mildly stupid. Thanks guuys
  2. Thank you for your reply. According to the help file those commands only work in Windows 2000 and Windows XP. Is this not the case? Thanks again
  3. Hello I have searched the functions and help files, and suspect there is no easy way to do what I need. I am designing a simple gui for an 8 year old and want 2 buttons to control the volume in Windows 7. I see that I can use Send parameters for Windows 2000 and XP, but cannot find anything suitable for Windows 7. Can anybody help? Many thanks
  4. Hi John, thanks for your help. I accomplished this by updating the registry key then ending and restarting explorer.exe which seems to update the system. Thanks again Lee
  5. AutoIT writes the registry key correctly. It just doesn't work until after a reboot. Editing the registry key via the registry directly also doesn't work until after a reboot. However using the option within the control panel (which updates the same registry key), works without a reboot. Confused lol
  6. I have found the DWORD that this setting updates in the registry. If I use the registry to change the value it doesn't work until after a reboot, however using the control panel option works immediately. Is there any way around this? (I realise this is no longer an AutoIT issue, but hoping someone may have an idea). Many Thanks
  7. It is listed as a USB Input Device in Device Manager. However the regwrite seems the easiest way, at least to my limited knowledge. Thanks guys
  8. Hello I have a Dell Inspiron Duo. It is a nice little netbook but I find the touch screen irritating at times. I can disable it by going to Control Panel>Pen and Touch>Touch and unchecking 'Use your finger as an input device'. I would like to create a hotkey to toggle this checkbox on and off without having to open the dialogue. Can anybody point me in the right direction of where to start? Many Thanks Lee
  9. Any suggestions? Much obliged, Lee
  10. Hello I use _ResourceSetImageToCtrl to insert an image in a GUI. This works great. My problem is under certain circumstances it doesn't work. I use this in my _main() gui. When I call the _encrypt() or _decrypt() function in my script and go straight back the image shows. However if I actually complete the encrypt or decrypt the image then dissapears from the main function. Here is my _main() code: Func _main() GUIDelete() $prompt = GUICreate("Meerecat File Guard", 288, 287) GUISetBkColor(0xFFFFFF) $MainMenu = GUICtrlCreateMenu("&Main Menu") $encrypt_menu = GUICtrlCreateMenuItem("&Encrypt File", $MainMenu) $decrypt_menu = GUICtrlCreateMenuItem("&Decrypt File", $MainMenu) $exit_menu = GUICtrlCreateMenuItem("E&xit", $MainMenu) $HelpMenu = GUICtrlCreateMenu("&Help") $contact_menu = GUICtrlCreateMenuItem("&Contact Us", $HelpMenu) $about_menu = GUICtrlCreateMenuItem("&About", $HelpMenu) GUICtrlCreatePic("meerecat.jpg", 8, 58, 113, 150) _ResourceSetImageToCtrl($pic1, "MEERECAT_JPG_1") ; set JPG image to picture control from resource $Label2 = GUICtrlCreateLabel("Meerecat File Guard", 66, 8, 155, 23) GUICtrlSetFont(-1, 12, 800, 0, "Leelawadee") $encrypt = GUICtrlCreateButton("Encrypt File", 155, 86, 100, 30) GUICtrlSetFont(-1, 10, 800, 0, "Leelawadee") $decrypt = GUICtrlCreateButton("Decrypt File", 155, 135, 100, 30) GUICtrlSetFont(-1, 10, 800, 0, "Leelawadee") GUISetState(@SW_SHOW) While 1 $aMsg = GUIGetMsg(1) ; Use advanced parameter to get array Switch $aMsg[1] ; check which GUI sent the message Case $prompt Switch $aMsg[0] Case $GUI_EVENT_CLOSE Exit Case $encrypt _encrypt() Case $decrypt _decrypt() Case $encrypt_menu _encrypt() Case $decrypt_menu _decrypt() Case $contact_menu ShellExecute("http://www.meerecat-itservices.co.uk/contact-us") Case $exit_menu Exit Case $about_menu GUICtrlSetState($about_menu, $GUI_DISABLE) _about() EndSwitch Case $about_gui Switch $aMsg[0] Case $GUI_EVENT_CLOSE ; If we get the CLOSE message from this GUI - we just delete the GUI <<<<<<<<<<<<<<< GUIDelete($about_gui) GUICtrlSetState($about_menu, $GUI_ENABLE) EndSwitch EndSwitch WEnd EndFunc ;==>_main And my _encrypt() code: Func _encrypt() GUIDelete() $hWnd = GUICreate("Meerecat File Guard", 288, 287) GUISetBkColor(0xFFFFFF) $MainMenu = GUICtrlCreateMenu("&Main Menu") $encrypt_menu = GUICtrlCreateMenuItem("Encrypt File", $MainMenu) $decrypt_menu = GUICtrlCreateMenuItem("Decrypt File", $MainMenu) $exit_menu = GUICtrlCreateMenuItem("Exit", $MainMenu) $HelpMenu = GUICtrlCreateMenu("&Help") $contact_menu = GUICtrlCreateMenuItem("Contact Us", $HelpMenu) $about_menu = GUICtrlCreateMenuItem("About", $HelpMenu) $Label2 = GUICtrlCreateLabel("Meerecat File Guard", 66, 8, 155, 23) GUICtrlSetFont(-1, 12, 800, 0, "Leelawadee") $Label3 = GUICtrlCreateLabel("Meerecat IT Services ©2011", 376, 224, 145, 17) GUICtrlSetFont(-1, 6, 400, 0, "MS Sans Serif") $back = GUICtrlCreateButton("Back", 155, 231, 100, 30) GUICtrlSetFont(-1, 10, 800, 0, "Leelawadee") $InFileLabel = GUICtrlCreateLabel("Input File", 8, 56, 56, 19) GUICtrlSetFont(-1, 10, 400, 0, "Leelawadee") $InFileInput = GUICtrlCreateInput("", 8, 72, 225, 21) $OutFileLabel = GUICtrlCreateLabel("Output File", 8, 110, 67, 19) GUICtrlSetFont(-1, 10, 400, 0, "Leelawadee") $OutFileInput = GUICtrlCreateInput("", 8, 123, 225, 21) $InFileButton = GUICtrlCreateButton(". . .", 240, 72, 30, 25) $OutFileButton = GUICtrlCreateButton(". . .", 240, 123, 30, 25) $PasswordLabel = GUICtrlCreateLabel("Encryption Password", 8, 159, 125, 19) GUICtrlSetFont(-1, 10, 400, 0, "Leelawadee") $PasswordInput = GUICtrlCreateInput("", 7, 175, 225, 21) $EncryptButton = GUICtrlCreateButton("Encrypt", 35, 230, 100, 30) GUICtrlSetFont(-1, 10, 800, 0, "Leelawadee") If ($CmdLine[0] > 0) Then ;Used to prefill input areas GUICtrlSetData($InFileInput, $CmdLine[1]) GUICtrlSetData($OutFileInput, $CmdLine[1] & $Extension) EndIf GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $back _main() Case $encrypt_menu _encrypt() Case $decrypt_menu _decrypt() Case $contact_menu ShellExecute("http://www.meerecat-itservices.co.uk/contact-us") Case $exit_menu Exit Case $about_menu _about() Case $InFileButton $file = FileOpenDialog("Input File", "", "All files (*.*;)") If $file <> "" Then GUICtrlSetData($InFileInput, $file) GUICtrlSetData($OutFileInput, $file & $Extension) EndIf Case $OutFileButton $file = FileSaveDialog("Output file", "", "Any file (*.*;)") If $file <> "" Then GUICtrlSetData($OutFileInput, $file) Case $EncryptButton $infile = GUICtrlRead($InFileInput) If Not FileExists($infile) Then MsgBox(16, "Error", "Input file doesn't exists!") ContinueLoop EndIf $outfile = GUICtrlRead($OutFileInput) If $outfile = "" Then MsgBox(16, "Error", "Please input a output file") ContinueLoop EndIf $password = GUICtrlRead($PasswordInput) If $password = "" Then MsgBox(16, "Error", "Please input a password") ContinueLoop EndIf AdlibRegister("Update", 333) $success = _Crypt_EncryptFile($infile, $outfile, $password, $CALG_RC4) If $success Then MsgBox(0, "Success", "Operation succeeded") _main() Else Switch @error Case 1 MsgBox(16, "Fail", "Failed to create key") Case 2 MsgBox(16, "Fail", "Couldn't open source file") Case 3 MsgBox(16, "Fail", "Couldn't open destination file") Case 4 Or 5 MsgBox(16, "Fail", "Encryption error") EndSwitch EndIf AdlibUnRegister("Update") WinSetTitle($hWnd, "", "File Encrypter") EndSwitch WEnd EndFunc ;==>_encrypt Just in case it's a problem somewhere else in the code, I've attached the full au3 file. Many thanks for any help. LeeMeerecat File Guard.au3
  11. Thank you both very much, that's perfect. Now to have a play around with this
  12. I'm obviously being thick, so please feel free to tell me so. But do I somehow use that with FileOpen? I have looked at the help file, just don't get it. Thanks, and feel free to tell me to go away if this is so simple I should just get it
  13. Works like a charm, thank you. Rather than inserting the text into the script directly, could I store it in a separate text or ini file and read it from that, without actually opening the file? I guess I would use FileOpen, but can I put the contents of a file into the clipboard, given I'm not really opening the file? Many Thanks Lee
  14. Hello I am trying to write a script where certain text is entered into a document using a hotkey. It works, ie the text is entered when the hotkey is pressed. But it seems to continue to hold down the SHIFT + CTRL keys until I toggle sticky keys on and off, even if I quit the script. Here is my example: #Include <Misc.au3> $dll = DllOpen("user32.dll") While Sleep(100) ;Loop the program If _IsPressed("11", $dll) AND _IsPressed("31", $dll) AND _IsPressed("10", $dll) Then _Send() If _IsPressed("7B", $dll) Then DllClose($dll) Exit EndIf WEnd Func _Send() Send ('Please find attached pro forma for your order as requested. Also attached are our bank details should you wish to make payment directly into our account. On receipt of cleared funds we will despatch your order. Please note, this could take up to 4 working days.'& @LF & @LF & 'If you have any queries or need further information, please do not hesitate to contact me.') ;Send('test') EndFunc It only occurs when sending long strings of text. If I Send('test') the problem doesn't occur. Incidentally is the a better way of doing this, ie rather than 'Sending' the text, perhaps copy the text straight from a separate text file? I guess I would start with FileOpen but am lost after that. Any advice greatfully received. Kind Regards Lee
  15. What version of Windows do you have? I ran your script with 'test 1' as the folder name and it worked for me.
×
×
  • Create New...