This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathREADME
199 lines (140 loc) · 4.82 KB
/
README
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
This extension allow access to some Win32 usefull API.
Summary
----------
- RES (access to resource of .exe/.dll files on Win32)
- RES stream wrapper for reading. Compatible with the res protocol defined by MS
- REGISTRY access
- Common Win32 dialogs (open/save file, open dir, message boxes)
- Wrapper for some standard function (win_shell_execute, win_play_wav, win_beep, win_create_link)
Reference
----------
resource res_open( module_name )
Return a (PHP)resource that identify the (WIN)resource module handle.
A module is either a dll file or an exe file.
bool res_close( resouce module )
Close a module handle
string res_get( resource module, string type, string name[, int lang] )
Get a resource.
lang is experimental: 0 is neutral, 1 is user default, 2 is system default (see winnt.h LANG_* & SUBLANG_*).
bool res_set( string file, string type, string name, string data[, int lang] )
Add or modify a resource in 'file' (dll or exe)
lang is experimental: 0 is neutral, 1 is user default, 2 is system default (see winnt.h LANG_* & SUBLANG_*).
Fail if the file is in use.
array res_list( resource module, string type )
return the resource list for a given type
array res_list_type( resource module [, bool as_string=true] )
return the resource type list for a given module
as_string specify if known type should be translated to string (but such string can't be used in res_get)
bool win_shell_execute(string absolute_path[, string action, string args, string dir])
Execute a shell action on a file or directory
Common actions: open, edit, explore, find, print, properties
The shell act the same way when you double click on an icon (action=NULL) or when you choose a menu item on the right click button
This way you can also execute programs that are totaly detached from the current one (useful with DirectX games for exemple).
win_play_wav( file[, loop])
file may be either NULL to stop playback or a file name to start it
loop can be set to loop playback (default to false)
module may be opened by res_open a file must represent the resource id (NOT IMPL)
win_beep(string type)
plays the system sound used by default for pre-defined events:
'*': System Asterisk
'!': System Exclamation
'H': System Hand
'?': System Question
'1': System Default
'0': Standard beep using the computer speaker
int win_create_link( file, link_file, args, descr, workingdir )
Create a MS link file (.lnk)
Don't forget the .lnk at the end of link_file !
int win_message_box( text[, type, caption] )
Prompt a typical Win32 message box.
Use the Messages Box Constants to modify the appearance of the message box
int win_browse_folder( [string dir, string caption=""] )
Prompt a "browse for folder" message box
string win_browse_file( [open, path, filename, ext, filter] )
open or save dialog box, starting path, default filename, default extension, filter in MS format
Filter exemple:
"HTML File\0*.htm;*.html\0INI file\0*.ini\0All files\0*.*\0\0"
or:
array( "HTML File" => "*.htm;*.html", "INI File" => "*.ini", "All file" => "*.*" )
resource reg_open_key(mixed hKey, string subkey [, int samDesired = KEY_ALL_ACCESS])
Open a registry key
resource reg_create_key(mixed hKey, string subkey [, int samDesired = KEY_ALL_ACCESS])
Create a sub key
void reg_close_key(resource hKey)
Close a registry key
mixed reg_enum_key(mixed hKey[, int index=1])
Return the 'index' based sub key.
Return false when done.
mixed reg_enum_value(mixed hKey[, int index=-1])
Return the 'index' based value.
Return false when done.
bool reg_set_value(mixed hKey, string value_name, int type, mixed value)
Set a value.
mixed reg_get_value(mixed hKey, string value_name)
Get a value.
Constants for resource types
RT_CURSOR="#1"
RT_BITMAP="#2"
RT_ICON="#3"
RT_MENU="#4"
RT_DIALOG="#5"
RT_STRING="#6"
RT_FONTDIR="#7"
RT_FONT="#8"
RT_ACCELERATOR="#9"
RT_RCDATA="#10"
RT_MESSAGETABLE="#11"
RT_GROUP_CURSOR="#12"
RT_GROUP_ICON="#14"
RT_VERSION="#16"
RT_DLGINCLUDE="#17"
RT_PLUGPLAY="#19"
RT_VXD="#20"
RT_ANICURSOR="#21"
RT_ANIICON="#22"
RT_HTML="#23"
Message box type constants:
MB_OK
MB_OKCANCEL
MB_RETRYCANCEL
MB_YESNO
MB_YESNOCANCEL
Message box icon constants
MB_ICONEXCLAMATION
MB_ICONWARNING
MB_ICONINFORMATION
MB_ICONASTERISK
MB_ICONQUESTION
MB_ICONSTOP
MB_ICONERROR
MB_ICONHAND
Message box default button constants
MB_DEFBUTTON1
MB_DEFBUTTON2
MB_DEFBUTTON3
MB_DEFBUTTON4
Message box return constants
MB_IDABORT
MB_IDCANCEL
MB_IDNO
MB_IDOK
MB_IDYES
MB_IDIGNORE
MB_IDRETRY
Registry main key constants
HKEY_CLASSES_ROOT
HKEY_CURRENT_CONFIG
HKEY_CURRENT_USER
HKEY_LOCAL_MACHINE
HKEY_USERS
Registry access type
KEY_ALL_ACCESS
KEY_WRITE
KEY_READ
Registry value type
REG_BINARY
REG_DWORD
REG_EXPAND_SZ
REG_MULTI_SZ
REG_NONE
REG_SZ