_TITLE and extended ASCII characters. - Printable Version +- QB64 Phoenix Edition (https://qb64phoenix.com/forum) +-- Forum: QB64 Rising (https://qb64phoenix.com/forum/forumdisplay.php?fid=1) +--- Forum: Code and Stuff (https://qb64phoenix.com/forum/forumdisplay.php?fid=3) +---- Forum: Help Me! (https://qb64phoenix.com/forum/forumdisplay.php?fid=10) +---- Thread: _TITLE and extended ASCII characters. (/showthread.php?tid=1121) |
_TITLE and extended ASCII characters. - Pete - 11-15-2022 I'd like to put CHR$(240), three small horizontal lines, in my title bar, but the _TITLE function cannot convert extended ASCII characters. Is there another method that wold print the 3 horizontal bars into the title bar so it doesn't look like this: ð Pete RE: _TITLE and extended ASCII characters. - SMcNeill - 11-15-2022 CHR$(240) is a mapped unicode character, so it's going to display, by default, whatever code page your OS is configured for. (In this case, you're getting the o with the accent over it.) As far as I can guess, the only way you'd work around this is to use wide characters and call the windows call to set the title yourself. https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setwindowtextw <-- use this for the windows API call to the unicode characters. Code: (Select All) _TITLE CHR$(240) + "Foo" ^ And I'm thinking the above should give you the actual unicode characters that you'd bee looking for. I'm lazy (and running back and forth to the kitchen cooking breakfst), so I haven't tested putting the pieces together yet, but it seems as if they should do what you want. RE: _TITLE and extended ASCII characters. - Pete - 11-15-2022 I also tried using unicode, but no success either. Your code displayed an a with two small vertical '' above it. I'm using CHR$(4) + "Foo" in the _TITLE function to display a transparent box for now. That's right, box, not a diamond. Maybe we are missing something with the _MAPUNICODE function, I don't know. I haven't worked with it in QB64 before and it maybe especially difficult trying to get the _TITLE function to accept it. I'm busy running back and forth the Arby's eating breakfast. Dammit I wish they'd stop forgetting to put the horsey sauce in the take out bag! Pete RE: _TITLE and extended ASCII characters. - SMcNeill - 11-15-2022 I've played with it a little as well. I think I've got it working, more or less, but there's still no printing of the "menu" icon in the title bar. Instead, it does a substitution as shown below: Code: (Select All) DECLARE DYNAMIC LIBRARY "user32" All that effort just to get "=Foo" to display! RE: _TITLE and extended ASCII characters. - Pete - 11-15-2022 Strange. It doesn't print the three horizontal marks in the title bar, only 2. More like an equals sign instead of CHR$(240). Pete RE: _TITLE and extended ASCII characters. - SMcNeill - 11-15-2022 (11-15-2022, 06:39 PM)Pete Wrote: Strange. It doesn't print the three horizontal marks in the title bar, only 2. More like an equals sign instead of CHR$(240). That's why I mentioned, "all that effort just to get "=Foo" as the title." I don't know if it's some windows specific replacement routine going on with the title, or what the heck it is, but the triple line ends up only becoming a double line. IF anyone else has any ideas over what's wrong here, I'd love to hear them, as it seems to me that it should be working as written. I've also noticed the glitch with not building the string character by character. You can't RIGHT$ + LEFT$ to reverse the letters, and make it work either. ANd, let you tested, one string is equal to the other string, but windows works with one and not the other... Now, explain that to me! ??? Maybe you should just go with "|||Foo" and tell people your bars toppled over sideways in the wind. RE: _TITLE and extended ASCII characters. - Pete - 11-15-2022 Right. I edited the other stuff out to avoid confusing others. One rabbit hole at a time. Weird that _MAPUNICODE correctly equals 8801 but only shows up as 2 bars. Maybe its poor tower reception and we need to upgrade to QB64-PE 5G? https://www.codetable.net/decimal/8801 See folks, Steve and I aren't crazy, three bars! Maybe I should try the QB64 "Official" version, but every time I walk over there, I come back with cricket juice on my shoes. Pete RE: _TITLE and extended ASCII characters. - Pete - 11-15-2022 Ah, maybe it has something to do with the configuration. It seems to be that = sign is something Windows throws in. Also "?" marks and a few other symbols with different values, but we are actually not seeing the UNICODE character here. It's a red herring. Code: (Select All) DECLARE DYNAMIC LIBRARY "user32" Watch the title bar change to ?Foo to =Foo at 159. Pete RE: _TITLE and extended ASCII characters. - SpriggsySpriggs - 11-15-2022 Give this a try, @Pete. This is a function set I use to convert to and from Unicode: Code: (Select All) $If UNICODETOANSI = UNDEFINED Then RE: _TITLE and extended ASCII characters. - Pete - 11-15-2022 I'm going to post this, and try Spriggsy's solution and post back. This just shows _MAPUNICODE gets the right number, but converting it to a string fails to create the correct character... Code: (Select All) t$ = MID$(MKI$(_MAPUNICODE(240)), 1, 1) Pete |