Re: Print of power point file on desktop hangs on WaitforSingleObject



This looks like a C++ code, and therefore off topic. However, I noticed
something in your code...

> ShExecInfo.hwnd = NULL;

Try setting this to:

ShExecInfo.hwnd = GetDesktopWindow();





"Rajesh" <rajeshb79@xxxxxxxxx> wrote in message
news:1127272040.626953.70480@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> Hi,
>
> I'm trying to print a MS powerpoint file on the desktop and it seems to
> hang on WaitForSingleObject
>
> SHELLEXECUTEINFO ShExecInfo;
> memset(&ShExecInfo,0,sizeof(SHELLEXECUTEINFO));
> ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
> ShExecInfo.fMask = SEE_MASK_NOCLOSEPROCESS | SEE_MASK_FLAG_DDEWAIT;
> ShExecInfo.hwnd = NULL;
> ShExecInfo.lpVerb = /*NOXLATE*/_T("print");
> ShExecInfo.lpFile = fileName;
> ShExecInfo.lpParameters = NULL;
> ShExecInfo.lpDirectory = NULL;
> ShExecInfo.nShow = SW_HIDE;
> ShExecInfo.hInstApp = NULL;
> BOOL bRet = FALSE;
> bRet = ShellExecuteEx(&ShExecInfo);
> WaitForSingleObject( ShExecInfo.hProcess, INFINITE );
>
> Any help is appreciated.
>


.



Relevant Pages

  • Re: threading question: is this code going to work perfectly?
    ... WaitForSingleObject(). ... while (t1count++ < looplimit) ... SignalObjectAndWait(thread2wait, thread1wait, INFINITE, FALSE); ... while (t2count++ < looplimit) ...
    (microsoft.public.dotnet.languages.vc)
  • Re: threading question: is this code going to work perfectly?
    ... it resumes the second thread by calling SetEvent and itself goes into wait condition by calling WaitForSingleObject(). ... while (t1count++ < looplimit) ... SignalObjectAndWait(thread2wait, thread1wait, INFINITE, FALSE); ... while (t2count++ < looplimit) ...
    (microsoft.public.dotnet.languages.vc)
  • Re: Prorgram to launch cemgrc.exe
    ... In my case, I can configure multiple target desktop machines, so I'm using ... > WaitForSingleObject(pi.hProcess, INFINITE); ... >> Paul Tobey did a nice writeup for how to ...
    (microsoft.public.windowsce.platbuilder)
  • Re: If or while looping
    ... While (::WaitForSingleObject(pi.hProcess, INFINITE)) ... > WaitForSingleObject and, when the wait returns, the other process has ... >> I need it in a loop till i kill the parent application. ...
    (microsoft.public.windowsce.embedded.vc)
  • Print of power point file on desktop hangs on WaitforSingleObject
    ... hang on WaitForSingleObject ... SHELLEXECUTEINFO ShExecInfo; ... BOOL bRet = FALSE; ... WaitForSingleObject(ShExecInfo.hProcess, INFINITE); ...
    (microsoft.public.vb.winapi)

Loading