A library with init task and public symbols

Started by ToutEnMasm, February 27, 2008, 03:19:51 PM

Previous topic - Next topic

ToutEnMasm


This is to init manythings at the start of a project.
The sample,in the following post show you more.
join is a library with some procs and the more common data in it.
Many things need initialisation with masm and it is not very easy to find where to start.
Public symbols are those defined by winhelp.


I am making a collect for this.
can be added GDI+ init ,com interfaces,and so on .............
And if you are made some,put them here i will add it to the library.






[attachment deleted by admin]

ToutEnMasm

As a sample of what can do an init library,i join a sample of a SDI and a child window with some controls in it.
A new method is used to create the windows and the control.
An init proc give a buffer filled with defauts options.Options can be modified or not.A create proc read the modified buffer and create windows or controls.
Quote
      invoke Init_Button,hwnd            ;normal button
      invoke create_Control,addr create

Quote
      invoke Init_Button,hwnd              ;a checkbox
      or create.dwStyle,BS_AUTOCHECKBOX ;BS_CHECKBOX
      mov create.x,150
      mov create.nWidth,150
      invoke create_Control,addr create

create a windows
Quote
   mov sdi.wc.lpfnWndProc,WndSDI                ;required
   mov sdi.wc.lpszClassName,TEXTOFF("one choice")   ;required
   ;-------- optionnal --------------
   mov sdi.create.lpWindowName,TEXTOFF("New title")

Creating a child window
Quote
   ;--------- create a children -------------------------------------
   invoke init_sdi,Hmere      ;return a memory block initialised
   mov ebx,eax
   mov sdi.wc.lpfnWndProc,Wndmodele             ;required
   mov sdi.wc.lpszClassName,TEXTOFF("my first child window")   ;required
   ;-------- optionnal --------------
   mov sdi.create.lpWindowName,TEXTOFF("Child window")
   mov sdi.wc.hbrBackground,FUNC(CreateSolidBrush,00C6FFC6h)    ;FUNC(GetStockObject,WHITE_BRUSH)   
   or sdi.create.dwStyle,WS_CHILD or WS_CLIPCHILDREN or WS_CLIPSIBLINGS
   invoke create_sdi,addr sdi   ;pointer on buffer

common controls will be added to th next sample
This want to be a real help.Not a promise to be easy.






[attachment deleted by admin]