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

Function LaunchAutoHotkeyUtil

source/script2.cpp:4473–4497  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4471}
4472
4473void LaunchAutoHotkeyUtil(LPTSTR aFile, bool aIsScript)
4474{
4475 LPTSTR file = aFile, args = _T("");
4476 bool our_file, result = false;
4477 if (!FindAutoHotkeyUtil(aFile, our_file))
4478 return;
4479#ifndef AUTOHOTKEYSC
4480 // If it's a script in our directory, use our EXE to run it.
4481 TCHAR buf[64]; // More than enough for "/script WindowSpy.ahk".
4482 if (aIsScript && our_file)
4483 {
4484 sntprintf(buf, _countof(buf), _T("/script %s"), aFile);
4485 file = g_script.mOurEXE;
4486 args = buf;
4487 }
4488 //else it's not a script or it's the installed copy of WindowSpy.ahk, so just run it.
4489#endif
4490 if (!g_script.ActionExec(file, args, NULL, false))
4491 {
4492 TCHAR buf_file[64];
4493 sntprintf(buf_file, _countof(buf_file), _T("Could not launch %s"), aFile);
4494 MsgBox(buf_file, MB_ICONERROR);
4495 }
4496 SetCurrentDirectory(g_WorkingDir); // Restore the proper working directory.
4497}
4498
4499void LaunchWindowSpy()
4500{

Callers 2

LaunchWindowSpyFunction · 0.85
LaunchAutoHotkeyHelpFunction · 0.85

Calls 4

FindAutoHotkeyUtilFunction · 0.85
sntprintfFunction · 0.85
MsgBoxFunction · 0.85
ActionExecMethod · 0.80

Tested by

no test coverage detected