MCPcopy Create free account
hub / github.com/AutoHotkey/AutoHotkey / FileSelectFolderCallback

Function FileSelectFolderCallback

source/script_autoit.cpp:1019–1030  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1017
1018
1019int CALLBACK FileSelectFolderCallback(HWND hwnd, UINT uMsg, LPARAM lParam, LPARAM lpData)
1020{
1021 if (uMsg == BFFM_INITIALIZED) // Caller has ensured that lpData isn't NULL by having set a valid lParam value.
1022 SendMessage(hwnd, BFFM_SETSELECTION, TRUE, lpData);
1023 // In spite of the quote below, the behavior does not seem to vary regardless of what value is returned
1024 // upon receipt of BFFM_VALIDATEFAILED, at least on XP. But in case it matters on other OSes, preserve
1025 // compatibility with versions older than 1.0.36.03 by keeping the dialog displayed even if the user enters
1026 // an invalid folder:
1027 // MSDN: "Returns zero except in the case of BFFM_VALIDATEFAILED. For that flag, returns zero to dismiss
1028 // the dialog or nonzero to keep the dialog displayed."
1029 return uMsg == BFFM_VALIDATEFAILED; // i.e. zero should be returned in almost every case.
1030}
1031
1032
1033

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected