By not work you mean?
Are you getting any compiler errors?
By not work you mean?
Are you getting any compiler errors?
Yes which I posted earlier...both on the line:
Code:HWND hwnd = GetConsoleWindow();
I don't know then.
I will try a different compiler.
Good lord. Just install a simple graphics lib, Like Allegro or SDL and draw some lines.
http://www.libsdl.org/index.php
http://www.talula.demon.co.uk/allegro/
Woop?
Well, the code posted is exactly what I need but it doesn't work and I don't know why.
I there any other code that I can use?
You might try using GetForegroundWindow() instead of GetConsoleWindow(). I don't know why the code I posted doesn't work for you (it compiles fine with visual studio, so it must be an issue with your compiler's headers)
"Think not but that I know these things; or think
I know them not: not therefore am I short
Of knowing what I ought."
-John Milton, Paradise Regained (1671)
"Work hard and it might happen."
-XSquared
Any reason why it wouldn't work with Dev-C++
I compile it with foreground window and I think there is a linking error...it compiles but won't run...
Anybody know what I would need to do to get the program working?
I went ahead and tried this with the latest Dev-C++ version and it works fine. You just need to link libgdi32.a and add a pause at the end so that the program doesn't terminate automatically.
"Think not but that I know these things; or think
I know them not: not therefore am I short
Of knowing what I ought."
-John Milton, Paradise Regained (1671)
"Work hard and it might happen."
-XSquared
How do I link the library?
Go to project options->parameters then under "Linker" click the "Add Library or Object" button, go to the lib directory and find the lib file.
"Think not but that I know these things; or think
I know them not: not therefore am I short
Of knowing what I ought."
-John Milton, Paradise Regained (1671)
"Work hard and it might happen."
-XSquared
Erm, I am using version 4 of Dev-C++