News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

ASCII Character in ListView SubItem

Started by ofg, February 26, 2006, 02:43:55 PM

Previous topic - Next topic

ofg

   hi,
    What can I do with the pszText member so that I can write an ASCII character
   (like up-Arrow) in a subitem.
    Any references about related matters or sample code will be appreciated.
    thanks.

donkey

You can select the font for the listview that you like and use WM_SETFONT to assign it to the listview, there is no "UP ARROW" in the ascii character set however.
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

ofg


ofg


  sorry,now I realize that it is a non-printing character
  I think it is reserved for control.

donkey

All values up to and including character 31 are control characters under the ASCII standard. I think IBM Extended Ascii can print the character you want but I know of no fonts that support that character set though it must exist somewhere. I would search for font packages that include the IBM DOS character set, no Windows or ASCII font will support it though.

http://jimprice.com/jim-asc.htm

It is not a big job to just make your own font by modifying an existing one and you can have whatever you want. Borrow what graphics you need from WingDings or Symbol and modify a font and distribute it with your software. Watch for copyright restrictions though, you will need a freeware/public domain font and the font editor that comes with visual studio.
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

Tedd

Or cheat :toothy

Use WM_SETFONT to set the font of the control with the handle as returned by "invoke GetStockObject, OEM_FIXED_FONT"
This gives you the 'dos' character set - including symbols for non-printing characters.
No snowflake in an avalanche feels responsible.

MichaelW

#6
Thanks Tedd,

It works OK on my system, but can it be depended on to work on all systems?

EDIT : corrected a problem where I substituted 20d instead of 32d for the problem control characters.


[attachment deleted by admin]
eschew obfuscation

Tedd

Quote from: MichaelW on February 27, 2006, 02:06:22 PM
It works OK on my system, but can it be depended on to work on all systems?

Works okay on win98 and XP. And it's a stock-object, so it would have to be the same on all.
I'm assuming it's the same as what's used for the dos console (yes I know you can change the font, but it's to do with the character conversion.)
No snowflake in an avalanche feels responsible.

donkey

Quote from: Tedd on February 27, 2006, 06:00:19 PM
Quote from: MichaelW on February 27, 2006, 02:06:22 PM
It works OK on my system, but can it be depended on to work on all systems?

Works okay on win98 and XP. And it's a stock-object, so it would have to be the same on all.
I'm assuming it's the same as what's used for the dos console (yes I know you can change the font, but it's to do with the character conversion.)

Anything that says OEM is dependant on the manufacturer and not guaranteed to be the same across hardware platforms or even from BIOS to BIOS. That said this one should be pretty safe though I would probably look for one I could distribute instead.
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

Tedd

It says OEM because it's supposed to simulate what the bios gives you. But it doesn't come from the bios in this case, it's part of windows, and since we're only using windows I think it's fairly safe :wink
Bad naming really.
No snowflake in an avalanche feels responsible.

donkey

Hi Tedd,

Yup you're right, never really thought about it much but the follwoing article explains it well enough...

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/intl/Unicode_code_pages.asp
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable