×Ô¶¯¸ü¸Ä×ÀÃæ±³¾° c/c++ win32
Õâ¸ö³ÌÐò½ö¹©±à³Ì²Î¿¼
ÈôÏëÔÚÆ½Ê±Óã¬ÇëÏÂÔØÎ¢ÈíµÄwallpaper changer
ÎÒÕâ¸ö³ÌÐòʵÏÖÁ˶¨Ê±¸ü»»×ÀÃæ±³¾°µÄ¹¦ÄÜ
ÃüÁîÐÐ wallpaper "your images' directory path" time_in_minute
±à³ÌÒªµã
findfirstfile findnextfile ²éÕÒͼÏñÎļþ
SystemParametersInfo ÐÞ¸ÄϵͳÐÅÏ¢£¬ÔÚÕâ¶ùµ±È»ÊÇ×ÀÃæ±³¾°
×¢²á±í²Ù×÷ ±£´æÐÅÏ¢
Èç¹û×öµÃʵÓã¬Ó¦¼ÓÈ뿪»úÆô¶¯¹¦ÄÜ£¬×ÔÈ»»¹Òªgui
//wallpaper.c
//by onezeros@yahoo.cn||Zhijie Lee
//usage:wallpaper "full directory path" interval
// interval is in minutes
#include <windows.h>
#include <iostream>
#include <string>
using namespace std;
int main(int argc, char* argv[])
{
/* argc=3;
argv[1]="E:\\picture\\testbmp";
argv[2]="1";
*/ LPCSTR currentDir;
LPCSTR currentImage;
int interval;
HKEY hKey;
WIN32_FIND_DATAA FileData;
HANDLE hFind;
//initialize parameters
if(argc==1){
//find parameters in registry
if(RegOpenKeyA(HKEY_LOCAL_MACHINE,(LPCSTR)"Software\\wallpaper",
&hKey)!=ERROR_SUCCESS||
RegQueryValueExA(hKey,(LPCSTR)"interval",0,NULL,
(LPBYTE)interval,NULL)!=ERROR_SUCCESS||
RegQueryValueExA(hKey,(LPCSTR)"directory",0,NULL,
(LPBYTE)currentDir,NULL)!=ERROR_SUCCESS||
RegQueryValueExA(hKey,(LPCSTR)"image",0,NULL,
(LPBYTE)currentImage,NULL)!=ERROR_SUCCESS){
//if connot be found ,wrong usage
cout<<"wrong usage"<<endl
<<"Please use it like this"<<endl
<<"wallpaper \"D:\\Files\\Images\" 30"<<endl
<<"30 is the interval in minutes or"<<endl
<<"wallpaper \"D:\\Files\\Images\""<<endl
<<"with 30 minutes as default interval"<<endl;
exit(1);
}else{
hFind=FindFirstFileA(currentImage,&FileData);
if(hFind==INVALID_HANDLE_VALUE){
cout<<"connot open file";
exit(1);
}
}
}else if(argc==3){
interval=60000*atoi(argv[2]);
currentDir=(LPCSTR)argv[1];
SetCurrentDirectoryA(currentDir);
hFind = FindFirstFileA((LPCSTR)"*.jpg",&am
Ïà¹ØÎĵµ£º
1. ÏÂÔØSQLitewindows°æ
ÎÒÃÇ¿ÉÒÔ´ÓÏÂÁÐÍøÕ¾ÏÂÔØsqliteµÄwindows°æ¡£
http://www.sqlite.com.cn/bbs/topicdisp.asp?tid=182&topage=1#gotolast
ÏÂÔØÕâ¸öÈý¸öÎļþ£º
SQLite 3.3.7 ÏÂÔØ
windows°æ
sqlite-3_3_7.zip Õâ¸öÊÇSQLiteµÄwindows¿ÉÖ´ÐÐÎļþ
sqlitedll-3_3_7.zip Õâ¸ö ......
1.¸ÅÂÛ
¡¡ÔËÐÐʱ¿âÊdzÌÐòÔÚÔËÐÐʱËùÐèÒªµÄ¿âÎļþ£¬Í¨³£ÔËÐÐʱ¿âÊÇÒÔLIB»òDLLÐÎʽÌṩµÄ¡£CÔËÐÐʱ¿âµ®ÉúÓÚ20ÊÀ¼Í70Äê´ú£¬µ±Ê±µÄ³ÌÐòÊÀ½ç»¹ºÜµ¥´¿£¬Ó¦ÓóÌÐò¶¼Êǵ¥Ï̵߳쬶àÈÎÎñ»ò¶àÏ̻߳úÖÆÔÚ´Ëʱ»¹ÊôÓÚйÛÄî¡£ËùÒÔÕâ¸öʱÆÚµÄCÔËÐÐʱ¿â¶¼Êǵ¥Ï̵߳ġ£
Ëæ×ŲÙ×÷ϵͳ¶àÏ̼߳¼ÊõµÄ·¢Õ¹£¬×î³õµÄCÔËÐÐʱ¿âÎÞ·¨Âú×ã³ÌÐòµÄÐèÇó£ ......
ת£ºhttp://school.ogdev.net/ArticleShow.asp?categoryid=10&id=6019
º¯ÊýÖ¸ÕëÊý×éµÄÃîÓÃ
±ÊÕßÔÚ¿ª·¢Ä³Èí¼þ¹ý³ÌÖÐÓöµ½ÕâÑùÒ»¸öÎÊÌ⣬ǰ¼¶Ä£¿é´«¸øÎÒ¶þ½øÖÆÊý¾Ý£¬ÊäÈë²ÎÊýΪ char* bufferºÍ int length£¬bufferÊÇÊý¾ÝµÄÊ×µØÖ·£¬length±íʾÕâÅúÊý¾ÝµÄ³¤¶È¡£Êý¾ÝµÄÌØµãÊÇ£º³¤¶È²»¶¨£¬ÀàÐͲ»¶¨£¬ÓɵÚÒ»¸ö×Ö½Ú£¨buffer[0] ......
Ò». ÔÚcÖзÖΪÕ⼸¸ö´æ´¢Çø
1.Õ» - ÓɱàÒëÆ÷×Ô¶¯·ÖÅäÊÍ·Å
2.¶Ñ - Ò»°ãÓɳÌÐòÔ±·ÖÅäÊÍ·Å£¬Èô³ÌÐòÔ±²»ÊÍ·Å£¬³ÌÐò½áÊøÊ±¿ÉÄÜÓÉOS»ØÊÕ
3.È«¾ÖÇø£¨¾²Ì¬Çø£©£¬È«¾Ö±äÁ¿ºÍ¾²Ì¬±äÁ¿µÄ´æ´¢ÊÇ·ÅÔÚÒ»¿éµÄ£¬³õʼ»¯µÄÈ«¾Ö±äÁ¿ºÍ¾²Ì¬±äÁ¿ÔÚÒ»¿éÇøÓò£¬Î´³õʼ»¯µÄÈ«¾Ö±äÁ¿ºÍδ³õʼ»¯µÄ¾²Ì¬±äÁ¿ÔÚÏàÁÚµÄÁíÒ»¿éÇøÓò¡£- ³ÌÐò½áÊøÊÍ·Å
4.ÁíÍ ......