"Fossies" - the Fresh Open Source Software Archive

Member "AutoHotkey_L-" (8 May 2021, 4130 Bytes) of package /windows/misc/AutoHotkey_L-

As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "stdafx.h" see the Fossies "Dox" file reference documentation.

    1 /*
    2 AutoHotkey
    4 Copyright 2003-2009 Chris Mallett (support@autohotkey.com)
    6 This program is free software; you can redistribute it and/or
    7 modify it under the terms of the GNU General Public License
    8 as published by the Free Software Foundation; either version 2
    9 of the License, or (at your option) any later version.
   11 This program is distributed in the hope that it will be useful,
   12 but WITHOUT ANY WARRANTY; without even the implied warranty of
   14 GNU General Public License for more details.
   15 */
   17 // stdafx.h : include file for standard system include files,
   18 // or project specific include files that are used frequently, but
   19 // are changed infrequently
   20 //
   22 #pragma once
   24 #define _CRT_SECURE_NO_DEPRECATE // Avoid compiler warnings in VC++ 8.x/2005 that urge the use of lower-performing C library functions that protect against buffer overruns.
   25 #define _CRT_NON_CONFORMING_SWPRINTFS // We don't want ISO version of swprintf, which has similar interface with snwprintf (different from sprintf)
   26 #define WIN32_LEAN_AND_MEAN      // Exclude rarely-used stuff from Windows headers
   27 #define _WINSOCK_DEPRECATED_NO_WARNINGS // Primarily for WSAAsyncSelect, since the recommended replacement is inadequate.
   28 #pragma warning (disable:4351) // Suppress spurious warning about "new behavior" for some compilers.
   30 // Windows Header Files:
   31 // Necessary to do this prior to including windows.h so that NT functions are unlocked:
   32 // UPDATE: Using 0x0500 now so that VK_XBUTTON1 and 2 can be supported:
   33 // UPDATE v1.0.36.03: Using 0x0501 now so that various ListView constants and other things can be used.
   34 // UPDATE v1.0.36.05: 0x0501 broke the Tooltip cmd on on Win9x/NT4/2000 by increasing the size of the TOOLINFO
   35 // struct by 4 bytes.  However, rather than forever go without 0x501 and the many upgrades and constants
   36 // it makes available in the code, it seems best to stick with it and instead patch anything that needs it
   37 // (such as ToolTip).  Hopefully, ToolTip is the only thing in the current code base that needs patching
   38 // (perhaps the only reason it was broken in the first place was a bug or oversight by MS).
   39 // UPDATE v1.1.10.00: Using 0x0600 for Vista/7/8's audio APIs.
   40 // UPDATE v1.1.10.01: Using 0x0600 broke Process Close and who knows what else on Win XP.
   41 // Instead, use 0x0501 and redefine it to 0x0600 only for the specific APIs which we need.
   42 #define _WIN32_WINNT 0x0501
   43 #define _WIN32_IE 0x0501  // Added for v1.0.35 to have MCS_NOTODAY resolve as expected, and possibly solve other problems on newer systems.
   45 #ifdef _MSC_VER
   46     #include "config.h" // compile-time configurations
   47     #include "debug.h"
   49     // C RunTime Header Files
   50     #include <stdio.h>
   51     #include <stdlib.h>
   52     #include <stdarg.h> // used by snprintfcat()
   53     #include <limits.h> // for UINT_MAX, UCHAR_MAX, etc.
   54     #include <malloc.h> // For _alloca()
   55     //#include <memory.h>
   57     #include <windows.h>
   58     #include <tchar.h>
   59     #include <commctrl.h> // for status bar functions. Must be included after <windows.h>.
   60     #include <shellapi.h>  // for ShellExecute()
   61     #include <shlobj.h>  // for SHGetMalloc()
   62     #include <mmsystem.h> // for mciSendString() and waveOutSetVolume()
   63     #include <commdlg.h> // for OPENFILENAME
   65     // ATL alternatives
   66     #include "KuString.h"
   67     #include "StringConv.h"
   69     // It's probably best not to do these, because I think they would then be included
   70     // for everything, even modules that don't need it, which might result in undesired
   71     // dependencies sneaking in, or subtle naming conflicts:
   72     // ...
   73     //#include "defines.h"
   74     //#include "application.h"
   75     //#include "globaldata.h"
   76     //#include "window.h"  // Not to be confused with "windows.h"
   77     //#include "util.h"
   78     //#include "SimpleHeap.h"
   79 #endif
   81 // Lexikos: Defining _WIN32_WINNT 0x0600 seems to break TrayTip in non-English Windows,
   82 //          and possibly other things.  Instead, define any Vista constants we need here.
   83 #if (_WIN32_WINNT < 0x0600)
   84 #define WM_MOUSEHWHEEL      0x020E
   85 #define MOUSEEVENTF_HWHEEL  0x01000 /* hwheel button rolled */
   86 #define LWS_NOPREFIX        0x0004 // SysLink control
   87 #define LWS_RIGHT           0x0020 // SysLink control
   88 #endif