Re: Windows execute but don't wait.

new topic     » goto parent     » topic index » view thread      » older message » newer message
jimcbrown said...

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

MSDN said...

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.

AndyDrummond said...

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.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu