Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Dialog Maker

Started by hutch--, January 05, 2022, 04:47:42 PM

Previous topic - Next topic


Attached is an app that is a dialog code maker. It addresses basic boilerplate code to get dialogs up and running so they can easily be modified into working applications. It produces a simple resource dialog with two buttons, OK and Close and the dialog has WM_CTLCOLORxxx support for most of the controls that can have their colour set by this technique.

The code builds at 10240 bytes complete with a 766 byte icon, a manifest and a version control block. It is pure API code that uses fully documented API functions. The zip file contains the Dialog Maker binary and an example built with it in a separate zip file, Note that the paths to the BIN and INCLUDE directories are set to my machine and you will need to change them to the paths on your own box.

With the Dialog Maker binary, you set the paths to the locations on your own machine and it should work OK.



Here is an example first produced in DlgMaker and then modified with Ketil Olsen's RESED. For a minor twiddle, the window type is changed to  WS_OVERLAPPEDWINDOW which makes the window sizeable. Then a status bar is added from the left side toolbar. As the window is now sizeable, the code,

      Case %WM_SIZE
        MoveWindow hSbar,0,0,0,0,%TRUE

is added so that the status bar is always located at the bottom of the window.

The menu is code added to the RC script file.

  POPUP "&File"
    MENUITEM "&Exit",102
  POPUP "&Help"
    MENUITEM "&About",101

The menu is activated by the following code.

        hMnu = LoadMenu(hInstance,ByVal 50)
        SetMenu hWnd, hMnu

For very simple code, you get a sizeable working window that is 11264 bytes in size as a base to design a window based application.

When Bob Zale added the DDT capacity to PowerBASIC, he pointed it at folks who had come from a MS-DOS background and many people have been able to write working UI applications using DDT but it needs to be recognised that it was a technique aimed as a bridge for folks who came from the MS-DOS era, not as a replacement for system wide windows code, the Application Programming Interface.

For people who have already developed the UI skills using DDT, this is the next step, using the full Windows API to create their own UI and pick up all of the advantages of power and efficiency.