Platform SDK Shell >> ShellExecute( Desktop.scf ) = 33

by Daniel H » Sat, 10 Jan 2004 21:40:22 GMT

Hi,

I want to preform a ShowDesktop, as the Icon in QuickLaunch, as we know that
is done by running a .scf file with "ToggleDesktop" parameter inside it.
so Ive created one that works perfectly when run in Explorer, or "Run..."

But when I do
ShellExecute(hWnd,"open","ShowDesk.scf",NULL,NULL,SW_SHOWNORMAL);
I get 33 as return, and the LastError is:
"The specified module could not be found"

Ive tried everything to using ShellExecute... anyone know why I dont seem to
be abel to start a .scf file?

//
Daniel




Platform SDK Shell >> ShellExecute( Desktop.scf ) = 33

by Henk Devos » Sat, 10 Jan 2004 22:06:18 GMT


Did you try putting in the full path?




that
to





Platform SDK Shell >> ShellExecute( Desktop.scf ) = 33

by Daniel H » Sat, 10 Jan 2004 22:21:14 GMT

ofcourse, it finds the file. for example if I use 'properties' instead of
'open' it tells that there is no handling for that... also FileExists() =
true

// Daniel






"Run..."
seem




ShellExecute( Desktop.scf ) = 33

by Henk Devos » Sat, 10 Jan 2004 22:41:33 GMT

The error you get means that the file is locked by another process.
Try again after restarting your computer, and without doing anything else
before that.








know
it.




ShellExecute( Desktop.scf ) = 33

by Daniel H » Sat, 10 Jan 2004 23:17:36 GMT

Nop, no restart helped...

after some checking in the Registry Ive noticed that "SHCmdFile" that takes
care of this filetype does not have an regular open, but a "ddeexec".
(the Open/Command/ just starts Explorer.exe, not with (%1) the file as
parameter)

how would one open it using DDE ?

//
Daniel





of
=




ShellExecute( Desktop.scf ) = 33

by Jim Barry » Sun, 11 Jan 2004 04:30:11 GMT




A return value of 33 (being greater than 32) indicates success, so the result of GetLastError is irrelevant. ShellExecute automatically uses DDE if required. However, if your app does not have a message loop, or exits immediately after calling ShellExecute, the DDE conversation will not be able to complete. In that case you need to use ShellExecuteEx and specify the SEE_MASK_FLAG_DDEWAIT flag.

--
Jim Barry, MVP for Windows SDK
"Honor Bound to Defend Freedom" - slogan displayed at the gates of Camp
Delta, Guantanamo Bay, Cuba, where over 600 prisoners are held indefinitely
by the U.S. military, without trial, in defiance of international law.