I wanted to write a simple program that would find all open windows and display their window names; however, in Visual Studio under a "Win32 Project", the console isn't there to output anything by the "cout" function.

But if I were to attempt to put the code under a "Win32 Console" project, I get errors about external dependencies (so I'm assuming I just can't do that?).

So is there any way I can add the console to a "Win32" project?

The code in question (unfinished, of course):

```
// ConsoleApplication2.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <iostream>
#include <windows.h>

using namespace std;

BOOL CALLBACK EnumWindowsProc(HWND hwnd, LPARAM lParam);

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE prev, LPSTR lpCmdLine, int nCmdShow){
    EnumWindows(EnumWindowsProc, NULL);
    return 0;
}

BOOL CALLBACK EnumWindowsProc(HWND hwnd, LPARAM lparam){
    LPTSTR title = 0;

    GetWindowText(hwnd, title, sizeof(title));
    cout << "Window Name: " << endl;

    return TRUE;
}

```

Last but not least, the erros I get when I attempt to run the code in a "Win32 console" project.

```
Error   2   error LNK1120: 1 unresolved externals   c:\users\justin\documents\visual studio 2012\Projects\ConsoleApplication5\Debug\ConsoleApplication5.exe 1   1   ConsoleApplication5
Error   1   error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup   c:\Users\Justin\documents\visual studio 2012\Projects\ConsoleApplication5\ConsoleApplication5\MSVCRTD.lib(crtexe.obj)   ConsoleApplication5

```