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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
|
| #module
#define YEN "\\"
#defcfunc atob str base, str pre, str post, local date, local num, local postdate
;――――――――――――――――――――――――――――――――――――――――
; atob(base,pre,post)
;base中のpreを全てpostに変換した値を返す関数
;――――――――――――――――――――――――――――――――――――――――
postdate = post
date = base
if instr(postdate, 0, pre) ! -1 {
dialog "置換後の単語に置換前の単語が含まれています", 1, "Error"
end
}
date = base
repeat
num = instr(date, 0, pre)
if num = -1 : break
date = strmid(date, 0, num) + post + strmid(date, -1, strlen(date) - num - strlen(pre))
loop
return date
#defcfunc highadress str adress, int nest, local note, local ret
;――――――――――――――――――――――――――――――――――――――――
; highadress(adress,nest)
;adressのnest段階上のアドレスを返す関数
;――――――――――――――――――――――――――――――――――――――――
note = adress
note = atob(note, YEN, "\n")
notesel note
if nest<0 : dialog "nestが負の値です", 0, "Error by [highadress]関数"
repeat nest
notedel notemax - 1
loop
ret = atob(note, "\n", YEN)
return ret
#global
#define DIID_DWebBrowserEvents2 "{34A715A0-6587-11D0-924A-0020AFC7AC4D}"
#define DISPID_COMMANDSTATECHANGE 105
#define DISPID_BEFORENAVIGATE2 250
#define DISPID_NAVIGATECOMPLETE2 252
#define DISPID_ONQUIT 253
#define DISPID_ONMENUBAR 256
#define DISPID_ONSTATUSBAR 257
#define DISPID_ONFULLSCREEN 258
#define DISPID_WINDOWSETLEFT 264
#define DISPID_WINDOWSETTOP 265
#define DISPID_WINDOWSETWIDTH 266
#define DISPID_WINDOWSETHEIGHT 267
#define DISPID_ONTHEATERMODE 260
#define YEN "\\"
chdir highadress(dir_cur, 2) + YEN + "Library"
cls 1
sdim url, 512
url = dir_cur + YEN + "Library" + YEN + "Flame.html"
objsize 600, 24
pos 0, 2 : mes "URL:"
pos 0, 26 : mes "WEB Browser Sample"
pos 40, 0 : input url
objsize 120, 24
pos 520, 24 : button "移動", *wow
pos 400, 24 : button "進む", *go_f
pos 280, 24 : button "戻る", *go_b
pos 0, 48
axobj ie, "Shell.Explorer.2", 640, 480-48
num = stat
comevent ie_event, ie, DIID_DWebBrowserEvents2, *event
logmes "Z"
ie->"Navigate" url
*main
stop
*event
logmes "Event"
; COMイベント処理
dispid = comevdisp(ie_event)
if dispid = DISPID_BEFORENAVIGATE2 : gosub *OnBeforeNavigate
if dispid = DISPID_NAVIGATECOMPLETE2 : gosub *OnNavigateComplete2
return
*OnBeforeNavigate
logmes "on_before_Navigate"
comevarg name, ie_event, 1
objprm 0, name
return
*OnNavigateComplete2
logmes "on_Navigate_complete2"
pDoc = ie("Document")
name = pDoc("Title")
title name
delcom pDoc
return
*wow
logmes "Wow"
ie->"Navigate" url
goto *main
*go_f
logmes "Go_forward"
ie->"GoForward"
goto *main
*go_b
logmes "Go_back"
ie->"GoBack"
goto *main
|