Skip to content

Commit 07dfd28

Browse files
committed
dllcall fixed
1 parent 9f2c1ad commit 07dfd28

File tree

4 files changed

+631
-872
lines changed

4 files changed

+631
-872
lines changed

AutoHotkeyx.cpp

+6-20
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ int WINAPI OldWinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmd
5656
{
5757
// Init any globals not in "struct g" that need it:
5858
g_hInstance = hInstance;
59+
// MsgBox((UINT)g_hInstance);
5960
InitializeCriticalSection(&g_CriticalRegExCache); // v1.0.45.04: Must be done early so that it's unconditional, so that DeleteCriticalSection() in the script destructor can also be unconditional (deleting when never initialized can crash, at least on Win 9x).
6061

6162
if (!GetCurrentDirectory(sizeof(g_WorkingDir), g_WorkingDir)) // Needed for the FileSelectFile() workaround.
@@ -67,27 +68,10 @@ int WINAPI OldWinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmd
6768
// Set defaults, to be overridden by command line args we receive:
6869
bool restart_mode = false;
6970

70-
#ifndef AUTOHOTKEYSC
71-
#ifdef _DEBUG
72-
//char *script_filespec = "C:\\Util\\AutoHotkey.ahk";
73-
//char *script_filespec = "C:\\A-Source\\AutoHotkey\\Test\\GUI Demo.ahk";
74-
char *script_filespec = "C:\\A-Source\\AutoHotkey\\Test\\TEST SUITES\\MAIN.ahk";
75-
//char *script_filespec = "C:\\A-Source\\AutoHotkey\\Test\\TEST SUITES\\Expressions.ahk";
76-
//char *script_filespec = "C:\\A-Source\\AutoHotkey\\Test\\TEST SUITES\\Line Continuation.ahk";
77-
//char *script_filespec = "C:\\A-Source\\AutoHotkey\\Test\\TEST SUITES\\DllCall.ahk";
78-
//char *script_filespec = "C:\\A-Source\\AutoHotkey\\Test\\TEST SUITES\\RegExMatch & RegExReplace.ahk";
79-
//char *script_filespec = "C:\\A-Source\\AutoHotkey\\Test\\TEST SUITES\\Win commands, all cases.ahk";
80-
//char *script_filespec = "C:\\A-Source\\AutoHotkey\\Test\\TEST SUITES\\GUI Date.ahk";
81-
//char *script_filespec = "C:\\A-Source\\AutoHotkey\\Test\\TEST SUITES\\GUI ListView.ahk";
82-
//char *script_filespec = "C:\\A-Source\\AutoHotkey\\Test\\TEST SUITES\\OnMessage.ahk";
83-
//char *script_filespec = "C:\\A-Source\\AutoHotkey\\Test\\TEST SUITES\\Send command.ahk";
84-
//char *script_filespec = "C:\\A-Source\\AutoHotkey\\Ref\\ImageSearch\\TEST SUITE\\MAIN.ahk";
85-
//char *script_filespec = "C:\\A-Source\\AutoHotkey\\Test\\New Text Document.ahk";
86-
#else
87-
char *script_filespec = lpCmdLine ; // Naveen changed from NULL;
88-
#endif
89-
#endif
9071

72+
char *script_filespec = lpCmdLine ; // Naveen changed from NULL;
73+
74+
// MsgBox(script_filespec); // Naveen debugging
9175
// The problem of some command line parameters such as /r being "reserved" is a design flaw (one that
9276
// can't be fixed without breaking existing scripts). Fortunately, I think it affects only compiled
9377
// scripts because running a script via AutoHotkey.exe should avoid treating anything after the
@@ -385,6 +369,8 @@ switch(fwdReason)
385369
case DLL_PROCESS_ATTACH:
386370
{
387371
nameHinstanceP.hInstanceP = hInstance;
372+
// MsgBox((UINT)hInstance);
373+
388374
#ifdef AUTODLL
389375
ahkdll("autoload.ahk", "", ""); // used for remoteinjection of dll
390376
#endif

0 commit comments

Comments
 (0)