zoukankan      html  css  js  c++  java
  • Snapman开发接口

    #include "stdafx.h"
    #include <Windows.h>
    #include <string>
    #include<time.h>
    using namespace std;
    
    HWND hWindSnapman = NULL;
    int nFiledIndex = 0;
    const int SNAPMAN_APP_PROGRESS = 0;
    const int SNAPMAN_APP_MESSAGE = 1;
    const int SNAPMAN_APP_LOGFILE = 2;
    const int SNAPMAN_APP_RESULTFILE = 3;
    const int SNAPMAN_APP_COMPLETE = 4;
    const int SNAPMAN_APP_CELLDATA = 5;
    const int SNAPMAN_APP_CELLFONTCOLOR = 6;
    const int SNAPMAN_APP_CELLBACKCOLOR = 7;
    
    void SnapmanSendProgress(int nProgress)//发送进度,nProgress范围[0,100]
    {
        wchar_t buffer[1024] = {0};
        wsprintf(buffer,L"%d %d",nFiledIndex,nProgress);
        SendMessage(hWindSnapman, WM_SETTEXT, (WPARAM)SNAPMAN_APP_PROGRESS, (LPARAM)buffer);
    }
    
    void SnapmanSendMessage(const wstring &strMessage)//发送运行时消息
    {
        wchar_t buffer[1024] = {0};
        wsprintf(buffer,L"%d %s",nFiledIndex,strMessage.c_str());
        SendMessage(hWindSnapman, WM_SETTEXT, (WPARAM)SNAPMAN_APP_MESSAGE, (LPARAM)buffer);
    }
    
    void SnapmanSendLogFile(const wstring &strLogFilePath)//发送日志文件
    {
        wchar_t buffer[1024] = {0};
        wsprintf(buffer,L"%d %s",nFiledIndex,strLogFilePath.c_str());
        SendMessage(hWindSnapman, WM_SETTEXT, (WPARAM)SNAPMAN_APP_LOGFILE, (LPARAM)buffer);
    }
    
    void SnapmanSendResultFile(const wstring &strResultFilePath)//发送结果文件
    {
        wchar_t buffer[1024] = {0};
        wsprintf(buffer,L"%d %s",nFiledIndex,strResultFilePath.c_str());
        SendMessage(hWindSnapman, WM_SETTEXT, (WPARAM)SNAPMAN_APP_RESULTFILE, (LPARAM)buffer);
    }
    
    void SnapmanSendAppCompleted(bool bSuccess)//发送程序结束命令
    {
        wchar_t buffer[1024] = {0};
        wsprintf(buffer,L"%d %d",nFiledIndex,bSuccess);
        SendMessage(hWindSnapman, WM_SETTEXT, (WPARAM)SNAPMAN_APP_COMPLETE, (LPARAM)buffer);
    }
    
    void SnapmanSendCellData(int nRow, int nCol,const wstring &strData)//改变某单元格的内容
    {
        wchar_t buffer[1024] = {0};
        wsprintf(buffer,L"%d %d %d %s",nFiledIndex,nRow,nCol,strData.c_str());
        SendMessage(hWindSnapman, WM_SETTEXT, (WPARAM)SNAPMAN_APP_CELLDATA, (LPARAM)buffer);
    }
    
    void SnapmanSendCellFontColor(int nRow, int nCol,int nColor)//改变某单元格的字体颜色
    {
        wchar_t buffer[1024] = {0};
        wsprintf(buffer,L"%d %d %d %d",nFiledIndex,nRow,nCol,nColor);
        SendMessage(hWindSnapman, WM_SETTEXT, (WPARAM)SNAPMAN_APP_CELLFONTCOLOR, (LPARAM)buffer);
    }
    
    void SnapmanSendCellBackColor(int nRow, int nCol,int nColor)//改变某单元格的背景颜色
    {
        wchar_t buffer[1024] = {0};
        wsprintf(buffer,L"%d %d %d %d",nFiledIndex,nRow,nCol,nColor);
        SendMessage(hWindSnapman, WM_SETTEXT, (WPARAM)SNAPMAN_APP_CELLBACKCOLOR, (LPARAM)buffer);
    }
    
    int SnapmanMain(_TCHAR *argv);
    
    int _tmain(int argc, _TCHAR* argv[])
    {
        wprintf(L"%s
    ",argv[0]);
        hWindSnapman = (HWND)_wtoi(argv[1]);
        nFiledIndex  = _wtoi(argv[2]);
        return SnapmanMain(argc>=4?argv[3]:NULL);
    }
    
    int SnapmanMain(_TCHAR *argv)
    {
        return 0;
    }
  • 相关阅读:
    [原]Google的小Bug
    [原]安装Oracle 11g R2 遇到的两个小问题及解决方法
    [原]关于数据库是否使用索引的讨论,我想说的
    [原]在新服务器中找到了上个世纪的产物
    Oracle db_block_checking和db_block_checksum 两个参数区别
    [原]16路的PC服务器
    [原]第一次遭遇Oracle的Bug,纪念一下 |ORA00600 kmgs_pre_process_request_6|
    Oracle 隐含参数的查询
    [原]nginx折腾记(HTTP性能能测试,与Apache对比)
    [原]Oracle Control File 意外情况研究
  • 原文地址:https://www.cnblogs.com/virtualNatural/p/6673527.html
Copyright © 2011-2022 走看看