开发者

Why do we need to pass LPCTSTR lpParameters with ShellExecute

Shell Execute has the following signature :

HINSTANCE ShellExecute(
  __in_opt  HWND hwnd,
  __in_opt  LPCTSTR lpOperation,
  __in      LPCTSTR lpFile,
  __in_opt  LPCTSTR lpParameters,
  __in_opt  LPCTSTR lpDirectory,
  __in      INT nShowCmd
);

How can we use lpParameters , Can we handle the parameter in my application. I am executing my app as below:

HINST开发者_如何学GoANCE hShellExecuteStatus = ShellExecute(NULL, "open", "MyPath/MyApp.EXE", NULL, NULL, SW_SHOWNORMAL);

Can I pass something in the 4th parameter i.e: lpParameters , so that I can handle this with MyApp.Exe , let's say if I am passing "Hi: in the 4th param:

HINSTANCE hShellExecuteStatus = ShellExecute(NULL, "open", "MyPath/MyApp.EXE", "Hi", NULL, SW_SHOWNORMAL);

Can I check in my application whether it is hi and display a message high.

I tried with POSTMESSAGE , but is not helpful with shellexecute


lpParameters will come through in the command line. Use GetCommandLine() to see it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜