#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2001
    Location
    Langley, BC Canada
    Posts
    35
    Rep Power
    13

    Can Attributes be set prior to 'shell' call?


    I'm using VB6.

    I use shell to call console apps and would like to 'dress' them up a bit by changing background color at least, i.e. away from the dreary black.

    I know the user can adjust it once the window is open with the properties but how about before, so that the Shell Window uses the attribute from the start and no 'user' intervention is required.

    I.e. to have ret = shell("cmd", vbNormalFocus) open a window with white background, black text instead of black background white text.

    Thanks in advance

    Heinz
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2003
    Posts
    138
    Rep Power
    12
    You should try cmd /? to find out what options are available.

    On windows 2000 at least

    cmd /T:fg

    is available

    where fg is two hex digits the first the background the second the foreground color.
    Here are the colors

    0 = Black 8 = Gray
    1 = Blue 9 = Light Blue
    2 = Green A = Light Green
    3 = Aqua B = Light Aqua
    4 = Red C = Light Red
    5 = Purple D = Light Purple
    6 = Yellow E = Light Yellow
    7 = White F = Bright White

    so if you want green text on black try "cmd /T:0A"
    --

    ngibsonau

IMN logo majestic logo threadwatch logo seochat tools logo