【原创】为程序增加启动对话框和自动弹出IE

Eddy 发布于2009-10-29 15:35:46 分类: 技术心得 已浏览loading 网友评论1条 我要评论

本文教你如何为程序增加启动对话框和自动弹出IE转向你希望打开的网址。

两个API:

int MessageBox
(
    HWND hWnd, // handle of owner window
    LPCTSTR lpText, // address of text in message box
    LPCTSTR lpCaption, // address of title of message box 
    UINT uType  // style of message box
);

HINSTANCE ShellExecute
(
    HWND hwnd, // handle to parent window
    LPCTSTR lpOperation, // pointer to string that specifies operation to perform
    LPCTSTR lpFile, // pointer to filename or folder name string
    LPCTSTR lpParameters, // pointer to string that specifies executable-file parameters
    LPCTSTR lpDirectory, // pointer to string that specifies default directory
    INT nShowCmd  // whether file is shown when opened
);

补丁代码地址:00405c00

00405C00 >  60              PUSHAD
00405C01    6A 00           PUSH 0
00405C03    68 E05C4000     PUSH 00405CE0                            ; ASCII "^_NAG^_"
00405C08    68 F05C4000     PUSH 00405CF0                            ; ASCII "Hello,Welcome here!"
00405C0D    6A 00           PUSH 0
00405C0F    FF15 AC644000   CALL DWORD PTR DS:[<&USER32.MessageBoxA>>; user32.MessageBoxA
00405C15    6A 01           PUSH 1
00405C17    68 105D4000     PUSH 00405D10                            ; ASCII "C:\Program Files\Internet Explorer"
00405C1C    68 505D4000     PUSH 00405D50                            ; ASCII "http://hi.baidu.com/cumt_sjh"
00405C21    68 405D4000     PUSH 00405D40                            ; ASCII "iexplore.exe"
00405C26    6A 00           PUSH 0
00405C28    6A 00           PUSH 0
00405C2A    FF15 00644000   CALL DWORD PTR DS:[<&SHELL32.ShellExecut>; SHELL32.ShellExecuteA
00405C30    61              POPAD
00405C31  - E9 96B4FFFF     JMP 004010CC

最后修改程序入口为:00405c00

OK!收工!

已经有(1)位网友发表了评论,你也评一评吧!
原创文章如转载,请注明:转载自Eddy Blog
原文地址:http://www.rrgod.com/technique/29.html     欢迎订阅Eddy Blog

关于 启动对话框  自动弹出IE  的相关文章

  1. 发表于2011-3-31 14:15:22

    这个怎么使用,里面代码是否有错误呢?我怎么出错

    Eddy 于 2011-3-31 20:17:27 回复
    我都测试过,应该没错误……

记住我的信息,下次不用再输入 欢迎给Eddy Blog留言