#pragma once #include #include #include #include "TradeQueueCapture.h" #include "Win32Util.h" typedef void (*CallbackFun_Trade_Queue_New)(int index, TradeQueueResult result, void* contex); // ½»Ò×¶ÓÁнØÍ¼Ê¶±ð¹ÜÀíÆ÷ class TradeQueueCaptureManager { private: static bool inited; const static int MAX_COUNT = 10; static HWND hwnds[MAX_COUNT]; static TradeQueueCapture* captures[MAX_COUNT]; static CallbackFun_Trade_Queue_New data_callback; static bool running; static void* context; static void _run(int index); static bool tradeTimeCapture; // ¼ÓÔØ½»Ò×´°¿ÚµÄHWND static void loadTradeWinsHWND(); static bool hwnd_compare(HWND h1, HWND h2) { RECT rect1; RECT rect2; Win32Util::getWindowRect(h1,&rect1); Win32Util::getWindowRect(h2, &rect2); if (rect1.top == rect2.top) { return rect1.left < rect2.left; } // °´ÕÕÉýÐò return rect1.top < rect2.top; } public: //³õʼ»¯ static void init(CallbackFun_Trade_Queue_New trade_queue_callback, void* context); //ÉèÖý»Ò×ʱ¼ä½ØÍ¼ÉÏ´«Êý¾Ý static void setTradeTimeCapture(bool enable) { tradeTimeCapture = enable; } static void refreshHWND(); //È«²¿¿ªÊ¼ static void start(); //È«²¿½áÊø static void stop(); static bool isRunning(); //ÊÇ·ñ³õʼ»¯ static bool isInited(); };