Re: shell to MS explorer

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

Here is one such wrapper. You could make this more generic than it is.

--ShellExecute(
--    HWND hwnd, 
--    LPCTSTR lpOperation,
--    LPCTSTR lpFile, 
--    LPCTSTR lpParameters, 
--    LPCTSTR lpDirectory,
--    INT nShowCmd

xShellExecute = define_c_func(shell32_dll, "ShellExecuteA",
        {C_LONG, C_LONG, C_LONG, C_LONG, C_LONG, C_INT}, C_LONG)

global function ShellExecute(atom hw, sequence op, sequence pgm, sequence arg,
object isdir, integer sw)
    atom ppgm, parg, pdir, inst
    ppgm = allocate_string(pgm)
    parg = allocate_string(arg)
    if not integer isdir then
        pdir = allocate_string(isdir)
    end if
    inst = c_func(xShellExecute, {hw, op, ppgm, parg, pdir, sw})
    free(ppgm)
    free(parg)
    return inst
end function

<example:>

object junk
junk = ShellExecute(handle, "open", file, NULL, NULL, SW_SHOWNORMAL)

Euman
euman at bellsouth.net

Q: Are we monetarily insane?
A: YES

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

Search



Quick Links

User menu

Not signed in.

Misc Menu