News:

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

editbox won't display

Started by Rainstorm, April 18, 2008, 12:41:06 PM

Previous topic - Next topic

Rainstorm

hi,

am having a prob getting this editbox to display - originally it was displaying proper, then i made some
corrections in the editbox template code.. & ironically it stopped working. I know its something connected with the editbox since if I set the no of dialog items to 1 (which excludes the editbox) then the dialog displays proper with the OK button which is the other control. I could post the whole code if neccessary.-The whole code assembles proper just that nothing displays when i run it. - Its a modeless dialog box with in memory templates

  ; ------------------------------------------------------------
  ;   DialogBoxItem Template - EditBox - (DLGITEMTEMPLATE)
  ; ------------------------------------------------------------

       memalign edi, 4                        ;  align the structure on a dword boundary
       
       mov dword ptr [edi+0],   WS_CHILD or ES_AUTOHSCROLL or WS_VISIBLE
       mov dword ptr [edi+4],    0            ;  extended style
       mov word ptr  [edi+8],    40           ;  x-coordinate
       mov word ptr  [edi+10],    5           ;  y-coordinate
       mov word ptr  [edi+12],   145          ;  width , in dialog box units, of the control
       mov word ptr  [edi+14],   12           ;  height, in dialog box units, of the control
       mov word ptr  [edi+16],  EditID        ;  editbox ID

   ; ----------¤  Class Array  ¤---------------------------

       mov word ptr [edi+18], 65535
       mov word ptr [edi+20], 129              ;  indicates an Editbox Class

   ; ----------¤  Title Array  ¤---------------------------

      add edi, 22
      invoke MultiByteToWideChar, CP_ACP, MB_PRECOMPOSED, addr editbox_title, -1, edi, lengthof editbox_title
      add edi, lengthof editbox_title*2

   ; ----------¤  Creation Data  ¤--------------------------

      mov word ptr [edi], 0
      add edi, 2

Rainstorm

i did a modification of the code in the first post(in the title array section) & the editbox seems to display now.. I don't the reason for sure...but is it that no title array text should be specified ? - can anybody familiar with this stuff , clear this ?

thankyou.

  ; ------------------------------------------------------------
  ;   DialogBoxItem Template - EditBox - (DLGITEMTEMPLATE)
  ; ------------------------------------------------------------

       memalign edi, 4                        ;  align the structure on a dword boundary
       
       mov dword ptr [edi+0],   WS_CHILD or ES_AUTOHSCROLL or WS_VISIBLE
       mov dword ptr [edi+4],    0            ;  extended style
       mov word ptr  [edi+8],    40           ;  x-coordinate
       mov word ptr  [edi+10],    5           ;  y-coordinate
       mov word ptr  [edi+12],   145          ;  width , in dialog box units, of the control
       mov word ptr  [edi+14],   12           ;  height, in dialog box units, of the control
       mov word ptr  [edi+16],  EditID        ;  editbox ID

   ; ----------¤  Class Array  ¤---------------------------

       mov word ptr [edi+18], 65535
       mov word ptr [edi+20], 129              ;  indicates an Editbox Class
       add edi, 22

   ; ----------¤  Title Array  ¤---------------------------

      add edi, 2

   ; ----------¤  Creation Data  ¤--------------------------

      mov word ptr [edi], 0
      add edi, 2