16

Does anybody know the meaning of the acronym IDC as it is used when programming windows?

e.g. in the context of a CDialog application:

void CMyDialog::DoDataExchange(CDataExchange* pDX)
{
    CDialog::DoDataExchange(pDX);
    DDX_Control(pDX, IDC_STATIC_FRAME, m_StaticFrame);
}

Is it generally the ID of a not further specified Control (ID Control), as a Dialog would have the prefix IDD (ID Dialog)?

Cody Gray - on strike
  • 239,200
  • 50
  • 490
  • 574
yussuf
  • 635
  • 1
  • 4
  • 18
  • 1
    Tempted to say "I Don't Care"! No but seriously, from [here](http://msdn.microsoft.com/en-us/library/z04ab59a%28v=vs.71%29.aspx) I guess "ID of Control" – Shahbaz Jan 11 '12 at 09:06

2 Answers2

32

Is it generally the ID of a not further specified Control (ID Control), as a Dialog would have the prefix IDD (ID Dialog)?

Yes, that's precisely correct.

By convention, Win32 resource scripts use special prefixes to identify the type of an identifier.
A partial list looks something like this:

  • IDA = An accelerator table resource
  • IDB = A bitmap resource
  • IDC = A command identifier
  • IDD = A dialog box resource
  • IDI = An icon resource
  • IDM = A menu command identifier
  • IDR = Multiple resource types, perhaps those common to an entire application or window
  • IDS = A string resource
  • ID = An unknown or custom resource

Sometimes, you'll see IDC used for cursors, rather than command identifiers. It's hard to say without looking at the usage whether that's the case.

But note that using these is completely optional. It doesn't mean anything to the compiler or the computer, it's only designed to remind the programmer of what the identifier refers to.

SWdV
  • 1,715
  • 1
  • 15
  • 36
Cody Gray - on strike
  • 239,200
  • 50
  • 490
  • 574
  • 2
    I always thought the C stood for Control ... – Goz Jan 11 '12 at 09:59
  • Yes, it could be interpreted as that, too. I'm not sure it matters. Controls are the things that have associated commands and send `WM_COMMAND` messages. It's sort of hard to pick one true meaning. – Cody Gray - on strike Jan 11 '12 at 10:01
3

"Like every Windows control, a button is recognized by its IDentifier. Because a button is a control, by convention, its identifier's name starts with IDC (the C stands for Control)." - http://www.functionx.com/visualc/controls/button.htm

Kristofer
  • 3,201
  • 23
  • 28