Hi,
Just to give you a very nice idea on how ActiveX events will be supported. Here is a little code sample I use to test with:
ActiveX's Events are caught by PPL and pass on to a PPL code just like a control's WndProc. There is one more parameter, the control$ which contains the activex PPL handle. Mouse and keyboard activex events are translated to regular WndProc event type, meaning you won't have to deal with activex's complexity. Other events for the control are passed in a special manner, the msg$ variable contains the activex's event id, wparam$ contains an array with the values for the event and lparam$ is the number of values in the array.
I hope you guys will like it!
Just to give you a very nice idea on how ActiveX events will be supported. Here is a little code sample I use to test with:
- Code:
// ActiveX controls
#include "windows.ppl"
#include "console.ppl"
func WndProc(hWnd$, Msg$, wParam$, lParam$)
ok$ = true;
case (Msg$)
/*WM_PAINT:
global(a$);
struct(ps$, PAINTSTRUCT);
struct(rt$, RECT);
hdc$ = GetDC(hWnd$);
BeginPaint(hWnd$, &ps;$);
GetClientRect(hWnd$, &rt;$);
FillRect(hdc$, &rt;$, GetStockObject(WHITE_BRUSH));
if (a$)
ActiveXDraw(a$);
end;
EndPaint(hWnd$, &ps;$);
ReleaseDC(hWnd$, hdc$);
ok$ = false;*/
WM_CLOSE:
global(a$);
FreeActiveX(a$);
a$ = NULL;
end;
return (ok$);
end;
func ActiveXProc(hWnd$, Msg$, wParam$, lParam$, control$)
ok$ = true;
case (Msg$)
WM_LBUTTONDOWN:
Writeln("WM_LBUTTONDOWN(" + hWnd$ + "," + LoWord(lParam$) + "," + HiWord(lParam$) + "," + wParam$ + ")");
WM_MOUSEMOVE:
Writeln("WM_MOUSEMOVE(" + hWnd$ + "," + LoWord(lParam$) + "," + HiWord(lParam$) + "," + wParam$ + ")");
WM_LBUTTONUP:
Writeln("WM_LBUTTONUP(" + hWnd$ + "," + LoWord(lParam$) + "," + HiWord(lParam$) + "," + wParam$ + ")");
end;
return (ok$);
end;
func winmain
h$ = newform({OLE}, {OLEClass}, &wndproc;);
InitConsole;
ShowConsole;
global(a$);
a$ = ActiveX(h$, "COMCTL.Slider.1", 10, 10, 400, 40, &ActiveXProc;);
o$ = ActiveXObject(a$);
SetProperty(o$, "Max", 100);
SetProperty(o$, "Value", 50);
b$ = ActiveX(h$, "COMCTL.Slider.1", 10, 100, 150, 120, &ActiveXProc;);
c$ = ActiveX(h$, "COMCTL.ProgCtrl.1", 10, 200, 150, 220, &ActiveXProc;);
o$ = ActiveXObject(c$);
SetProperty(o$, "Max", 100);
SetProperty(o$, "Value", 50);
d$ = ActiveX(h$, "COMCTL.TreeCtrl.1", 200, 100, 400, 300, &ActiveXProc;);
e$ = ActiveX(h$, "ComCtl2.UpDown.1", 10, 300, 24, 324, &ActiveXProc;);
f$ = ActiveX(h$, "QuickTime.QuickTime.4", 500, 200, 700, 400, &ActiveXProc;);
o$ = ActiveXObject(f$);
Invoke(o$, "SetURL", "c:\\download\\ceremony1_lo.mov");
ShowWindow(h$, SW_SHOW);
return (true);
end;
ActiveX's Events are caught by PPL and pass on to a PPL code just like a control's WndProc. There is one more parameter, the control$ which contains the activex PPL handle. Mouse and keyboard activex events are translated to regular WndProc event type, meaning you won't have to deal with activex's complexity. Other events for the control are passed in a special manner, the msg$ variable contains the activex's event id, wparam$ contains an array with the values for the event and lparam$ is the number of values in the array.
I hope you guys will like it!