Thread: working with resource files

  1. #1
    i want wookie cookies the Wookie's Avatar
    Join Date
    Oct 2002
    Posts
    455

    working with resource files

    its a pain int eh butt to have to manually lay out all the components, so im playing with the resource file. i can get the dialog box to show up and have the callback funtion and everything.

    except, if i have a button on the form, and its been clicked, or i want to add text to a edit box, how do i get its window handle? all i know is its id thingy, like IDC_BUTTON or whatever...ive been looking around and thought this would be the quickest way...if i find out before someone posts ill juust delete this

    thanks

  2. #2
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    HWND hCntrl=GetDlgItem(hDlg,IDC_CNTRL_ID);

    where hDlg is the dialog box handle and IDC_CNTRL_ID is the short int id for your control.

  3. #3
    i want wookie cookies the Wookie's Avatar
    Join Date
    Oct 2002
    Posts
    455
    oh gotcha, thanks
    the id is always a short int?

  4. #4
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    >>the id is always a short int?<<

    If it's a number, yes. You can also use strings as id's but I wouldn't recommend it.
    CProgramming FAQ
    Caution: this person may be a carrier of the misinformation virus.

  5. #5
    i want wookie cookies the Wookie's Avatar
    Join Date
    Oct 2002
    Posts
    455
    okidokey, gotcha, thanks

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. working with FIFO files
    By icebabe in forum C Programming
    Replies: 6
    Last Post: 05-06-2006, 11:35 AM
  2. Linking header files, Source files and main program(Accel. C++)
    By Daniel Primed in forum C++ Programming
    Replies: 3
    Last Post: 01-17-2006, 11:46 AM
  3. graphics....linking resource files...
    By ssjnamek in forum C++ Programming
    Replies: 4
    Last Post: 08-18-2005, 11:32 PM
  4. Resource Files....
    By gcn_zelda in forum Windows Programming
    Replies: 2
    Last Post: 12-13-2003, 03:02 PM
  5. Resource Files
    By Unregistered in forum C Programming
    Replies: 4
    Last Post: 09-10-2001, 09:20 AM