zoukankan      html  css  js  c++  java
  • vc mail 封装类

    Code







    //#include<iostream>
    //#include "windows.h"
    //#include<string>
    //#include<time.h>
    //#include<atltime.h>
    //using namespace std;
    //
    //void main()
    //{
    //
    //    ////CTime 转CString
    //    //CTime currTime;
    //    //CString str;
    // //   currTime=GetCurrentTime();
    //    //str=currTime.Format("%H:%M:%S");
    //    //wcout<<str.GetString()<<endl;
    //    //CTimeSpan spanTime;
    //    //spanTime=20;
    //    //currTime+=spanTime;
    //    //str=currTime.Format("%H:%M:%S");
    //    //wcout<<str.GetString()<<endl;
    //    //getchar();
    //
    //    //CString 转CTime
    //
    //    /*CString   timestr   =   "2000年04月05日";  
    //  int   a,b,c   ;  
    //  sscanf(timestr.GetBuffer(timestr.GetLength()),"%d年%d月%d日",&a,&b,&c);  
    //  CTime   time(0,0,0,a,b,c);     
    //
    //    CString str;
    //    str=time.Format("%H:%M:%S");
    //    wcout<<str.GetString()<<endl;
    //    getchar();*/
    //    /*CString sss("23:13:23");
    //    int a,b,c;
    //    sscanf(sss.GetBuffer(sss.GetLength()),"%d:%d:%d",&a,&b,&c);
    //    CTime timess(0,0,0,a,b,c);
    //    str=timess.Format("%H:%M:%S");
    //    wcout<<str.GetString()<<endl;*/
    //}


    #include   <windows.h>   
    #include   <stdio.h>   
    #include   <conio.h>   

    int   count   =0;   
    //处理函数
    VOID CALLBACK TimerProc(HWND hwnd,UINT uMsg,UINT_PTR idEvent,DWORD dwTime)
    {
        count++;   
        printf("WM_TIMER   in   work   thread   count=%d\n",count);   
    }
    //线程
    DWORD CALLBACK   Thread(PVOID   pvoid)   
    {   
        MSG  msg;   
        PeekMessage(&msg,NULL,WM_USER,WM_USER,PM_NOREMOVE);   
        UINT  timerid=SetTimer(NULL,111,3000,TimerProc);//3秒执行一次,ID为111   
        BOOL  bRet;   

        while(   (bRet = GetMessage(&msg,NULL,0,0))!=   0)   
        {     
            if(bRet==-1)   
            {   
                //   handle   the   error   and   possibly   exit   
            }   
            else   
            {    
                TranslateMessage(&msg);     
                DispatchMessage(&msg);     
            }   
        }   
        KillTimer(NULL,timerid);   
        printf("thread   end   here\n");   
        return   0;   
    }

    int    main()   
    {   
        DWORD   dwThreadId;   
        printf("use   timer   in   workthread   of   console   application\n");   
        HANDLE   hThread  =    CreateThread(NULL,0,Thread,0,0,&dwThreadId);
        _getch();
        return 0;


  • 相关阅读:
    查看MAC系统JRE和JDK版本
    【转】频点CTO张成:基于Cocos2d的MMORPG开发经验
    Android上常见度量单位【xdpi、hdpi、mdpi、ldpi】解读
    常见android手机分辨率(xxhdpi,xhdpi)
    Android市场官方的统计信息
    【转】腾讯分析移动设备屏幕分辨率分析报告-(数据基于2012年12月至2013年1月上半月)
    error “base class has incomplete type”
    Eclipse 各种包说明
    怎么鉴别五帝钱真假
    【jzoj 6276】树(线段树)(扫描线)
  • 原文地址:https://www.cnblogs.com/xianqingzh/p/1570647.html
Copyright © 2011-2022 走看看