Moving Thy Cursor...

Code help, language discussions, and software development advice.
Post Reply
AmaD
Registered User
Posts: 122
Joined: August 20th, 2004, 7:37 pm

Moving Thy Cursor...

Post by AmaD »

Right 'ho, I've been on MSDN etcetera and I found that the code (albeit very simple :) ) To move the cursor on screen is:

Code: Select all

[i]
[/i]BOOL SetCursorPos(      

    int X,
    int Y
);
And so I made an application with the following code half expecting it to work:

Code: Select all

[i]
[/i]#include <iostream>
using namespace std;

int main()
{
 return 0;
}

BOOL SetCursorPos(      

    int 400,
    int 500
);
As you can see, this script has no structure, no anything, and the author has no clue :( All I want to do is move the cursor to that position (and after the initial move, probably more) Can anyone help me please :) (I'm very new to C++ you see...)
[CPU] AMD Athlon 64 3000+ Venice [MOBO] DFI LanParty UT NF4 Ultra-D (s939) [CARD] ATI Radeon X800 XL (256MB) [CASE] Silverstone Temjin TJ01 - Silver [HDD] ST340016A (40 GB, 7200 RPM, Ultra-ATA/100) [HDD] WDC WD1200BB-00CJA1 (111 GB, IDE)
Smartweb
Registered User
Posts: 622
Joined: January 15th, 2004, 2:11 am
Contact:

Post by Smartweb »

Add a #include <windows> at the top. Then try adding a line like SetCursorPos(x, y) where x and y are replaced with real values above hte return 0 statement.
AmaD
Registered User
Posts: 122
Joined: August 20th, 2004, 7:37 pm

Post by AmaD »

thanks for the help ;) I get one error now which is something like

Code: Select all

Cannot open include file: 'windows': No such file or directory
Error executing cl.exe.
with the #Include that you suggested :( It looks like it could work but it's just something wrong with the include. Thanks for the help again :)
[CPU] AMD Athlon 64 3000+ Venice [MOBO] DFI LanParty UT NF4 Ultra-D (s939) [CARD] ATI Radeon X800 XL (256MB) [CASE] Silverstone Temjin TJ01 - Silver [HDD] ST340016A (40 GB, 7200 RPM, Ultra-ATA/100) [HDD] WDC WD1200BB-00CJA1 (111 GB, IDE)
Smartweb
Registered User
Posts: 622
Joined: January 15th, 2004, 2:11 am
Contact:

Post by Smartweb »

3 quesions: - Are you using #Include or #include - What compiler and what OS - Does it work if you try windows.h
AmaD
Registered User
Posts: 122
Joined: August 20th, 2004, 7:37 pm

Post by AmaD »

Hey man I love you. I tried windows.h and tada! It worked! I'm on Windows XP by the way, using Microsoft Visual Basic 6.0 to compile, but I also have a blodshed compiler but I don't like it :) Thanks ever so much
[CPU] AMD Athlon 64 3000+ Venice [MOBO] DFI LanParty UT NF4 Ultra-D (s939) [CARD] ATI Radeon X800 XL (256MB) [CASE] Silverstone Temjin TJ01 - Silver [HDD] ST340016A (40 GB, 7200 RPM, Ultra-ATA/100) [HDD] WDC WD1200BB-00CJA1 (111 GB, IDE)
Post Reply