News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Creating dialogs with RadASM

Started by Lightman, February 18, 2008, 02:01:42 PM

Previous topic - Next topic

Lightman

Hi Everybody,

I have had problems with this before, but I am stuck again...

Using the RadASM package I can create a dialog, place a button on that dialog and get my program to act when the button is clicked.  What I am stuck with now is the progress bar item.  I drop the progress bar onto my form, give a name like IDC_PROGRESS and then put a reference in the .INC file...

IDC_PROGRESS   equ 10001
hProgress  dd ?

When I run the program the progress bar appears on my form, but I can't seem to be able to use it.  In my code I try to get the progress bar's handle...

invoke  GetDlgItem, hWnd, IDC_PROGRESS
mov  hProgress, eax

and then try to manipulate the progress bar using SendMessage, it won't play... :(

Can anyone see where I am going wrong?

Regards,

Lightman

ragdog

hi

see in Iczelions Win32Asm Tutorials Tutorial 18

greets
ragdog

Lightman

Hi Ragdog,

That's really where I have come from.  This is what I am having problems understanding, in tutorial 18 the progress bar is created with a CreateWindowEx (..) command.  However, when creating buttons and other wigets with RadASM I have placed then on the form with the dialog editor and then started to use them in my code.

Do I need to invoke the CreateWindowEx(...) command and create the progress bar in the dialog editor? Would that not create two progress bars?

Regards,

Lightman

ragdog

 uses this is a radasm source

[attachment deleted by admin]

Lightman

Hi Ragdog,

Many thanks for the code, I can now see the difference between your code (that works) and my code (that doesn't). I tracked the cause of the bug... I was not creating the progress bar correctly.  ::)

I would like to ask though, in my code I put the GetDlgItem code under a WM_CREATE. In your example, however,  it was under a WM_INITDIALOG. As far as I can tell, both would have the same effect. Is there a 'correct' way to handle on-startup events?

Regards,

Lightman