I'm posting owner drawn static control just fro example of DRAWITEM, ParseString4Colors and StripTags procs.
you can add color formating to your control for every char. with little modifications you can use those in every control.
for now it supports:
- color formating
- char-wrapping (not word but single chars)

the formated string should look something like this:
Made by {#FF0000#}NEMO{#0000FF#}1!!!!!!1{#FF00FF#}",13,10,"qwertyuiop[]asdfghjkl;'\
where {#RRGGBB#} are "color tags" and with them you define new color for the rest of string untill another color tags is found.

p.s.
i need this for an addin i'm writing and every thing i've wanted is done, i only made it more general-use


Regards,
NEMO
Posted on 2003-07-02 05:21:14 by NEMO
Where can I find macros.inc?

Or can you use macros.asm that comes to masm package?

Also having problems trying to compile:

D:\staticcolor\StaticOwnerDraw.Inc(3) : error A2008: syntax error : incl
D:\staticcolor\StaticOwnerDraw.Inc(4) : error A2008: syntax error : incl
D:\staticcolor\StaticOwnerDraw.Inc(5) : error A2008: syntax error : incl
D:\staticcolor\StaticOwnerDraw.Inc(6) : error A2008: syntax error : incl
D:\staticcolor\StaticOwnerDraw.Inc(7) : error A2008: syntax error : incl
D:\staticcolor\StaticOwnerDraw.Inc(8) : error A2008: syntax error : incl
D:\staticcolor\StaticOwnerDraw.Inc(9) : error A2008: syntax error : incl
Posted on 2003-07-05 18:17:16 by xkardisx
I dont have this macro, but im pretty sure it would look like:


incl MACRO libname:REQ
include \masm32\include\&libname&.inc
includelib \masm32\lib\&libname&.lib
ENDM


Hope this helps (havent tested it)
:alright:
NaN
Posted on 2003-07-13 23:07:29 by NaN
Posted on 2003-07-14 16:35:30 by QvasiModo
I personally prefer my include macro's (someone inspired me at one point to write them):

;%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&

; INDEX01 - Include Path, and Include Header/Lib
;%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&
INCPATH MACRO apath
MASM_Inc_Path TEXTEQU <&apath>
ENDM

INCHDR MACRO arg1:REQ, arg2:=<>, arg3:=<>, arg4:=<>, arg5:=<>, arg6:=<>, arg7:=<>, arg8:=<>, arg9:=<>, arg0:=<>
@CatStr( <include >,%MASM_Inc_Path,<\include\>,<&arg1>,<.inc> )
ifnb <arg2>
@CatStr( <include >,%MASM_Inc_Path,<\include\>,<&arg2>,<.inc> )
endif
ifnb <arg3>
@CatStr( <include >,%MASM_Inc_Path,<\include\>,<&arg3>,<.inc> )
endif
ifnb <arg4>
@CatStr( <include >,%MASM_Inc_Path,<\include\>,<&arg4>,<.inc> )
endif
ifnb <arg5>
@CatStr( <include >,%MASM_Inc_Path,<\include\>,<&arg5>,<.inc> )
endif
ifnb <arg6>
@CatStr( <include >,%MASM_Inc_Path,<\include\>,<&arg6>,<.inc> )
endif
ifnb <arg7>
@CatStr( <include >,%MASM_Inc_Path,<\include\>,<&arg7>,<.inc> )
endif
ifnb <arg8>
@CatStr( <include >,%MASM_Inc_Path,<\include\>,<&arg8>,<.inc> )
endif
ifnb <arg9>
@CatStr( <include >,%MASM_Inc_Path,<\include\>,<&arg9>,<.inc> )
endif
ifnb <arg0>
@CatStr( <include >,%MASM_Inc_Path,<\include\>,<&arg0>,<.inc> )
endif
ENDM

INCLIB MACRO var:VARARG
IFNB <var>
FOR c, <var>
@CatStr( <includelib >,%MASM_Inc_Path,<\lib\>,<c>,<.lib> )
ENDM
ENDIF
ENDM


They are used like:
.586

.MMX
.model flat,stdcall
option casemap:none

include Macros.inc
INCPATH <\masm32>
INCHDR windows, user32, kernel32, gdi32, comctl32, masm32, debug
INCLIB user32, kernel32, gdi32, comctl32, masm32, debug

... [your code here ] ...


Enjoy..
:NaN:
Posted on 2003-07-14 16:53:21 by NaN
Great macro, NaN! :alright:

There's one thing I don't understand: is there a reason for using a loop in your second macro, but not in the first? So the first macro would not be limited to 10 params only, right?

I haven't tried it, but I think I'll use a macro like this:


incl MACRO var:VARARG
IFNB <var>
IFNB %MASM_Inc_Path
FOR c, <var>
@CatStr( <include >,%MASM_Inc_Path,<\include\>,<c>,<.inc>)
@CatStr( <includelib >,%MASM_Inc_Path,<\lib\>,<c>,<.lib> )
ENDM
ELSE
FOR c, <var>
@CatStr( <include \masm32\include\>,<c>,<.inc>)
@CatStr( <includelib \masm32\lib\>,<c>,<.lib> )
ENDM
ENDIF
ENDIF
ENDM

for backwards compatibility with my old macro...
Posted on 2003-07-15 08:01:36 by QvasiModo
Well, what do you know - it doesn't work. I guess this is what happens when you patch up a complex macro without properly learning macro languaje first ;)

I've changed the IFNB to IFDEF, but that didn't seem to work either...
\masm32\include\masm32.inc(154) : fatal error A1016: Internal Assembler Error

Now THAT's a descriptive error message... :grin:
Posted on 2003-07-15 08:19:00 by QvasiModo
Ya, its just a fluke with MASM... i ran into this problem when designing them, and just gave in battling it. This is why the first is limited to 10 arguments (there is some hang up with MASM and the FOR command when applied to include statements). Masm simply wont do it the other way... (( dont think i didnt try... i spent the better half of a day frustrating over it... it won! )) ;)

:NaN:
Posted on 2003-07-15 11:47:01 by NaN
Just had an inspiration a while ago... :grin: :grin: :grin:


;From MASM32.HLP
@ArgI MACRO index:REQ, arglist:VARARG
LOCAL count, retstr
count = 0
FOR arg, <arglist>
count = count + 1
IF count EQ index
retstr textequ <arg>
ENDIF
ENDM
EXITM <retstr>
ENDM

incl macro var:VARARG
local count,countmax
countmax = 0
for arg, <var>
countmax = countmax + 1
endm
if countmax eq 0
exitm
endif
count = 1
:incl_loop
incfile textequ @ArgI ( count, <var> )
@CatStr ( <include \masm32\include\>, %incfile, <.inc> )
@CatStr ( <includelib \masm32\lib\>, %incfile, <.lib> )
if count eq countmax
exitm
endif
count = count + 1
goto incl_loop
endm

incls macro var:VARARG
local count,countmax
countmax = 0
for arg, <var>
countmax = countmax + 1
endm
if countmax eq 0
exitm
endif
count = 1
:incls_loop
incfile textequ @ArgI ( count, <var> )
@CatStr ( <include \masm32\snippets\>, %incfile, <.inc> )
if count eq countmax
exitm
endif
count = count + 1
goto incls_loop
endm
Posted on 2003-07-17 15:58:17 by QvasiModo
Nice work! And creative thinking :alright:

Only problem i can point out is you still have to include windows.inc separately, since there is no lib for that.
Posted on 2003-07-17 17:25:56 by NaN

Nice work! And creative thinking :alright:

Only problem i can point out is you still have to include windows.inc separately, since there is no lib for that.

Yes, I saw that too, but since I use templates a lot, I thought I'd save more typing this way, since WINDOWS.INC will be included always, so it will be in the template already. Same thing happens with macros.inc (but there's no way around THAT ;) )
However, I was thinking of writing a startup macro, something like AppModel that comes with MASM, but that also included windows.inc, and maybe some other features... any ideas?
Posted on 2003-07-18 09:37:56 by QvasiModo
Heya QvasiModo / NaN

Great work with those marcos I love a lot NObject....

I know Im out of Custom Controls here but can you point me a place or a book title about macros...

Im still tryin to understand NObject :D


Thnx Kahn
Posted on 2003-07-22 17:30:43 by KahnAbyss