---
name: "FindExecutableW"
section: "3w"
platform: "linux"
package: "libwine-dev"
version: "1.4.1-4"
release: "Debian 7 (Wheezy)"
platforms: ["linux"]
url: "https://new.carta.tech/FindExecutableW"
---

# FindExecutableW(3w)

## NAME

**FindExecutableW** (SHELL32.@)

## SYNOPSIS

HINSTANCE FindExecutableW\
  (\
   LPCWSTR *lpFile*,\
   LPCWSTR *lpDirectory*,\
   LPWSTR  *lpResult*\
  )

## DESCRIPTION

This function returns the executable associated with the specified file for the default verb.

## PARAMS

*lpFile* **\[In\]**  The file to find the association for. This must refer to an existing file otherwise FindExecutable fails and returns **SE\_ERR\_FNF**.

*lpResult* **\[Out\]**  Points to a buffer into which the executable path is copied. This parameter must not be **NULL** otherwise **FindExecutable(3w)** segfaults. The buffer must be of size at least **MAX\_PATH** characters.

## RETURNS

A value greater than **32** on success, less than or equal to **32** otherwise. See the **SE\_ERR\_**\* constants.

## NOTES

On Windows(tm) **XP** and **2003**, **FindExecutable(3w)** seems to first convert the filename into **8.3** format, thus taking into account only the first three characters of the extension, and expects to find an association for those. However other Windows(tm) versions behave sanely.

## IMPLEMENTATION

Declared in **"shellapi.h"**.

Implemented in **"dlls/shell32/shlexec.c"**.

Debug channel **"exec"**.
