123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153 |
- #include "stdafx.h"
- #include "TestDlg.h"
- #include "TestDlgDlg.h"
- #include "SDKInterface.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #endif
- BEGIN_MESSAGE_MAP(CTestDlgApp, CWinApp)
- ON_COMMAND(ID_HELP, &CWinApp::OnHelp)
- END_MESSAGE_MAP()
- CTestDlgApp::CTestDlgApp()
- {
-
- m_dwRestartManagerSupportFlags = AFX_RESTART_MANAGER_SUPPORT_RESTART;
-
-
- }
- CTestDlgApp theApp;
- BOOL CTestDlgApp::InitInstance()
- {
-
-
-
- INITCOMMONCONTROLSEX InitCtrls;
- InitCtrls.dwSize = sizeof(InitCtrls);
-
-
- InitCtrls.dwICC = ICC_WIN95_CLASSES;
- InitCommonControlsEx(&InitCtrls);
- CWinApp::InitInstance();
- #if 1
- AllocConsole();
- SetConsoleTitle(_T("调试输出"));
- freopen("CONOUT$", "w+t", stdout);
- freopen("CONIN$", "r+t", stdin);
- HWND hWnd = NULL;
- hWnd = ::FindWindow(NULL, _T("调试输出"));
- if (hWnd)
- {
- if (!::SetWindowPos(hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE))
- {
- _tprintf(_T("前置设置失败\n"));
- }
- else
- {
- _tprintf(_T("前置设置成功\n"));
- }
- }
- #endif
- #if 1
-
- SDKInterface tagSDK;
- if (!tagSDK.Init())
- {
- AfxMessageBox(_T("请关闭其他安卓相关的adb进程"));
- return FALSE;
- }
- while (!tagSDK.IsConnect() )
- {
- Sleep(500);
- }
- tagSDK.BrightScreen(true);
- tagSDK.HomeBtnPress();
-
- tagSDK.SwitchForground();
-
- tagSDK.StartDianZan();
- Sleep(20000);
-
- tagSDK.StopDianZan();
-
-
-
- tagSDK.GetChatroomList();
-
- #endif
- AfxEnableControlContainer();
-
-
- CShellManager *pShellManager = new CShellManager;
-
- CMFCVisualManager::SetDefaultManager(RUNTIME_CLASS(CMFCVisualManagerWindows));
-
-
-
-
-
-
-
- SetRegistryKey(_T("应用程序向导生成的本地应用程序"));
- CTestDlgDlg dlg;
- m_pMainWnd = &dlg;
- INT_PTR nResponse = dlg.DoModal();
- if (nResponse == IDOK)
- {
-
-
- }
- else if (nResponse == IDCANCEL)
- {
-
-
- }
- else if (nResponse == -1)
- {
- TRACE(traceAppMsg, 0, "警告: 对话框创建失败,应用程序将意外终止。\n");
- TRACE(traceAppMsg, 0, "警告: 如果您在对话框上使用 MFC 控件,则无法 #define _AFX_NO_MFC_CONTROLS_IN_DIALOGS。\n");
- }
-
- if (pShellManager != NULL)
- {
- delete pShellManager;
- }
-
-
- return FALSE;
- }
|