- UID
- 54798
- 帖子
- 8
- 精华
- 0
- 贡献
- 0
- 推广
- 0
- 有效BUG
- 0
- 注册时间
- 2007-4-10
|
无聊做来玩玩.....
有C++基础的看看我的代码就知道原理了,呵呵~~
#include "stdafx.h"
#include <shellapi.h>
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
char path[256];
DWORD dwSize=255,dwType=REG_SZ;
HKEY m_hKey;
RegOpenKey(HKEY_CURRENT_USER, "SOFTWARE\\Microsoft\\Internet Explorer", &m_hKey);
RegQueryValueEx(m_hKey,"Download Directory",0,&dwType,(BYTE *)path,&dwSize);
RegCloseKey(m_hKey);
ShellExecute(NULL,"open",path,"","",SW_SHOWMAXIMIZED);
return 0;
}
是不是非常简单呢?
|
|