Thread: Several Q's

  1. #1
    Registered User
    Join Date
    Dec 2004
    Posts
    38

    Several Q's

    I use to work in dev-c++, now i work in borland/visual c++. Both VC++ and Borland C++ decided to take out CreateStatusWindow(). << arg!, can someone tell me how to create a status window in borland/vc++(preferably borland). Also how do I make one of those "seperators" in menus/status bars. How can I append the text of the status bar as well?(some thing like WM_SETTEXT, but for staus bars). Please try to answer, any help is appreciated:-)

  2. #2
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,868
    >>status window

    Also called a status bar.

    MFC
    look at CStatusBarCtrl

    WIN32
    Try...

    InitCommonControls (Ex) with ICC_BAR_CLASSES and use CreateWindow (Ex) with STATUSCLASSNAME

    from commctrl.h and comctl32.lib

    >>Also how do I make one of those "seperators" in menus/status bars. How can I append the text of the status bar as well?

    Use SendMessage() and SB_ msg's ie SB_SETPARTS, SB_SETTEXT
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

  3. #3
    Registered User
    Join Date
    Dec 2004
    Posts
    38
    arg, CreateStatusWindow() works i forgot to include <commctrl.h>, I got SB_SETTEXT down but SB_SETPARTS, something about a integer array for all this crap, its confusing, thanks for you help.

    Another Q: How do i link dll's in vc++?(like for winsock)
    Last edited by Elyubarov; 12-23-2004 at 04:28 PM. Reason: Something added

  4. #4
    Yes, my avatar is stolen anonytmouse's Avatar
    Join Date
    Dec 2002
    Posts
    2,544
    The simplest method is to use a pragma for each library.
    Code:
    #include <windows.h>
    #include <winsock2.h>
    #include <shlwapi.h>
    #pragma comment(lib, "Ws2_32.lib")
    #pragma comment(lib, "shlwapi.lib")

  5. #5
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,868
    >>something about a integer array

    int iParts[4];

    the WPARAM is the number of parts,
    (WPARAM) 4

    the LPARAM is a pointer to the array
    (LPARAM)&iParts

    Use GetClientRect() to find the width of your window. Fill array with each part's width depending on the total width.

    iParts[0]= (int)(iTotalWidth * 0.5 ); //half the screen
    iParts[1]= (int)(iTotalWidth * 0.1); //ect
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

  6. #6
    Registered User
    Join Date
    Dec 2004
    Posts
    38
    arg, i didnt understand that for the SB_SETPARTS, you totally confused me, sorry for the newbishness.

  7. #7
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,268
    Code:
    #include <windows.h>
    #include <winsock2.h>
    ...
    Tsk, tsk... you can't include winsock2.h after windows.h

  8. #8
    Registered User
    Join Date
    Dec 2004
    Posts
    38
    I dont really understand what you meant but i tried and did:
    iParts[0] = 200;
    iParts[1] = 200;
    iParts[2] = 200;
    iParts[3] = 200;
    iParts[4] = 200;

    SendMessage(statusbar, SB_SETPARTS, 1, iParts);
    SendMessage(statusbar, SB_SETPARTS, 2, iParts);
    The output is it creates one part:-\

  9. #9
    Registered User
    Join Date
    Aug 2003
    Posts
    22
    I think novacain means to do something like this:

    Code:
    int iParts[5];
    
    iParts[0] = (int)(iTotalWidth * 0.2);
    iParts[1] = (int)(iTotalWidth * 0.2);
    iParts[2] = (int)(iTotalWidth * 0.2);
    iParts[3] = (int)(iTotalWidth * 0.2);
    iParts[4] = (int)(iTotalWidth * 0.2);
    
    SendMessage(statusbar, SB_SETPARTS, 5, &iParts);
    I'm not completely sure though.

  10. #10
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,868
    yep..
    might need to 'cast' to the correct type.

    SendMessage( statusbar, SB_SETPARTS, (WPARAM)5, (LPARAM)&iParts);
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Q's
    By pktcperlc++java in forum C++ Programming
    Replies: 15
    Last Post: 12-24-2004, 11:36 AM
  2. Qs about RAID0 & expandability
    By Markallen85 in forum Tech Board
    Replies: 2
    Last Post: 01-18-2004, 02:52 PM
  3. 2 q's: SPI_SETFLATMENU & platform SDK
    By Mithoric in forum Windows Programming
    Replies: 2
    Last Post: 12-14-2003, 10:44 AM
  4. I have 2 Q's for you all
    By robid1 in forum C Programming
    Replies: 5
    Last Post: 06-24-2003, 05:52 AM
  5. C and UNIX Q's?
    By Unregistered in forum C Programming
    Replies: 0
    Last Post: 06-13-2002, 05:39 AM