flat assembler
Message board for the users of flat assembler.

Index > Windows > [solved] How do I show (or enable) a hidden progress bar

Author
Thread Post new topic Reply to topic
machinecoder



Joined: 07 Apr 2013
Posts: 27
machinecoder
I want to make a progress bar start off hidden, then when a user clicks on the "proceed button" the progress bar appears:

I tried this but it doesnt work ?

invoke SendDlgItemMessage, [hwnd],IDB_PROGRESS,PBM_SETSTATE,WS_VISIBLE,0

Can anyone please help ?


Last edited by machinecoder on 18 Aug 2013, 13:28; edited 1 time in total
Post 02 Aug 2013, 04:06
View user's profile Send private message Reply with quote
typedef



Joined: 25 Jul 2010
Posts: 2913
Location: 0x77760000
typedef
Use this.

Code:
ShowWindow, hwnd, SW_HIDE
    


http://msdn.microsoft.com/en-us/library/windows/desktop/ms633548(v=vs.85).aspx
Post 02 Aug 2013, 07:16
View user's profile Send private message Reply with quote
machinecoder



Joined: 07 Apr 2013
Posts: 27
machinecoder
You have misunderstood my question, I dont want to "show a window", I want to enable/show a progress bar, on a dialog window.

besides, how would "SW_HIDE" show a dialog element ????

I want to show a dialog item and this will involve the function

SendDlgItemMessage

I just need to know the correct parameters.

Its a shame Microsoft are so piss-poor at documenting there API
Post 02 Aug 2013, 10:57
View user's profile Send private message Reply with quote
typedef



Joined: 25 Jul 2010
Posts: 2913
Location: 0x77760000
typedef
machinecoder wrote:

You have misunderstood my question, I dont want to "show a window", I want to enable/show a progress bar, on a dialog window.
It seems like you are new to Win32.

Here http://www.winprog.org/tutorial/ and then here

http://msdn.microsoft.com/en-us/library/windows/desktop/ff485993(v=vs.85).aspx

machinecoder wrote:
besides, how would "SW_HIDE" show a dialog element ????

Because
machinecoder wrote:

I want to make a progress bar start off hidden
Post 02 Aug 2013, 11:30
View user's profile Send private message Reply with quote
sinsi



Joined: 10 Aug 2007
Posts: 698
Location: Adelaide
sinsi
>Its a shame Microsoft are so piss-poor at documenting there API
Look up PBM_SETSTATE message:
Quote:
wParam
State of the progress bar that is being set. One of the following values.
PBST_NORMAL
In progress.

PBST_ERROR
Error.

PBST_PAUSED
Paused.

Notice WS_VISIBLE is not an option.

Try GetDlgItem then ShowWindow
Post 02 Aug 2013, 12:00
View user's profile Send private message Reply with quote
machinecoder



Joined: 07 Apr 2013
Posts: 27
machinecoder
typedef wrote:

machinecoder wrote:

I want to make a progress bar start off hidden

NO I have already got the progress bar hidden on creation,

dialogitem "msctls_progress32","Progress1",ID_PROGRESS,120,145,174,9,\
WS_DISABLED,0

User hits button then I want to make the progressbar visible.

I have already tried,

invoke SendDlgItemMessage,[hwnd],ID_PROGRESS,PBM_SETSTATE,WS_VISIBLE,0
but its doesnt work, I have set the wrong parameters.

invoke GetDlgItem,[hwnd],ID_PROGRESS
invoke ShowWindow,eax,1


WORKS !!! COOL BANANA'S
Post 02 Aug 2013, 12:00
View user's profile Send private message Reply with quote
AsmGuru62



Joined: 28 Jan 2004
Posts: 1413
Location: Toronto, Canada
AsmGuru62
All dialog elements are HWNDs, so all HWND can do (using API) -- dialog elements can do too.
Post 02 Aug 2013, 22:18
View user's profile Send private message Send e-mail Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17467
Location: In your JS exploiting you and your system
revolution
Yes, there is nothing special about dialog elements. They are just standard windows that can be manipulated using standard window functions. A dialog box is just a convenient container to hold all the various buttons, labels and other windows together in one place.
Post 02 Aug 2013, 22:29
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.