Sign in to follow this  
Followers 0
ctl

Copy MsgBox Text

14 posts in this topic

#1 ·  Posted (edited)

Could someone tell me, at least how could i creat a msgbox with a text wich i can copy it?I mean copy the text from the msgbox ?

LE:

I have manage to creat want i was looking for, but now i dont know how to make the text from the edit box to not erase when i hit cut, could i somehow let the edit box just with the copy option? Please help me...here is the cod:

#include <GuiConstantsEx.au3>

#include <AVIConstants.au3>

#include <TreeViewConstants.au3>

GUICreate("Sample GUI", 400, 400)

GUISetIcon(@SystemDir & "mspaint.exe", 0)

#NoTrayIcon

Opt("MustDeclareVars", 1)

LoginPassword()

Func LoginPassword()

Local $VarWord, $RetWord, $Pass = '1234'

While 1

$RetWord = InputBox("Parola confirmata", "Introdu parola", Default, "*", 200, 100, 370, 300)

Select

Case @error

ExitLoop

Case $RetWord = ''

MsgBox(0, "", "Reintrodu parola.")

Case $RetWord <> $Pass

MsgBox(48, "", "Parola corecta.")

Case Else

GUICtrlCreateEdit(@CRLF & " Google" & @CRLF & "Username: ctl" & @CRLF & "Password: 1234", 50, 50, 300, 300)

ExitLoop

EndSelect

WEnd

; GUI MESSAGE LOOP

GUISetState(@SW_SHOW)

While 1

Switch GUIGetMsg()

Case $GUI_EVENT_CLOSE

Exit

EndSwitch

WEnd

EndFunc

Edited by ctl

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Some help? sory for double posting... :)

Thanks Melba23 for moving my post, hope i will get an answer, sory for the latest post ;)

Edited by ctl

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

ctl,

Please do not bump your posts within 24 hours. ;)

Remember this is not a 24/7 support forum - those who answer are only here because they like helping others and have some time to spare. You just have to wait until someone who knows something about your particular problem, and is willing to help, comes online. Be patient and someone will answer eventually - like this. :D

Just make your edit control read-only:

GUICtrlCreateEdit(@CRLF & " Google" & @CRLF & "Username: ctl" & @CRLF & "Password: 1234", 50, 50, 300, 300, $ES_READONLY)

And you will need to include EditConstants.au3 at the top of your script. :)

And as I mentioned in your other thread, be very cautious about having usernames and passwords in an AutoIt script as they will not be at all secure - even if compiled. :D

M23

Edited by Melba23
Formatting screwed up - I hate this post editor

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Ok, sory for the bump post, i will be more patient ;).

Yes i know that is not secure, but i dont want it to be secure, because i will use it on my computer with my brother, and i think its more safe to keep it in the program that in a notepad, as i`m keeping it know :)

I have make my control read-only but still having the same problem...i still can cut the user and password from the edit control, nothing changed, you could try the code and see the result.

Edited by ctl

Share this post


Link to post
Share on other sites

ctl,

I did try the code - or I would not have posted it. :)

Are you saying that when you apply the $ES_READONLY style to the edit you can still cut data from it? I can certainly copy the data, but not cut it - which is what I understood you wanted to do. ;)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

ctl,

Do not declare $ES_READONLY as a Local variable. By doing that you will use your undefined Local variable in the function in place of the Global constant as set by the EditConstants.au3 file and your edit control does not get the read-only style set. ;)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Yes, you was right, now its working good, but i have another problem, lol, when i put too many accounts i cannot scroll down to see them, what should i do in this case?

PS: Thanks a lot Melba23 for the help, maybe you could help me with this one too.

Share this post


Link to post
Share on other sites

ctl,

Look at the GUIScrollbars UDF in my sig - scrollbars with a single line of code. ;)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

Nice scrolbars colletion you made there, but i have some eror, so i have downloaded your scrollbars i have chosen the GUIScrollbars_Ex_Example_2, after that i copy the GUIScrollbars_Ex to my include files where is installed autoit, after that i have put this code:

; Generate scrollbars - Yes, this is all you need to do!!!!!!!
_GUIScrollbars_Generate($hGUI, 1000, 1000)
While 1
 Switch GUIGetMsg()
  Case $GUI_EVENT_CLOSE
   Exit
  Case $GUI_EVENT_RESTORE
   _GUIScrollbars_Restore($hGUI)
  Case $GUI_EVENT_MINIMIZE
   _GUIScrollbars_Minimize($hGUI)
 EndSwitch
WEnd

into my code, but now i get this eror http://img11.imageshack.us/img11/7349/erorx.jpg

And this is my code with that eror, i try to declare that variable but then, the program doesent run anymore, i double click on it, but nothing happens, any sugestion?

#include <guiconstantsex.au3>
#include <aviconstants.au3>
#include <treeviewconstants.au3>
#include <editconstants.au3>
#include <guiconstantsex.au3>
#include "GUIScrollbars_Ex.au3"

GUICreate("Sample GUI", 400, 400)
GUISetIcon(@SystemDir & "mspaint.exe", 0)
#NoTrayIcon
Opt("MustDeclareVars", 1)
LoginPassword()
Func LoginPassword()
Local $VarWord, $RetWord, $Pass = '1234'
While 1
$RetWord = InputBox("Parola confirmata", "Introdu parola", Default, "*", 200, 100, 370, 300)
Select
Case @error
ExitLoop
Case $RetWord = ''
MsgBox(0, "", "Reintrodu parola.")
Case $RetWord <> $Pass
MsgBox(48, "", "Parola corecta.")
Case Else


GUICtrlCreateEdit(@CRLF & " Google" & @CRLF & "Username: ctl" & @CRLF & "Password: 1234", 50, 50, 300, 300, $ES_Readonly)
_GUIScrollbars_Generate($hGUI, 1000, 1000)
While 1
 Switch GUIGetMsg()
  Case $GUI_EVENT_CLOSE
   Exit
  Case $GUI_EVENT_RESTORE
   _GUIScrollbars_Restore($hGUI)
  Case $GUI_EVENT_MINIMIZE
   _GUIScrollbars_Minimize($hGUI)
 EndSwitch
WEnd
; GUI MESSAGE LOOP
GUISetState(@SW_SHOW)
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
ExitLoop
EndSelect
WEnd
EndFunc
Edited by Melba23
Code tags added

Share this post


Link to post
Share on other sites

ctl,

You need to store the handle of the GUI in a variable like this:

#include <GuiConstantsEx.au3>
#include <AVIConstants.au3>
#include <TreeViewConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include "GUIScrollbars_Ex.au3"

$hGUI = GUICreate("Sample GUI", 400, 400) ; Store the handle here <<<<<<

LoginPassword()

Func LoginPassword()
    Local $VarWord, $RetWord, $Pass = '1234'
    While 1
        $RetWord = InputBox("Parola confirmata", "Introdu parola", Default, "*", 200, 100, 370, 300)
        Select
            Case @error
                ExitLoop
            Case $RetWord = ''
                MsgBox(0, "", "Reintrodu parola.")
            Case $RetWord <> $Pass
                MsgBox(48, "", "Parola corecta.")
            Case Else
            GUICtrlCreateEdit(@CRLF & " Google" & @CRLF & "Username: ctl" & @CRLF & "Password: 1234", 50, 50, 300, 300, $ES_Readonly)
                _GUIScrollbars_Generate($hGUI, 1000, 1000) ; So you can use it here <<<<<<<<<<<<<
                ; GUI MESSAGE LOOP
                GUISetState(@SW_SHOW)
                While 1
                    Switch GUIGetMsg()
                        Case $GUI_EVENT_CLOSE
                            Exit
                        Case $GUI_EVENT_CLOSE
                            Exit
                        Case $GUI_EVENT_RESTORE
                            _GUIScrollbars_Restore($hGUI)
                        Case $GUI_EVENT_MINIMIZE
                            _GUIScrollbars_Minimize($hGUI)
                    EndSwitch
                WEnd
        EndSelect
    WEnd
EndFunc   ;==>LoginPassword

Then the UDF will know which GUI you want to have the scrollbars. ;)

M23

P.S. When you post code please use Code tags - put [autoit] before and [/autoit] after your posted code. :)


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Now i understand, but i want the scrollbar to be into my GUICtrlCreateEdit, would this be posible? because the username and password will be in the GUICtrlCreateEdit, so i need to scroll down in there.

PS: Thanks for the tips, i will use the code tags ;)

Share this post


Link to post
Share on other sites

ctl,

Then add the required styles to your edit control: ;)

#include <GuiConstantsEx.au3>
#include <EditConstants.au3>
#include <WindowsConstants.au3>

$hGUI = GUICreate("Sample GUI", 400, 400)

LoginPassword()

Func LoginPassword()
    Local $VarWord, $RetWord, $Pass = '1234'
    While 1
        $RetWord = InputBox("Parola confirmata", "Introdu parola", Default, "*", 200, 100, 370, 300)
        Select
            Case @error
                ExitLoop
            Case $RetWord = ''
                MsgBox(0, "", "Reintrodu parola.")
            Case $RetWord <> $Pass
                MsgBox(48, "", "Parola corecta.")
            Case Else
                ; Make the text long enough to require scrollbars
                $sText = @CRLF & " Google" & @CRLF & "Username: ctl" & @CRLF & "Password: 1234" & @CRLF & @CRLF & @CRLF & @CRLF & @CRLF & @CRLF & @CRLF & @CRLF & @CRLF & @CRLF & @CRLF & @CRLF & "END"
                ; And add the required styles to the edit control
                GUICtrlCreateEdit($sText, 50, 50, 300, 100, BitOr($ES_READONLY, $WS_VSCROLL, $ES_AUTOVSCROLL))
                GUISetState(@SW_SHOW)
                While 1
                    Switch GUIGetMsg()
                        Case $GUI_EVENT_CLOSE
                            Exit
                        Case $GUI_EVENT_CLOSE
                            Exit
                    EndSwitch
                WEnd
        EndSelect
    WEnd
EndFunc   ;==>LoginPassword

You are asking a lot of very simple questions about AutoIt - have you studied the excellent tutorials that you will find here and here? You might find that they are very useful. :)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Thanks again Melba23, now its just what i was looking for.

No i didnt know about those tutorials, the only tutorials i did make was the 4 tutorials in the autoit help, i was looking for some tutorials, thanks, i will take a look on what you sent me.

Thanks for all your help, and sory for the spam thread, and if you could let this thread open so if i would have some question about this program i`m creating, to post here.

Share this post


Link to post
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
Sign in to follow this  
Followers 0