The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: Lightman on June 05, 2007, 01:00:56 PM

Title: A question about MASM32 with RadASM
Post by: Lightman on June 05, 2007, 01:00:56 PM
Hi Everybody,

I am using RadASM with the MASM32 complier to learn assembly programming. My question today is about handles for objects on my dialog box. Something here is confusing me.... The tutorial I am working on is talking about having an edit box on a 'dialog as main' dialog. To create an edit box on my dialog I wrote something like....

.if iMsg==WM_CREATE
  invoke  CreateWindowEX (........)
Title: Re: A question about MASM32 with RadASM
Post by: hutch-- on June 05, 2007, 01:17:42 PM
Hi Lightman,

Welcome on board.

If the dialog you are building in RadAsm is in fact a dialog and not a low level CreateWindowEx() and you have used a resource editor to construct the dialog you get the dialog handle from the DlgProc that processes its messages and you get the edit control handle if you need it from its resource ID then call an API GetDlgItem()


    invoke GetDlgItem,hDlg,125
    mov hEdit, eax


In this example hDlg is supplied by the Dlgproc and the edit control ID number is 125. The return value is the edit control handle.
Title: Re: A question about MASM32 with RadASM
Post by: Lightman on June 05, 2007, 01:36:39 PM
Hi,

Many thanks for that.

I works!! I can now get the handle given the item ID.

Regards,

Lightman