XPost: alt.comp.os.windows-10, alt.windows7.general, microsoft.p   
   blic.windows.server.general   
      
   In alt.comp.os.windows-10 T. Ment wrote:   
   > On Sat, 17 Aug 2019 17:00:25 -0000 (UTC), Arlen George Holder wrote:   
   >   
   >> It's _embarrassing_ that none of us know how Windows works   
      
   "If you could see your way, sir, to confining your remarks to your own   
   peculiarities, you would find that you had an ample field for comment."   
      
   > Proprietary closed source is like drugs. Just say no.   
      
   As a BSD aficionado, Jonathan and your sympathies are certainly shared   
   by me. Be that as it may, it's far too late for the likes of us. The   
   Windows pandemic took hold decades ago.   
      
      
   Windows provides several ways to invoke its Run Dialog. Here's how the   
   Task Manager ultimately spawned a new process back in the day:   
      
    /* Try to exec 'szCommandLine'. */   
      
    /*changed order, since wPendINstance is a 32b HANDLE, and ret is WORD*/   
    if (!lpP)   
    lpP = TEXT("");   
      
    wsprintf(lpReserved, lpReservedFormat, 0, 0);   
      
    ret = (WORD)RealShellExecute(ghwndDialog, NULL, lpszPath, lpP,   
    lpDir, NULL, lpTitle, lpReserved,   
    (WORD)SW_SHOWNORMAL, &hProcess);   
      
   RealShellExecute is most likely a wrapper for the API CreateProcess   
   function shown below. (It's too much work for me to investigate this any   
   further for curiosity's sake.)   
    Inet searches indicate that some people seem to get some mileage out   
   of calling CreateProcess from within PowerShell. C's my native language   
   so don't ask me how to do this in PowerShell.   
      
    CreateProcess   
      
    The CreateProcess function creates a new process and its   
    primary thread. The new process runs the specified executable   
    file in the security context of the calling process.   
      
    If the calling process is impersonating another user, the new   
    process uses the token for the calling process, not the   
    impersonation token. To run the new process in the security   
    context of the user represented by the impersonation token,   
    use the CreateProcessAsUser or CreateProcessWithLogonW function.   
      
      
    BOOL CreateProcess(   
    LPCTSTR lpApplicationName,   
    LPTSTR lpCommandLine,   
    LPSECURITY_ATTRIBUTES lpProcessAttributes,   
    LPSECURITY_ATTRIBUTES lpThreadAttributes,   
    BOOL bInheritHandles,   
    DWORD dwCreationFlags,   
    LPVOID lpEnvironment,   
    LPCTSTR lpCurrentDirectory,   
    LPSTARTUPINFO lpStartupInfo,   
    LPPROCESS_INFORMATION lpProcessInformation   
    );   
      
   Thank you, 73,   
      
   --   
   Don Kuenz KB7RPU   
   There was a young lady named Bright Whose speed was far faster than light;   
   She set out one day In a relative way And returned on the previous night.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|