-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtmp.au3
More file actions
89 lines (65 loc) · 2.47 KB
/
Copy pathtmp.au3
File metadata and controls
89 lines (65 loc) · 2.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
Global $a[]
$a['a'] = 1
$a['b'] = 2
For $x In MapKeys($a)
consolewrite($x&@crlf)
Next
Exit
#include <WinAPIHObj.au3>
#include <WinAPI.au3>
ConsoleWrite("hello"&@CRLF)
;FileWrite(_WinAPI_GetStdHandle(1), "hello"&@CRLF)
ConsoleWrite(_WinAPI_WriteConsole(_WinAPI_GetStdHandle(1), "hello"&@CRLF)&@crlf)
Exit 1
#include <Array.au3>
#include "au3pm\StringRegExpSplit\StringRegExpSplit.au3"
;$aResult = StringRegExpSplit("resource(1) of type (Ptr)", "(.*\R)", 0, BitOR($PREG_SPLIT_DELIM_CAPTURE, $PREG_SPLIT_NO_EMPTY))
;_ArrayDisplay($aResult)
ConsoleWrite((Not "a" = "")&@CRLF)
ConsoleWrite((Not ("a" = ""))&@CRLF)
ConsoleWrite((Not "a" == "")&@CRLF)
ConsoleWrite((Not ("a" == ""))&@CRLF)
Local $a = [1,2,3]
Local $b = [1,2,3]
ConsoleWrite(($a = $a)&@CRLF)
Func test($error = @error, $extended = @extended)
Local $e = [$error, $extended]
Return $e
EndFunc
setError(0xDEAD, 0xBEEF)
_arrayDisplay(test())
Func x()
return setError(1, 1, 1)
EndFunc
Func y()
Return ErrorAsValue(x())
EndFunc
Func ErrorAsValue($return, $error = @error, $extended = @extended)
Local $a = [$return, $error, $extended]
Return SetError(@error, @extended, $a)
EndFunc
$a = y()
_arraydisplay($a)
consolewrite(@error&@CRLF)
;----------------------------------------------------------------------
#include <WinAPIHObj.au3>
#include <NamedPipes.au3>
$hStdOut = _WinAPI_GetStdHandle(1)
ConsoleWrite($hStdOut&@CRLF)
Func SetStdHandle($nStdHandle, $hHandle) ;returns BOOL
;http://msdn.microsoft.com/en-us/library/windows/desktop/ms686244%28v=vs.85%29.aspx
Local $aRet = DllCall("kernel32.dll", "BOOL", "SetStdHandle", "DWORD", $nStdHandle, "HANDLE", $hHandle)
If @error <> 0 Then Return SetError(@error, 0, False)
Return $aRet[0] <> 0
EndFunc
;$hConOut = CreateFile("CONOUT$", BitOR($GENERIC_READ, $GENERIC_WRITE), BitOR($FILE_SHARE_READ, $FILE_SHARE_WRITE), Null, $OPEN_EXISTING, $FILE_ATTRIBUTE_NORMAL)
;$hConOut = CreateFile("CONOUT$", BitOR($GENERIC_READ, $GENERIC_WRITE), BitOR($FILE_SHARE_READ, $FILE_SHARE_WRITE), Null, $OPEN_EXISTING, $FILE_ATTRIBUTE_NORMAL)
Local $hReadPipe, $hWritePipe
_NamedPipes_CreatePipe($hReadPipe, $hWritePipe)
Global Const $STD_INPUT_HANDLE = -10
Global Const $STD_OUTPUT_HANDLE = -11
Global Const $STD_ERROR_HANDLE = -12
SetStdHandle($STD_OUTPUT_HANDLE, $hWritePipe)
ConsoleWrite(_WinAPI_GetStdHandle(1)&@crlf)
;SetStdHandle(STD_OUTPUT_HANDLE, 0)
ConsoleWrite("test"&@crlf)