Jump to content
Sign in to follow this  
NoOne

[Resolvido] "Conflicting types for 'WinMain'"

Recommended Posts

NoOne

#include <windows.h>

int WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR lpCmd, int nShow)
{

HWND knight = FindWindow("Knight OnLine Client", NULL);
    Sleep(4000);

SetCursorPos( 50, 100 );
    mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
    mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
    Sleep(100);

SetCursorPos( 150, 150 );
    mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
    mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
    Sleep(100);

SetCursorPos( 250, 50 );
    mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
    mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
    Sleep(100);

SetCursorPos( 350, 300 );
    mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
    mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
    Sleep(100);

SetCursorPos( 550, 200 );
    mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
    mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
    Sleep(100);

return 0;
}

que se passa aki ? da o seguinte erro: "Conflicting types for 'WinMain'"

Share this post


Link to post
Share on other sites
Bruno

Não q eu perceba esse código... mas tens q retornas um float... e n vejo nenhum return 😳

Share this post


Link to post
Share on other sites
theproject

a funcao winmain nao pode retornar um float... mete a funcao a retornar um int e no fim mete um return 0;

Share this post


Link to post
Share on other sites
NoOne

ops ya enganei-me, la tinha int e e tava a dar erro... vou tentar por o return 0;

EDIT:

continua a dar o mesmo erro

Share this post


Link to post
Share on other sites
Saco

Suponho que já exista uma funçao chamada WinMain que recebe argumentos diferentes desses, logo dá conflicting types

Share this post


Link to post
Share on other sites
NoOne

ja corrigi o erro:

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.