×Ô¶¯¸ü¸Ä×ÀÃæ±³¾° 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
Ïà¹ØÎĵµ£º
Ϊѻ·¿ØÖÆ£¬Ëü¿ÉÒÔ½«¼¯ºÏ(Collection)ÖеijÉÔ±ÑÐòä¯ÀÀÒ»±é¡£ÔË×÷·½Ê½Îªµ±Ìõ¼þ·ûºÏʱ£¬¾Í»á³ÖÐøÖØ¸´Ö´Ðеı¾ÌåÄÚÈÝ¡£
¡¡¡¡ Ϊѻ·¿ØÖÆ£¬Ëü¿ÉÒÔ½«¼¯ºÏ(Collection)ÖеijÉÔ±ÑÐòä¯ÀÀÒ»±é¡£ÔË×÷·½Ê½Îªµ±Ìõ¼þ·ûºÏʱ£¬¾Í»á³ÖÐøÖØ¸´Ö´Ðеı¾ÌåÄÚÈÝ¡£
¡¡¡¡Óï·¨
¡¡¡¡Óï·¨1£ºµü´úÒ»¼¯ºÏ¶ÔÏóÖ®ËùÓгÉÔ±
¡¡¡¡<c:forEac ......
const ÊÇÔÚ³ÌÐòÖзdz£ÖØÒª¡£ÔÚÕâÀïÎÒ×öһϼòµ¥µÄ½éÉÜ¡£
1.const »ù´¡
constÓÐÁ½ÖÖÐÎʽ:
a) const Type var;
È磺int a =10;const int * var=&a; ÄÇôvar¾ÍÊdz£Á¿Ö¸Õ룬±íÃ÷ÊÇÖ¸Ïò³£Á¿µÄÖ¸Õ룬Ҳ¾ÍÊÇ˵aµÄÖµ²»Äܸı䡣
......
C++winsocket·þÎñ¶Ë£¬Flex as3¿Í»§¶Ë¡£·þÎñ¶ËBind°ó¶¨IP127.0.0.1¶Ë¿Ú2020£¬ÔÚFlexÖÐʹÓÃSocket.connectÏò·þÎñÆ÷·¢ÆðÁ´½Ó¡£µ±FlexÔÚ±¾µØÔËÐеÄʱºòÄÜÁ´½Ó³É¹¦, µ«ÊÇͨ¹ýÓòÃû·ÃÎÊʱ³öÏÖSecurity´íÎó, Error #2048
¡£²¢ÇÒÔÚÁ¬½Óʱ, ·þÎñ¶ËÊÕµ½¿Í»§¶Ë·¢À´µÄÏûÏ¢<policy-file-request/>
ÏûÏ¢¡£
³¢ÊÔ½â¾ö:
ÉÏgoogleËÑË ......
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 Õâ¸ö ......
Chapter 1: Thread
¢Ù thread functions
1. pthread_self();
2. thread existing
you can get the value of rval_ptr just by pthread_join(pthread_t tht, void ** rval_ptr)
cancel a thread as the thread exits with PTHREAD_CANCELED in pthread_exit, this functio ......