回答編集履歴
8
リンク追加
test
CHANGED
@@ -53,3 +53,13 @@
|
|
53
53
|
Private Const DESKTOP_SWITCHDESKTOP = &H0100
|
54
54
|
|
55
55
|
```
|
56
|
+
|
57
|
+
|
58
|
+
|
59
|
+
---
|
60
|
+
|
61
|
+
MicrosoftがVBA用のAPIや構造体、定数の定義を公開しています。
|
62
|
+
|
63
|
+
[Office 2010 Help Files: Win32API_PtrSafe with 64-bit Support](https://www.microsoft.com/en-us/download/confirmation.aspx?id=9970)
|
64
|
+
|
65
|
+
ダウンロードして実行すると`C:\Office 2010 Developer Resources\Documents\`に解凍されます。
|
7
DESKTOP_~追記
test
CHANGED
@@ -27,3 +27,29 @@
|
|
27
27
|
Private Const GENERIC_EXECUTE = &H20000000
|
28
28
|
|
29
29
|
```
|
30
|
+
|
31
|
+
|
32
|
+
|
33
|
+
他の値も使いたいなら上記ページに書いてある値を定義してください。
|
34
|
+
|
35
|
+
```VBA
|
36
|
+
|
37
|
+
Private Const DESKTOP_READOBJECTS = &H0001
|
38
|
+
|
39
|
+
Private Const DESKTOP_CREATEWINDOW = &H0002
|
40
|
+
|
41
|
+
Private Const DESKTOP_CREATEMENU = &H0004
|
42
|
+
|
43
|
+
Private Const DESKTOP_HOOKCONTROL = &H0008
|
44
|
+
|
45
|
+
Private Const DESKTOP_JOURNALRECORD = &H0010
|
46
|
+
|
47
|
+
Private Const DESKTOP_JOURNALPLAYBACK = &H0020
|
48
|
+
|
49
|
+
Private Const DESKTOP_ENUMERATE = &H0040
|
50
|
+
|
51
|
+
Private Const DESKTOP_WRITEOBJECTS = &H0080
|
52
|
+
|
53
|
+
Private Const DESKTOP_SWITCHDESKTOP = &H0100
|
54
|
+
|
55
|
+
```
|
6
他の値も追記
test
CHANGED
@@ -6,6 +6,8 @@
|
|
6
6
|
|
7
7
|
|
8
8
|
|
9
|
+
[https://docs.microsoft.com/en-us/windows/win32/winstation/desktop-security-and-access-rights](https://docs.microsoft.com/en-us/windows/win32/winstation/desktop-security-and-access-rights)
|
10
|
+
|
9
11
|
`winnt.h`の定義より
|
10
12
|
|
11
13
|
```VBA
|
@@ -13,3 +15,15 @@
|
|
13
15
|
Private Const GENERIC_ALL = &H10000000
|
14
16
|
|
15
17
|
```
|
18
|
+
|
19
|
+
他の上記ページに値が書いてないものもついでに…
|
20
|
+
|
21
|
+
```VBA
|
22
|
+
|
23
|
+
Private Const GENERIC_READ = &H80000000
|
24
|
+
|
25
|
+
Private Const GENERIC_WRITE = &H40000000
|
26
|
+
|
27
|
+
Private Const GENERIC_EXECUTE = &H20000000
|
28
|
+
|
29
|
+
```
|
5
0除去
test
CHANGED
@@ -10,6 +10,6 @@
|
|
10
10
|
|
11
11
|
```VBA
|
12
12
|
|
13
|
-
Private Const GENERIC_ALL = &H
|
13
|
+
Private Const GENERIC_ALL = &H10000000
|
14
14
|
|
15
15
|
```
|
4
本来の値を残して削除
test
CHANGED
@@ -6,17 +6,7 @@
|
|
6
6
|
|
7
7
|
|
8
8
|
|
9
|
-
[Desktop Security and Access Rights](https://docs.microsoft.com/en-us/windows/win32/winstation/desktop-security-and-access-rights)
|
10
|
-
|
11
|
-
より
|
12
|
-
|
13
|
-
```VBA
|
14
|
-
|
15
|
-
Private Const GENERIC_ALL = &H1FF
|
16
|
-
|
17
|
-
```
|
18
|
-
|
19
|
-
|
9
|
+
`winnt.h`の定義より
|
20
10
|
|
21
11
|
```VBA
|
22
12
|
|
3
GENERIC_ALLについて追記
test
CHANGED
@@ -8,8 +8,18 @@
|
|
8
8
|
|
9
9
|
[Desktop Security and Access Rights](https://docs.microsoft.com/en-us/windows/win32/winstation/desktop-security-and-access-rights)
|
10
10
|
|
11
|
+
より
|
12
|
+
|
11
13
|
```VBA
|
12
14
|
|
13
15
|
Private Const GENERIC_ALL = &H1FF
|
14
16
|
|
15
17
|
```
|
18
|
+
|
19
|
+
もしくは`winnt.h`の定義より
|
20
|
+
|
21
|
+
```VBA
|
22
|
+
|
23
|
+
Private Const GENERIC_ALL = &H010000000
|
24
|
+
|
25
|
+
```
|
2
他のGENERIC_ALLと取り違えていたので値を修正
test
CHANGED
@@ -6,8 +6,10 @@
|
|
6
6
|
|
7
7
|
|
8
8
|
|
9
|
+
[Desktop Security and Access Rights](https://docs.microsoft.com/en-us/windows/win32/winstation/desktop-security-and-access-rights)
|
10
|
+
|
9
11
|
```VBA
|
10
12
|
|
11
|
-
Private Const GENERIC_ALL = &H1
|
13
|
+
Private Const GENERIC_ALL = &H1FF
|
12
14
|
|
13
15
|
```
|
1
エラー理由追記
test
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
> エラー発生理由
|
2
|
+
|
3
|
+
|
4
|
+
|
5
|
+
エラーメッセージの通り、変数が定義されていないから。
|
6
|
+
|
7
|
+
|
8
|
+
|
1
9
|
```VBA
|
2
10
|
|
3
11
|
Private Const GENERIC_ALL = &H10000000
|