Jump to content

Recommended Posts

Posted

main.au3

#include <GUIConstantsEx.au3>
#include <GUIConstants.au3>
#include <WindowsConstants.au3>

$Form1 = GUICreate("Demo1", 640, 480)

$ListView1 = GUICtrlCreateProgress(100, 100, 300, 200)

$button = GUICtrlCreateButton("test", 0, 0, 200, 20)
GUISetState(@SW_SHOW)
While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
        Case $button
            Run("demoloadvalues.exe")
    EndSwitch
WEnd

updater.au3

#include <GUIConstantsEx.au3>
#include <GuiListView.au3>
#Include <SendMessage.au3>


$handle = ControlGetHandle("test", "", "[CLASS:Static; INSTANCE:1]")
GUICtrlSetData($handle, 50)

so one is GUI with progressBar and 2nd script is just to update progressbar and whatnot in the first main script

now strangely progressbar doesnt get udated.

been searching and trying different stuff like _sendmessage() and so on but nothing helped.

Posted

fetush,

Look again at the help file for controlgethandle. You are not providing the name of the window with the control.

kylomas

Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Posted (edited)

tryed and still wont update the progress bar.

ill update first post too now

edit : cant edit first post o.o

Edited by fetush
  • Moderators
Posted

fetush,

Try this: ;)

Main script:

#include <GUIConstantsEx.au3>

$hGUI = GUICreate("Demo1", 640, 480)

GUICtrlCreateProgress(100, 100, 300, 200)

$cButton = GUICtrlCreateButton("Test", 0, 0, 200, 20)

GUISetState(@SW_SHOW)

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
        Case $cButton
            Run("updater.exe")
    EndSwitch
WEnd

Updater - compile and name "updater.exe"

#Include <SendMessage.au3>
#include <ProgressConstants.au3>

$hHandle = ControlGetHandle("Demo1", "", "[CLASS:msctls_progress32; INSTANCE:1]")

_SendMessage($hHandle, $PBM_SETPOS, 50, 0)

That works for me. :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 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

 

Posted

thanks melba works just fine , and how about updating labels with that?

im not sure what to put instead of $PBM_SETPOS just looked in msdn library but , not sure.

  • Moderators
Posted

fetush,

No need to send a message directly - ControlSetText will work for that: ;)

; Main GUI

#include <GUIConstantsEx.au3>

$hGUI = GUICreate("Demo1", 640, 480)

GUICtrlCreateProgress(100, 100, 300, 200)

$cButton = GUICtrlCreateButton("Test", 0, 0, 200, 20)

GUICtrlCreateLabel("Starting position", 10, 450, 200, 20)

GUISetState(@SW_SHOW)

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
        Case $cButton
            Run("updater.exe")
    EndSwitch
WEnd

; Updater - compile as updater.exe

#Include <SendMessage.au3>
#include <ProgressConstants.au3>

$hHandle = ControlGetHandle("Demo1", "", "[CLASS:msctls_progress32; INSTANCE:1]")

_SendMessage($hHandle, $PBM_SETPOS, 50, 0)

$hHandle = ControlGetHandle("Demo1", "", "[CLASS:Static; INSTANCE:1]")

ControlSetText("Demo1", "", $hHandle, "Progress set")

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 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

 

Posted

thanks once again but when i tested controlsettext() it doesnt remove the text that is currently on that label instead it like "Paints Over"

maybe im missing out on something?

  • Moderators
Posted

fetush,

Unsurprisingly it works perfectly for me or I would not have posted it. ;)

Are you using the exactly the same scripts as I posted? Can you post an image of the result on your machine? :huh:

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 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

 

Posted

sorry couldnt reply ... lol 5 posts a day

but anyway i fixed the problem just setting in controlsettext() 1 on last call argument to redraw the gui.. which makes main gui flashy no matter how much delay i put on the updater but its ok . thnx for help

the pic with problem btw il put too

post-76380-0-71096800-1353628039_thumb.p

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
×
×
  • Create New...