Having a little trouble

So I've been trying to check if a Window is available but I have had no success yet. This is all I got done

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include "stdafx.h"
#include <iostream>
#include <Windows.h>
#include <conio.h>


using namespace std;


void main()
{
	BOOL CALLBACK EnumFunc(HWND hwnd, LPARAM lParam);
	{



		wchar_t lpString[32];

		GetWindowText(hwnd, lpString, _countof);

		if (wcscmp(lpString, L"notepad.exe") == 0) {
			cout << "notepad.exe was not found" << endl;

		}
		else {
			cout << "notepad.exe was found" << endl;
		}

}

And even that gives me errors :s Any help?
edit: I'm using Visual Studio Express 2013
Last edited on
That isn't quite right. You'll need to use one of these methods.
EnumWindows: http://msdn.microsoft.com/en-gb/library/windows/desktop/ms633497%28v=vs.85%29.aspx
FindWindow: http://msdn.microsoft.com/en-gb/library/windows/desktop/ms633499%28v=vs.85%29.aspx

If it's not obvious how they work, search of examples.
Topic archived. No new replies allowed.