anhyeuem Posted March 17, 2014 Share Posted March 17, 2014 (edited) [GUICtrlCreateProgress]: Doesn't work-I create a GUICtrlCreateProgress but it doesn't work. It word but very bad. -I want my process: start when Run("Notepad") and finished when ControlSend complete. -Code: #include <GuiConstants.au3> #include <ProgressConstants.au3> $Form1 = GUICreate("test", 619, 250, -1, -1) $Edit1 = GUICtrlCreateEdit("", 8, 8, 601, 153) $Button = GUICtrlCreateButton("Run", 310, 176, 290, 33) $Button1 = GUICtrlCreateButton("About", 20, 176, 70, 33) $progressbar = GUICtrlCreateProgress(100, 176, 200, 33) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button a() Case $Button1 about() EndSwitch WEnd Func a() For $A = 1 To 100 GUICtrlSetData($progressbar, $A) Sleep(50) Next Run("Notepad") WinWaitActive("Untitled - Notepad") ControlSend("Untitled - Notepad", "", "[CLASS:Edit; INSTANCE:1]", "fdsfdsfdsdgfdddddddddddddddddrrrrrrrrrrrrrryyyyyyyyyyyyyhhhhhhhhhhhhhhhhhdụgdfgfdgdfgdfgregdfgdfgffffffffffffffaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaattttttttttttttttttttyyyyyyyyyyyyyyyyyy") EndFunc Func about() EndFunc My friends, my teachers... please take the time and read my thread And help me, please. Edited March 17, 2014 by anhyeuem Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 17, 2014 Moderators Share Posted March 17, 2014 anhyeuem,Please stop hijacking other threads by posting this question in them - stick to this one. M23 anhyeuem 1 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
anhyeuem Posted March 17, 2014 Author Share Posted March 17, 2014 anhyeuem, Please stop hijacking other threads by posting this question in them - stick to this one. M23 Dear Mr Melba23 Melba23 No no no. These threads is connected with my thread: GUICtrlCreateProgress And they are professional and they have knowledge so i will learn from them. Okay, Do you try answer my question above thread. I will hear you. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 17, 2014 Moderators Share Posted March 17, 2014 anhyeuem, No no no.These threads is connected with my thread: GUICtrlCreateProgressYes, yes, yes. Those other threads are only tenously connected - and you have already asked the question in this one. As I said above, please stick to just the one thread at a time. M23 anhyeuem 1 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
anhyeuem Posted March 17, 2014 Author Share Posted March 17, 2014 (edited) I know. ...Mr Melba23 huhuhu cry.... can you help me Please I will die if i don't finish this homework. Process, help... I love you. Edited March 17, 2014 by anhyeuem Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 17, 2014 Moderators Share Posted March 17, 2014 anhyeuem,As far as I can see you cannot reliably determine the time it will take to send the various letters to Notepad, so you cannot use a timer. I suggest something along these lines: expandcollapse popup#include <GuiConstantsEx.au3> #include <ProgressConstants.au3> Global $sText = "fdsfdsfdsdgfdddddddddddddddddrrrrrrrrrrrrrryyyyyyyyyyyyyhhhhhhhhhhhhhhhhhd?gdfgfdgdfgdfgregdfgdfgffffffffffffffaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaattttttttttttttttttttyyyyyyyyyyyyyyyyyy" Global $iTextLen = StringLen($sText) $Form1 = GUICreate("test", 619, 250, -1, -1) $Edit1 = GUICtrlCreateEdit("", 8, 8, 601, 153) $Button = GUICtrlCreateButton("Run", 310, 176, 290, 33) $Button1 = GUICtrlCreateButton("About", 20, 176, 70, 33) $progressbar = GUICtrlCreateProgress(100, 176, 200, 33) GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $Button a() Case $Button1 about() EndSwitch WEnd Func a() Run("Notepad") ; Move progress 10% while Notepad loads GUICtrlSetData($progressbar, 10) WinWaitActive("Untitled - Notepad") ; Now send 1 letter at a time For $i = 1 To $iTextLen ControlSend("Untitled - Notepad", "", "[CLASS:Edit; INSTANCE:1]", StringMid($sText, $i, 1)) ; And advance progress a little for each letter sent Sleep(50) GUICtrlSetData($progressbar, 10 + 90 * ($i / 90)) Next EndFunc ;==>a Func about() EndFunc ;==>aboutM23 anhyeuem 1 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
anhyeuem Posted March 17, 2014 Author Share Posted March 17, 2014 anhyeuem, As far as I can see you cannot reliably determine the time it will take to send the various letters to Notepad, so you cannot use a timer. I suggest something along these lines: expandcollapse popup#include <GuiConstantsEx.au3> #include <ProgressConstants.au3> Global $sText = "fdsfdsfdsdgfdddddddddddddddddrrrrrrrrrrrrrryyyyyyyyyyyyyhhhhhhhhhhhhhhhhhd?gdfgfdgdfgdfgregdfgdfgffffffffffffffaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaattttttttttttttttttttyyyyyyyyyyyyyyyyyy" Global $iTextLen = StringLen($sText) $Form1 = GUICreate("test", 619, 250, -1, -1) $Edit1 = GUICtrlCreateEdit("", 8, 8, 601, 153) $Button = GUICtrlCreateButton("Run", 310, 176, 290, 33) $Button1 = GUICtrlCreateButton("About", 20, 176, 70, 33) $progressbar = GUICtrlCreateProgress(100, 176, 200, 33) GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $Button a() Case $Button1 about() EndSwitch WEnd Func a() Run("Notepad") ; Move progress 10% while Notepad loads GUICtrlSetData($progressbar, 10) WinWaitActive("Untitled - Notepad") ; Now send 1 letter at a time For $i = 1 To $iTextLen ControlSend("Untitled - Notepad", "", "[CLASS:Edit; INSTANCE:1]", StringMid($sText, $i, 1)) ; And advance progress a little for each letter sent Sleep(50) GUICtrlSetData($progressbar, 10 + 90 * ($i / 90)) Next EndFunc ;==>a Func about() EndFunc ;==>about M23 oh, this is perfect my teacher. it is useful. I live it very much, thanks. now, i will repair with a my new script. because this thread is example script kiss you, Link to comment Share on other sites More sharing options...
anhyeuem Posted March 17, 2014 Author Share Posted March 17, 2014 oh, that icon what's happen? i think it is a kiss Dear Mr Melba23, you're my super hero. i complete my homeword, thank you so much Link to comment Share on other sites More sharing options...
anhyeuem Posted March 17, 2014 Author Share Posted March 17, 2014 anhyeuem, As far as I can see you cannot reliably determine the time it will take to send the various letters to Notepad, so you cannot use a timer. I suggest something along these lines: expandcollapse popup#include <GuiConstantsEx.au3> #include <ProgressConstants.au3> Global $sText = "fdsfdsfdsdgfdddddddddddddddddrrrrrrrrrrrrrryyyyyyyyyyyyyhhhhhhhhhhhhhhhhhd?gdfgfdgdfgdfgregdfgdfgffffffffffffffaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaattttttttttttttttttttyyyyyyyyyyyyyyyyyy" Global $iTextLen = StringLen($sText) $Form1 = GUICreate("test", 619, 250, -1, -1) $Edit1 = GUICtrlCreateEdit("", 8, 8, 601, 153) $Button = GUICtrlCreateButton("Run", 310, 176, 290, 33) $Button1 = GUICtrlCreateButton("About", 20, 176, 70, 33) $progressbar = GUICtrlCreateProgress(100, 176, 200, 33) GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $Button a() Case $Button1 about() EndSwitch WEnd Func a() Run("Notepad") ; Move progress 10% while Notepad loads GUICtrlSetData($progressbar, 10) WinWaitActive("Untitled - Notepad") ; Now send 1 letter at a time For $i = 1 To $iTextLen ControlSend("Untitled - Notepad", "", "[CLASS:Edit; INSTANCE:1]", StringMid($sText, $i, 1)) ; And advance progress a little for each letter sent Sleep(50) GUICtrlSetData($progressbar, 10 + 90 * ($i / 90)) Next EndFunc ;==>a Func about() EndFunc ;==>about M23 Hello Mr.Melba23 I've just gotten good mark: A+ Thank you again. And i have a new idea: 'Progressbar always run' when Run("Notepad") and finished when ControlSend complete.Example link .gif: 'Progressbar always run' '> or: '>or: '>or: https://documentation.devexpress.com/windowsforms/HelpResource.ashx?help=windowsforms&document=img5228.jpg Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 17, 2014 Moderators Share Posted March 17, 2014 anhyeuem,Search the forum for "marquee progress" - there are lots of examples. M23 anhyeuem 1 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
anhyeuem Posted March 17, 2014 Author Share Posted March 17, 2014 anhyeuem, Search the forum for "marquee progress" - there are lots of examples. M23 Oh my god, my teacher, here you are: #include <GuiConstants.au3> #include <ProgressConstants.au3> #include <GuiConstantsEx.au3> #include <ProgressConstants.au3> #Include <SendMessage.au3> $Form1 = GUICreate("test", 619, 250, -1, -1) $Edit1 = GUICtrlCreateEdit("", 8, 8, 601, 153) $Button = GUICtrlCreateButton("Run", 310, 176, 290, 33) $Button1 = GUICtrlCreateButton("About", 20, 176, 70, 33) $progressbar = GUICtrlCreateProgress(100, 176, 200, 33, $PBS_MARQUEE) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button a() Case $Button1 about() EndSwitch WEnd Func a() Run("Notepad") GUICtrlSendMsg(-1, $PBM_SETMARQUEE, True, 50) WinWaitActive("Untitled - Notepad") ControlSend("Untitled - Notepad", "", "[CLASS:Edit; INSTANCE:1]", "fdsfdsfdsdgfdddddddddddddddddrrrrrrrrrrrrrryyyyyyyyyyyyyhhhhhhhhhhhhhhhhhdụgdfgfdgdfgdfgregdfgdfgffffffffffffffaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaattttttttttttttttttttyyyyyyyyyyyyyyyyyy") EndFunc Func about() EndFunc It only always run after ControlSend complete and it can't stop when ControlSend complete Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 17, 2014 Moderators Share Posted March 17, 2014 anhyeuem,You need to give the marquee time to display by sending the letters separately: expandcollapse popup#include <ProgressConstants.au3> #include <GuiConstantsEx.au3> #include <SendMessage.au3> Global $sText = "fdsfdsfdsdgfdddddddddddddddddrrrrrrrrrrrrrryyyyyyyyyyyyyhhhhhhhhhhhhhhhhhd?gdfgfdgdfgdfgregdfgdfgffffffffffffffaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaattttttttttttttttttttyyyyyyyyyyyyyyyyyy" Global $iTextLen = StringLen($sText) $Form1 = GUICreate("test", 619, 250, -1, -1) $Edit1 = GUICtrlCreateEdit("", 8, 8, 601, 153) $Button = GUICtrlCreateButton("Run", 310, 176, 290, 33) $Button1 = GUICtrlCreateButton("About", 20, 176, 70, 33) $progressbar = GUICtrlCreateProgress(100, 176, 200, 33, $PBS_MARQUEE) GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $Button a() Case $Button1 about() EndSwitch WEnd Func a() GUICtrlSendMsg($progressbar, $PBM_SETMARQUEE, True, 50) ; Marquee on Run("Notepad") WinWaitActive("Untitled - Notepad") ; Now send 1 letter at a time For $i = 1 To $iTextLen ControlSend("Untitled - Notepad", "", "[CLASS:Edit; INSTANCE:1]", StringMid($sText, $i, 1)) Sleep(10) Next GUICtrlSendMsg($progressbar, $PBM_SETMARQUEE, False, 50) ; Marquee off EndFunc ;==>a Func about() EndFunc ;==>aboutAnd that is all the homework help you get from me today - try and solve the next problem yourself. M23 anhyeuem 1 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
anhyeuem Posted March 17, 2014 Author Share Posted March 17, 2014 Dear my teacher, Oh, this is very very perfect. it is easy for me. I don't need compare % like example before. This example is easy for me, it is: A++ Thank alot Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now