Jump to content

Menu problem


Recommended Posts

In my program i have a menu at the top and two tabs however the menu only responds when the current tab is the second one - any ideas? I can post the source code if needed.

Thx

My Programs:AInstall - Create a standalone installer for your programUnit Converter - Converts Length, Area, Volume, Weight, Temperature and Pressure to different unitsBinary Clock - Hours, minutes and seconds have 10 columns each to display timeAutoIt Editor - Code Editor with Syntax Highlighting.Laserix Editor & Player - Create, Edit and Play Laserix LevelsLyric Syncer - Create and use Synchronised Lyrics.Connect 4 - 2 Player Connect 4 Game (Local or Online!, Formatted Chat!!)MD5, SHA-1, SHA-256, Tiger and Whirlpool Hash Finder - Dictionary and Brute Force FindCool Text Client - Create Rendered ImageMy UDF's:GUI Enhance - Enhance your GUIs visually.IDEA File Encryption - Encrypt and decrypt files easily! File Rename - Rename files easilyRC4 Text Encryption - Encrypt text using the RC4 AlgorithmPrime Number - Check if a number is primeString Remove - remove lots of strings at onceProgress Bar - made easySound UDF - Play, Pause, Resume, Seek and Stop.
Link to comment
Share on other sites

  • Moderators

In my program i have a menu at the top and two tabs however the menu only responds when the current tab is the second one - any ideas? I can post the source code if needed.

Thx

It's Friday... everyone turned the Mind Reading Caps off :o... Yeah would be great if you posted the code.. you would get a response alot faster for sure.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

oops i forgot it was friday :o heres the script

#NoTrayIcon
#include <GUIConstants.au3>
#include <file.au3>
#include <array.au3>
;check for idea.com used for encryption
If FileExists("C:\Windows\idea.com") Then
Else
    MsgBox(48,"File error!", "Please move the idea.com file to C:\Windows for the program to run!!")
    Exit
EndIf

$GUI=GUICreate("Encrypt0r", 600, 500);GUI
 
AutoItSetOption("GUICoordMode", 1)
;text tab
$tab=GUICtrlCreateTab(10, -1, 583, 470)
$tab0=GUICtrlCreateTabItem("text")
$tab0english=GUICtrlCreateEdit("", 50, 30, 400, 200, $ES_MULTILINE)
$tab0encrypted=GUICtrlCreateEdit("", 50, 250, 400, 200, $ES_MULTILINE)
;file tab
$tab1=GUICtrlCreateTabItem("file")
$tab1encrypt = GUICtrlCreateButton("Encrypt File", 50, 100, 80, 25)
$tab1decrypt=GUICtrlCreateButton("Decrypt File", 150, 100, 80, 25)

;menu
$filemenu = GUICtrlCreateMenu ("File")
;~ GUICtrlSetState(-1,$GUI_DEFBUTTON)
$helpmenu = GUICtrlCreateMenu ("Help")
$saveitem = GUICtrlCreateMenuitem ("Options",$filemenu)
GUICtrlSetState(-1,$GUI_DISABLE)
$infoitem = GUICtrlCreateMenuitem ("About..",$helpmenu)
$infoitemn = GUICtrlCreateMenuitem ("Info", $helpmenu)
$exititem = GUICtrlCreateMenuitem ("Exit",$filemenu)
$recentfilesmenu = GUICtrlCreateMenu ("Recent Files",$filemenu,1)

$separator1 = GUICtrlCreateMenuitem ("",$filemenu,2)   ; create a separator line

GUISetState(@SW_SHOW)

While 1
    $msg = GUIGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE Or $msg = $exititem 
        ExitLoop
            
    Case $msg = $infoitem 
        Msgbox(0,"About..","Encrypt0r Beta 1")
            
    Case $msg = $infoitemn 
        Run("notepad.exe") 
        WinWaitActive("Untitled - Notepad")
        Send("Encrypt0r Unfinished")
        Sleep(10000)
        WinClose("Untitled - Notepad")
        WinwaitActive("Notepad", "The text in the Untitled file has changed.")
        Send("!n")
             
    Case $msg = $tab1encrypt
        $filename=FileOpenDialog("Choose File to Encrypt", "C:\", "All Files (*.*)|Text Files(*.txt)|Image Files(*.jpg;*.bmp;*.png;*.gif)", "1")
        If @error <> 1 Then
        Dim $szDrive, $szDir, $szFName, $szExt
        $TestPath = _PathSplit($filename, $szDrive, $szDir, $szFName, $szExt)
        $copy="C:\Temp\" & $szFName & $szExt
        $move=$szDrive & $szDir & $szFName & $szExt & ".encrypt"
        FileCopy($filename, $copy)
        FileMove($copy, $move, 1)
        $pass = InputBox("Key", "Please enter the key to be used for encryption")  ;Max 128 chars
        If $pass = "" Then
            MsgBox(48, "Warning!", "No key entered!! 'default' will be used as the key!")
            $pass = "default"
        EndIf
        $mode = "+";or "-" usually + is used for encrypt, - for decrypt but it can be vice versa.
        Run(@comspec & " /c echo " & $pass & "|idea.com " & $mode & " " & FileGetShortName($move),"",@sw_hide)
        MsgBox(0, "Encrypted", "Encryption Complete")
        If @error <> 1 Then GUICtrlCreateMenuitem ($filename,$recentfilesmenu)
        EndIf
        
    Case $msg = $tab1decrypt
        $filename=FileOpenDialog("Choose File to Decrypt", "C:\", "Encrypted Files (*.encrypt)", "1")
        If @error <> 1 Then 
        Dim $szDrive, $szDir, $szFName, $szExt
        $TestPath = _PathSplit($filename, $szDrive, $szDir, $szFName, $szExt)
        $copy="C:\Temp\" & $szFName & $szExt
        $move=$szDrive & $szDir & $szFName
        FileCopy($filename, $copy)
        FileMove($copy, $move, 1)
        $pass = InputBox("Key", "Please enter the key used to encrypt this file.")    ;Max 128 chars
        If $pass = "" Then
            MsgBox(48, "Decryption Aborted", "No key entered.. Try Again")
        EndIf
        If $pass <> "" Then
            $mode = "-";or "-" usually + is used for encrypt, - for decrypt but it can be vice versa.
            Run(@comspec & " /c echo " & $pass & "|idea.com " & $mode & " " & FileGetShortName($move),"",@sw_hide)
            MsgBox(0, "Decrypted", "Decryption Complete")
        EndIf
        If @error <> 1 Then GUICtrlCreateMenuitem ($filename,$recentfilesmenu)
        EndIf
    Endselect
WEnd
Exit

GUIDelete()

Exit

extract the attached file and place it in C:\Windows (it encrypts files as you can see in the script)

My Programs:AInstall - Create a standalone installer for your programUnit Converter - Converts Length, Area, Volume, Weight, Temperature and Pressure to different unitsBinary Clock - Hours, minutes and seconds have 10 columns each to display timeAutoIt Editor - Code Editor with Syntax Highlighting.Laserix Editor & Player - Create, Edit and Play Laserix LevelsLyric Syncer - Create and use Synchronised Lyrics.Connect 4 - 2 Player Connect 4 Game (Local or Online!, Formatted Chat!!)MD5, SHA-1, SHA-256, Tiger and Whirlpool Hash Finder - Dictionary and Brute Force FindCool Text Client - Create Rendered ImageMy UDF's:GUI Enhance - Enhance your GUIs visually.IDEA File Encryption - Encrypt and decrypt files easily! File Rename - Rename files easilyRC4 Text Encryption - Encrypt text using the RC4 AlgorithmPrime Number - Check if a number is primeString Remove - remove lots of strings at onceProgress Bar - made easySound UDF - Play, Pause, Resume, Seek and Stop.
Link to comment
Share on other sites

  • Developers

Close the GUITabs with GUICtrlCreateTabitem ("") like:

$GUI = GUICreate("Encrypt0r", 600, 500);GUI

AutoItSetOption("GUICoordMode", 1)
;text tab
$tab = GUICtrlCreateTab(10, -1, 583, 470)
$tab0 = GUICtrlCreateTabItem("text")
$tab0english = GUICtrlCreateEdit("", 50, 30, 400, 200, $ES_MULTILINE)
$tab0encrypted = GUICtrlCreateEdit("", 50, 250, 400, 200, $ES_MULTILINE)
;file tab
$tab1 = GUICtrlCreateTabItem("file")
$tab1encrypt = GUICtrlCreateButton("Encrypt File", 50, 100, 80, 25)
$tab1decrypt = GUICtrlCreateButton("Decrypt File", 150, 100, 80, 25)
GUICtrlCreateTabitem ("") 
;menu
$filemenu = GUICtrlCreateMenu("File")
;~ GUICtrlSetState(-1,$GUI_DEFBUTTON)
$helpmenu = GUICtrlCreateMenu("Help")
$saveitem = GUICtrlCreateMenuItem("Options", $filemenu)
GUICtrlSetState(-1, $GUI_DISABLE)
$infoitem = GUICtrlCreateMenuItem("About..", $helpmenu)
$infoitemn = GUICtrlCreateMenuItem("Info", $helpmenu)
$exititem = GUICtrlCreateMenuItem("Exit", $filemenu)
$recentfilesmenu = GUICtrlCreateMenu("Recent Files", $filemenu, 1)

$separator1 = GUICtrlCreateMenuItem("", $filemenu, 2)  ; create a separator line

GUISetState(@SW_SHOW)

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

i was scanning through the help file saw that, i was about to post it then noticed you had wrote that, sorry for wasting your time

My Programs:AInstall - Create a standalone installer for your programUnit Converter - Converts Length, Area, Volume, Weight, Temperature and Pressure to different unitsBinary Clock - Hours, minutes and seconds have 10 columns each to display timeAutoIt Editor - Code Editor with Syntax Highlighting.Laserix Editor & Player - Create, Edit and Play Laserix LevelsLyric Syncer - Create and use Synchronised Lyrics.Connect 4 - 2 Player Connect 4 Game (Local or Online!, Formatted Chat!!)MD5, SHA-1, SHA-256, Tiger and Whirlpool Hash Finder - Dictionary and Brute Force FindCool Text Client - Create Rendered ImageMy UDF's:GUI Enhance - Enhance your GUIs visually.IDEA File Encryption - Encrypt and decrypt files easily! File Rename - Rename files easilyRC4 Text Encryption - Encrypt text using the RC4 AlgorithmPrime Number - Check if a number is primeString Remove - remove lots of strings at onceProgress Bar - made easySound UDF - Play, Pause, Resume, Seek and Stop.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...