VC编程 实现, 打开一个网页,并全屏
1个回答
展开全部
#include <windows.h>
int WINAPI WinMain(HINSTANCE hinstExe, HINSTANCE,
PSTR pszCmdLine, int nCmdShow)
{
TCHAR szAppName[_MAX_PATH] = TEXT("C:\\Program Files\\Internet Explorer\\iexplore.exe");//IE浏览器程序
TCHAR szCmdLine[_MAX_PATH] = TEXT(" http://www.baidu.com");
STARTUPINFO si={sizeof(si)};
PROCESS_INFORMATION pi;
si.dwFlags=STARTF_USESHOWWINDOW;
si.wShowWindow=1;
BOOL bRet=::CreateProcess(
szAppName,
szCmdLine,
NULL,
NULL,
FALSE,
CREATE_NEW_CONSOLE,
NULL,
NULL,
&si,
&pi);
keybd_event(122, 0, 0, 0);
keybd_event(122, 0, KEYEVENTF_KEYUP, 0);
return 0;
}
这是unicode下的 VC2005下编译通过
int WINAPI WinMain(HINSTANCE hinstExe, HINSTANCE,
PSTR pszCmdLine, int nCmdShow)
{
TCHAR szAppName[_MAX_PATH] = TEXT("C:\\Program Files\\Internet Explorer\\iexplore.exe");//IE浏览器程序
TCHAR szCmdLine[_MAX_PATH] = TEXT(" http://www.baidu.com");
STARTUPINFO si={sizeof(si)};
PROCESS_INFORMATION pi;
si.dwFlags=STARTF_USESHOWWINDOW;
si.wShowWindow=1;
BOOL bRet=::CreateProcess(
szAppName,
szCmdLine,
NULL,
NULL,
FALSE,
CREATE_NEW_CONSOLE,
NULL,
NULL,
&si,
&pi);
keybd_event(122, 0, 0, 0);
keybd_event(122, 0, KEYEVENTF_KEYUP, 0);
return 0;
}
这是unicode下的 VC2005下编译通过
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询