转: 使Pocket PC震起来

转: 使Pocket PC震起来
 摘自: http://yulinlu.blog.163.com/blog/static/58815698200812284225975/

#include  < windows.h >
#include 
< nled.h >  

void  LedOn( int  id) 

    NLED_SETTINGS_INFO settings; 
        settings.LedNum
= id;
        settings.OffOnBlink
= 1
    NLedSetDevice(NLED_SETTINGS_INFO_ID, 
&settings); 
}
 
void  LedOff( int  id) 

    NLED_SETTINGS_INFO settings; 
    settings.LedNum
= id; 
    settings.OffOnBlink
= 0
    NLedSetDevice(NLED_SETTINGS_INFO_ID, 
&settings); 
}
 

int  WINAPI WinMain(HINSTANCE hInstance,
                   HINSTANCE hPrevInstance,
                   LPTSTR lpCmdLine,
                   
int  nCmdShow)

    
for (int i = 0; i < 10; i++)
    

        LedOn(
1); 
        Sleep(
400); 
        LedOff(
1); 
        Sleep(
200); 
    }

        
        
return 0
}
 


运行了一下,还蛮有意思的

你可能感兴趣的:(转: 使Pocket PC震起来)