flat assembler
Message board for the users of flat assembler.

Index > Windows > Dialogbox Class how to?

Author
Thread Post new topic Reply to topic
alonso



Joined: 06 Aug 2003
Posts: 15
alonso 19 Mar 2004, 03:01
HI to every body

I wonder if Privalov or some one can help me.

I'm trying to use a dialogbox as main window for a program but in order to do so I have to give the dialogbox a class, a few months ago I tried to do that and started to play arround with the macro called dialog in the file called Resource.inc in the fasm\include\macro folder I finally found it, this is the code:

macro dialog label,clase,title,x,y,cx,cy,style,menu,exstyle,fontname,fontsize
{ local data,size,items
label dd RVA data,size,0,0
data dd style or DS_SETFONT,exstyle +0
dw items,x,y,cx,cy
if menu+0 <> 0
dw 0FFFFh
end if
du menu+0
du clase,0
du title,0
if fontname eq
du 8,'MS Sans Serif',0
else
du fontsize+0,fontname,0
end if
align 4
dialog_size equ size = $ - data
dialog_items equ items = dialog_items_counter
dialog_items_counter = 0
}

And the way to call it would be like this:

section '.rsrc' resource data readable

directory RT_DIALOG,dialogs

resource dialogs,\
37,LANG_ENGLISH+SUBLANG_DEFAULT,demonstration

dialog demonstration,'My Class','Our First Dialog Box',10,10,205,60,0x0004+DS_CENTER+WS_CAPTION+WS_MINIMIZEBOX+WS_SYSMENU+WS_VISIBLE+WS_OVERLAPPED+DS_MODALFRAME+DS_3DLOOK
dialogitem 'EDIT','',ID_CAPTION,15,17,111,13,WS_VISIBLE+ES_AUTOHSCROLL+ES_LEFT+WS_TABSTOP
dialogitem 'BUTTON','Say Hello',ID_ICONINFORMATION,141,10,52,13,WS_VISIBLE+WS_TABSTOP
dialogitem 'BUTTON','E&xit',ID_CANCEL,141,26,52,13,WS_VISIBLE+WS_TABSTOP
enddialog

NOW THE PROBLEM IS THAT I JUST DOWNLOAD THE LATEST VERSION (1.51)OF FASM AND THIS CODE DOES NOT WORK ANY MORE, CAN YOU PLEASE TELL ME HOW TO MAKE IT WORK.

Sincerely,
Alonso Murillo.
[/b]
Post 19 Mar 2004, 03:01
View user's profile Send private message Reply with quote
Kevin_Zheng



Joined: 04 Jul 2003
Posts: 125
Location: China
Kevin_Zheng 19 Mar 2004, 04:13
Hi,alonso:
Fortuntately, I have finished the work for implementing class attribute on dialog resource. Please see the belowin url:
http://board.flatassembler.net/topic.php?p=8020#8020
Please look at the file modeless.asm of the fasm_hll_kit.zip, It have finished the request. Very Happy
Code:
macro dialog label,class,title,x,y,cx,cy,style,menu,exstyle,fontname,fontsize
 { local data,size,items
   label dd RVA data,size,0,0
   data dd style or DS_SETFONT,exstyle +0
   dw items,x,y,cx,cy
   if menu+0 <> 0
   dw 0FFFFh
   end if
   if        ~class eq
           du menu+0,class,0,title,0
   else
        du menu+0,0,title,0
   end if        
   if fontname eq
   du 8,'MS Sans Serif',0
   else
   du fontsize+0,fontname,0
   end if
   align 4
   dialog_size equ size = $ - data
   dialog_items equ items = dialog_items_counter
   dialog_items_counter = 0
 }
    
Post 19 Mar 2004, 04:13
View user's profile Send private message MSN Messenger Reply with quote
alonso



Joined: 06 Aug 2003
Posts: 15
alonso 19 Mar 2004, 22:16
THANKS ALOT KEVIN YOUR CODE IS SMARTER THAN MINE!
Post 19 Mar 2004, 22:16
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.