error LNK2019: 无法解析的外部符号 _main,该符号在函数 ___tmainCRTStartup 中被引用
#include "windows.h"
#include "stdio.h"
__declspec(dllexport) int snap()
{
HWND hWnd1;
HWND hWnd2;
HWND hWnd3;
HWND hWnd4;
HWND hWnd5;
HWND hWnd6;
HWND hWnd7;
HWND hWnd8;
hWnd1=::FindWindow(NULL,"Silicon Software GmbH - microDisplay 5.1.0 - [SingleAreaGray16.dll -- Board0/DMA0/]");//Silicon Software GmbH - microDisplay 5.1.0
if(hWnd1==NULL)
{
hWnd1=::FindWindow(NULL,"Silicon Software GmbH - microDisplay 5.1.0");
}
hWnd2=::FindWindowEx(hWnd1,NULL,NULL,"qt_central_widget");
hWnd3=::FindWindowEx(hWnd2,NULL,NULL,"mainSplitter");
hWnd4=::FindWindowEx(hWnd3,NULL,NULL,"layout6");
hWnd5=::FindWindowEx(hWnd4,NULL,NULL,"frame3");
hWnd6=::FindWindowEx(hWnd5,NULL,NULL,"cockpittSplitter");
hWnd7=::FindWindowEx(hWnd6,NULL,NULL,"buttonGroupControll_2");
hWnd8=::FindWindowEx(hWnd7,NULL,NULL,"toolButtonCtrlSnap");
if( hWnd8!=NULL)
{
printf("find it!\n");
::SendMessage(hWnd8,WM_LBUTTONDOWN,0,0);
::SendMessage(hWnd8,WM_LBUTTONUP,0,0);
}
else
{
printf("NOT find it!\n");
}
return 0;
}
__declspec(dllexport) int stop()
{
HWND hWnd1;
HWND hWnd2;
HWND hWnd3;
HWND hWnd4;
HWND hWnd5;
HWND hWnd6;
HWND hWnd7;
HWND hWnd8;
hWnd1=::FindWindow(NULL,"Silicon Software GmbH - microDisplay 5.1.0 - [SingleAreaGray16.dll -- Board0/DMA0/]");//Silicon Software GmbH - microDisplay 5.1.0
if(hWnd1==NULL)
{
hWnd1=::FindWindow(NULL,"Silicon Software GmbH - microDisplay 5.1.0");
}
hWnd2=::FindWindowEx(hWnd1,NULL,NULL,"qt_central_widget");
hWnd3=::FindWindowEx(hWnd2,NULL,NULL,"mainSplitter");
hWnd4=::FindWindowEx(hWnd3,NULL,NULL,"layout6");
hWnd5=::FindWindowEx(hWnd4,NULL,NULL,"frame3");
hWnd6=::FindWindowEx(hWnd5,NULL,NULL,"cockpittSplitter");
hWnd7=::FindWindowEx(hWnd6,NULL,NULL,"buttonGroupControll_2");
hWnd8=::FindWindowEx(hWnd7,NULL,NULL,"toolButtonCtrlStop");
if( hWnd8!=NULL)
{
printf("find it!\n");
::SendMessage(hWnd8,WM_LBUTTONDOWN,0,0);
::SendMessage(hWnd8,WM_LBUTTONUP,0,0);
}
return 0;
}