title: What do _T and L mean in C++ and how can I pass them?
body: <p>I am trying to build a keylogger in C++. 
  Part of my keylogger is to capture the screen.<br>
  After a lot of searching, I decided to try to understand how it works instantly by trying to build one. </p>
  
  <p>This is my screen capture code: </p>
  
  <pre><code>    HDC hdc = GetDC(NULL); // get the desktop device context
      HDC hDest = CreateCompatibleDC(hdc); // create a device context to use yourself
  
      // get the height and width of the screen
      int height = GetSystemMetrics(SM_CYVIRTUALSCREEN);
      int width = GetSystemMetrics(SM_CXVIRTUALSCREEN);
  
      // create a bitmap
      HBITMAP hbDesktop = CreateCompatibleBitmap(hdc, width, height);
  
      // use the previously created device context with the bitmap
      SelectObject(hDest, hbDesktop);
  
      // copy from the desktop device context to the bitmap device context
      // call this once per 'frame'
      BitBlt(hDest, 0, 0, width, height, hdc, 0, 0, SRCCOPY);
  
      /*CImage image; // from this code i tried to understand how to save the bitmap
      image.Attach(hbDesktop); 
      image.Save(pathname, Gdiplus::ImageFormatBMP);*/
  
      CImage image;//this code is what I came up with eventually
      image.Attach(hbDesktop);
      CHAR buffer[100] = _T("this is a literal string");  // THIS IS WHERE MY PROBLEM STARTS 
      sprintf(buffer,_T("this is a literal string"), 1);
      image.Save(_T(buffer), Gdiplus::ImageFormatBMP);
  </code></pre>
  
  <p>I tried to make the program save the bitmap file each time with a different name. 
  The problem is that the last line doesn't work unless I use <code>_T</code> sign, and when I do put the <code>_T</code>, it won't take the buffer and says "identifier "Lbuffer" is undefined". What does this mean? Where do I need to put this L sign and why?
  Also, is there a better way to save bitmap to a file without using this <code>_T</code> sign?</p>
  
  <p>I've tried to look this up, and on <a href="https://msdn.microsoft.com/en-us/library/dybsewaf.aspx" rel="nofollow">https://msdn.microsoft.com/en-us/library/dybsewaf.aspx</a> they say this is about Unicode. Why do I need Unicode for this function?</p>