Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>It is <a href="http://www.oehive.org/node/521" rel="nofollow noreferrer">usually 0</a></p> <blockquote> <p>hwnd : parent window that will receive a possible messagebox. This parameter is usually 0.</p> </blockquote> <p>It refers to the top-level window: the window you are opening does not have any parent, and is the main window for the application being executed.</p> <p>When you are switching between applications (ALT-TAB), you are displaying the next top-level window (the next app with a parent handle equals to 0) in the z-order (for instance).</p> <p>Of course, the parent to your app <a href="http://blogs.msdn.com/oldnewthing/archive/2004/02/24/79212.aspx" rel="nofollow noreferrer">can not be the Desktop Window itself</a>:</p> <blockquote> <p>If you create a child window whose parent is GetDesktopWindow(), your window is now glued to the desktop window. If your window then calls something like MessageBox(), well that's a modal dialog, and then the rules above kick in and the desktop gets disabled and the machine is toast.</p> </blockquote> <p>For the path, I would advice double quotes surrounding simple quotes: <code>" ' ... ' "</code></p> <pre><code>"'C:\\Documents and Settings\\Lab1\\My Documents\\Test.xls'" </code></pre> <p>Could work also (untested) with double double quotes : <code>" "" ... "" "</code></p> <pre><code>"""C:\\Documents and Settings\\Lab1\\My Documents\\Test.xls""" </code></pre> <p>, as illustrated by <a href="http://www.tech-archive.net/Archive/Access/microsoft.public.access.formscoding/2007-05/msg01211.html" rel="nofollow noreferrer">this thread</a>.</p> <hr> <p>Actually, as mentioned in <a href="https://stackoverflow.com/questions/310031">your other question</a> by <a href="https://stackoverflow.com/users/3857/andy">Andy</a> and by <a href="https://stackoverflow.com/users/454/mesidin">Mesidin</a>, and in <a href="http://msdn.microsoft.com/en-us/library/bb762153(VS.85).aspx" rel="nofollow noreferrer">ShellExecute Function manual</a>, you can open the file, and pass its path in parameter.</p> <pre><code>ShellExecute( NULL, "open", "Test.xls", "C:\\Documents and Settings\\Lab1\\My Documents\\", NULL, SW_SHOWNORMAL); </code></pre> <p>That means Excel is the default application for opening .xls extension files though.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload