This repository was archived by the owner on Mar 7, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmenu.as
More file actions
executable file
·78 lines (61 loc) · 2.31 KB
/
menu.as
File metadata and controls
executable file
·78 lines (61 loc) · 2.31 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
#define WM_COMMAND 0x0111
; メニューアイテムIDを定義
#define CMD_OPENBBS1 1 ;「BBS を開く」アイテムのID
;#define CMD_OPENBBS2 5
#define CMD_MINI 2 ;「最小化」アイテムのID
#define CMD_QUIT 3 ;「終了」アイテムのID
;#define CMD_MESSAGE 4 ;「メッセージ表示」アイテムのID
;---------------「ファイル」メニューの作成-------------------
dllproc "CreatePopupMenu", pm, 0, D_USER
hmenufile = dllret ; 「ファイル」メニューハンドル
mesbuf = "BBS を開く(&O)"
pm = hmenufile, 0, CMD_OPENBBS1
getptr pm.3, mesbuf
dllproc "AppendMenuA", pm, 4, D_USER
;mesbuf = "BBS(8000) を開く(&0)"
;pm = hmenufile, 0, CMD_OPENBBS2
;getptr pm.3, mesbuf
;dllproc "AppendMenuA", pm, 4, D_USER
mesbuf = "最小化(&N)"
pm = hmenufile, 0, CMD_MINI
getptr pm.3, mesbuf
dllproc "AppendMenuA", pm, 4, D_USER
pm = hmenufile, $800, 0, 0 ; 区切り線を指定
dllproc "AppendMenuA", pm, 4, D_USER
mesbuf = "終了(&Q)"
pm = hmenufile, 0, CMD_QUIT
getptr pm.3, mesbuf
dllproc "AppendMenuA", pm, 4, D_USER
;----------------「ヘルプ」メニューの作成--------------------
;dllproc "CreatePopupMenu", pm, 0, D_USER
;hmenuhelp = dllret ; 「ヘルプ」メニューハンドル
;mesbuf = "メッセージ表示(&M)"
;pm = hmenuhelp, 0, CMD_MESSAGE
;getptr pm.3, mesbuf
;dllproc "AppendMenuA", pm, 4, D_USER
;-------------------メニューバーの作成-----------------------
dllproc "CreateMenu", pm, 0, D_USER
hmenu = dllret ; メニューハンドル
mesbuf = "ファイル(&F)"
pm = hmenu, $10, hmenufile ; 「ファイル」メニュー追加
getptr pm.3, mesbuf
dllproc "AppendMenuA", pm, 4, D_USER
;mesbuf = "ヘルプ(&H)"
;pm = hmenu, $10, hmenuhelp ; 「ヘルプ」メニュー追加
;getptr pm.3, mesbuf
;dllproc "AppendMenuA", pm, 4, D_USER
; ウィンドウのサブクラス化
set_subclass
hwnd = stat ; HSPウィンドウのハンドル
set_message WM_COMMAND ; 取得メッセージ設定
; メニューをウィンドウに割り当てる
pm.0 = hwnd ; ウィンドウハンドル
pm.1 = hmenu ; メニューハンドル
dllproc "SetMenu", pm, 2, D_USER
; メニューを再描画
pm.0 = hwnd ; メニューハンドル
dllproc "DrawMenuBar", pm, 1, D_USER
; メッセージパラメータ用変数
dup msg, msgval.1 ; メッセージが格納される変数
dup wprm, msgval.2 ; wParamパラメータが格納される変数
dup lprm, msgval.3 ; lParamパラメータが格納される変数