Results 1 to 7 of 7

Thread: icons and character arrays

  1. #1

    Thread Starter
    Junior Member
    Join Date
    May 2000
    Posts
    24
    There are two questions I have. First, how would I go about giving my windows app an icon rather than the ugly DOS program icon?

    Second, for some of the registry work I am doing, I need to be able to have some ascii 0's in some of the values? Whenever I try to use a \0 in the middle of a character array, it terminates at that spot. I suppose that should be expected, but is there any way to get the null character in the middle of a registry value?

    Any help will be greatly appreciated. Thanks a lot.

    -CD

  2. #2
    Guest
    try:
    \\0

    that escapes the escape key(\) and puts a zero on the spot..

    and for your first question,

    Which compiler are you using?

  3. #3

    Thread Starter
    Junior Member
    Join Date
    May 2000
    Posts
    24
    Actually, I don't need the string "\0" in the registry value. I need the character '\0' aka the null character. I need it's binary value to be zero. I am using 'RegSetValueEx' to set the key. But it only seems to take in character arrays, so it always terminates when it gets to the null.

    About the icon, I was able to find some obscure information about it and finally got it to work. Thanks.

    -CD

    [Edited by CreepingDeath on 12-16-2000 at 07:38 PM]

  4. #4
    Frenzied Member HarryW's Avatar
    Join Date
    Jan 2000
    Location
    Heiho no michi
    Posts
    1,827
    I'm not sure if there is a way to put ASCII 0's in a zero-terminated string. Perhaps you could substitute your own character in wherever they occure, something obscure like ¥, and just swap them in/out when you load/save the string. This may not be viable depending what kind of data your string is going to contain.
    Harry.

    "From one thing, know ten thousand things."

  5. #5
    Frenzied Member
    Join Date
    Mar 2000
    Posts
    1,089
    Is there a RegSetValueExW ? that would let you put a unicode string into the registry, then you can cram 2 characters into each unicode character these are null terminated by a short 0, so your 0 will hide next to another character and still be in the registry.
    If it wasn't for this sentence I wouldn't have a signature at all.

  6. #6
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Why do you need to put a \0 into your string? I'm sure there must be another way to do it.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  7. #7

    Thread Starter
    Junior Member
    Join Date
    May 2000
    Posts
    24
    Ok, I found out a little more about it. The type of value is REG_MULTI_SZ. It is a series of strings delimited by the null character. This type of value is not supported in Win9x, but it is in NT/2000. Yes, RegSetValueEx exists. When I look at the value in binary, every other byte is a null, but in between strings there are 3 nulls in a row. If there is another way to do it, I would love to know. Is anyone familliar with the NT registry?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width