Author Topic: PowerBASIC is powerful enough to write your own version of DDT.  (Read 474 times)


  • Administrator
  • Member
  • ******
  • Posts: 4813
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Because of having full API support and a decent inline assembler, PowerBASIC is powerful enough to write a pure API version of the dynamically created dialogs. The operating system has had this capacity for many years going back into early Win9x, it just had to be coded in an efficient manner to work properly.

Unless you are highly familiar with the requirements of creating in memory template dialogs, it would be wise to leave the file "dlgmacro.bas" alone as there are critically important alignment issues involved with this form of access to a low level operating system component but in use, the creation of a working dialog with any of the normal control and common controls is no big deal to do.

The original design was done in 32 bit MASM code and later ported to PowerBASIC as it could handle the low level format and the advantage of using an OS defined system like this is its message processing is normal Windows technology and you can use conventional reference material in adding code to it.

One thing that is important is to have the correct number of controls in the "init_dialog" macro call. The line with the comment "control count" is where you set this value.

  ' ------------------------------------
  ' define the initial dialog attributes
  ' ------------------------------------
    init_dialog("Pure API Memory Dialog",_                      ' window title
                "Arial",8,_                                     ' font name and size
                 %WS_OVERLAPPED or %WS_SYSMENU or %DS_CENTER,_  ' window styles
                 2,_                                            ' control count
                 100,100,255,125)                               ' X Y co-ordinates
hutch at movsd dot com    :biggrin:  :biggrin: