title: c++ win32 textarea with line numbers?
body: <p>I'm writing a notepad program using MS Visual C++ 2010 Express with Win32. I have the basic design for it, however I would like to be able to show line numbers next to the textarea, like you see in most text editors (i.e notepad++, sublime, etc.). The code i have for the textarea is:</p>
  
  <pre><code>hEdit = CreateWindowEx( WS_EX_CLIENTEDGE, "EDIT", "", WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_HSCROLL | ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL, 0, 0, 100, 100, hwnd, ( HMENU )IDC_MAIN_EDIT, GetModuleHandle( NULL ), NULL );
              if( hEdit == NULL )
                  MessageBox( hwnd, "Could not create edit box.", "Error", MB_OK | MB_ICONERROR );
  
              hfDefault = CreateFont( 0, 0, 0, 0, FW_NORMAL, FALSE, FALSE, 0, ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH, TEXT( "Consolas" ) );
              SendMessage( hEdit, WM_SETFONT, ( WPARAM )hfDefault, MAKELPARAM( FALSE, 0 ) );
  </code></pre>