Re: Windows execute but don't wait.
- Posted by jimcbrown (admin) Jul 19, 2013
- 2355 views
Hmm, I think SEE_MASK_NOASYNC is the flag to use with shellExecuteEx().
http://msdn.microsoft.com/en-us/library/windows/desktop/bb759784(v=vs.85).aspx
The SEE_MASK_NOASYNC flag must be specified if the thread calling ShellExecuteEx does not have a message loop or if the thread or process will terminate soon after ShellExecuteEx returns.
Help! I am struggling with using shellExecuteEx(). The win32lib "shellExecuteEx()" is just an alternative entry to shellExecuteEx(), and doesn't allow me to put in a mask code. I tried - well, all sorts of things, and I'm getting nowhere.
So, Jim, or anyone, do you have an example of how I can invoke shellExecuteEx with a mask code? It should be simple enough - but I'm making heavy weather of it all. Euphoria 3, remember..
Thanks for your help, in advance. I live and learn, just rather slowly it seems to me.
Andy
Looking at http://msdn.microsoft.com/en-us/library/windows/desktop/bb762154(v=vs.85).aspx it seems it's easy to wrap shellExecuteEx() directly.
atom dll_ = open_dll("shell32.dll") constant shellExecuteEx_ = define_c_func(dll_, "ShellExecuteEx", {C_POINTER}, C_INT) public function shellExecuteEx(atom pointer) return c_func(shellExecuteEx_, {pointer}) end function
The hard part is going to be creating the SHELLEXECUTEINFO structure. Based on the previous MSDN page, it looks like it is 15 DWORDS long, or 60 bytes. (This is assuming you are running on 32 bits, the sizes may be different on 64 bit OSes). The mask is the second DWORD, or bytes 4-7 of the structure.