By not work you mean?
Are you getting any compiler errors?
Printable View
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/
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)
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.
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.
Erm, I am using version 4 of Dev-C++