forked from dim-s/soulengine
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathguiWinApi.pas
61 lines (54 loc) · 1.38 KB
/
guiWinApi.pas
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
unit guiWinApi;
{$I PHP.inc}
interface
uses Winapi.Windows,
zendTypes,
ZENDAPI,
phpTypes,
PHPAPI,
php4delphi;
procedure InitializeGuiWinAPI(PHPEngine: TPHPEngine);
implementation
procedure gui_ReleaseCapture(ht: integer; return_value: pzval;
return_value_ptr: pzval; this_ptr: pzval; return_value_used: integer;
TSRMLS_DC: pointer); cdecl;
begin
if ht <> 0 then
begin
zend_wrong_param_count(TSRMLS_DC);
Exit;
end;
ZVALVAL(return_value, ReleaseCapture);
end;
procedure gui_SetCapture(ht: integer; return_value: pzval;
return_value_ptr: pzval; this_ptr: pzval; return_value_used: integer;
TSRMLS_DC: pointer); cdecl;
var
p: pzval_array;
begin
if ht < 1 then
begin
zend_wrong_param_count(TSRMLS_DC);
Exit;
end;
zend_get_parameters_my(ht, p, TSRMLS_DC);
ZVALVAL(return_value, SetCapture( HWND(Z_LVAL(p[0]^)) ));
end;
procedure gui_GetCapture(ht: integer; return_value: pzval;
return_value_ptr: pzval; this_ptr: pzval; return_value_used: integer;
TSRMLS_DC: pointer); cdecl;
begin
if ht <> 0 then
begin
zend_wrong_param_count(TSRMLS_DC);
Exit;
end;
ZVALVAL(return_value, GetCapture());
end;
procedure InitializeGuiWinAPI(PHPEngine: TPHPEngine);
begin
PHPEngine.AddFunction('ReleaseCapture', @gui_ReleaseCapture);
PHPEngine.AddFunction('SetCapture', @gui_SetCapture);
PHPEngine.AddFunction('GetCapture', @gui_GetCapture);
end;
end.