{{tag>category:"OpenInsight 32-Bit" author:"Bob Carten" author:"[url=http://www.sprezzatura.com]The Sprezzatura Group[/url]" author:"Mike Ruane"}} [[https://www.revelation.com/the-works|Join The Works program to have access to the most current content, and to be able to ask questions and get answers from Revelation staff and the Revelation community]] ==== Native Callbacks in OpenInsight (OpenInsight 32-Bit) ==== === At 03 AUG 2006 01:00:01PM Bob Carten wrote: === Viewing the [url=http://www.revelation.com/o4wtrs/oecgi3.exe/O4W_DOMINO_HANDOFF?DESTN=O4W_RUN_FORM&INQID=WORKS_READ&KEY=27A05266A6A4F78F852571BF002C06E4&KEY1=27A05266A6A4F78F852571BF002C06E4]ShellExecute Thread reminded me of a to date undocumented feature of OpenInsight, namely the ability to create native callbacks. An example appears below. Help Docs will be updated. pre.code { background-color: #E5E5E5; border: 1px solid #000000; width: 600px; padding: 5px; font-family: courier, verdana, arial, serif; margin: 0px 10px auto; } function callback_test(hwnd, lParam) * ** Demo of Native Callbacks from OI * 03-14-04 PJM Created * 08-03-06 RJC Add self-prototype declare function CreateCallBack, EnumWindows * Check if this is a callback invocation. if assigned(hwnd) and len(hwnd) ] 0 then * It is, accumulate all hwnds in our Basic+ variable lParam=hwnd return 1 end * Initalizing Invocation * Ensure Windows API call is supported * EnumWindows is declared as: INT STDCALL EnumWindows(CALLBACK, VARIABLE) * lib=USER32' proto_id=DLL_':lib proto_rec=Xlate('SYSPROCS', proto_id, '', 'X') if proto_Rec=' then proto_rec=lib end exists=indexc(proto_rec, ' EnumWindows', 1) If exists else proto_rec=INT STDCALL EnumWindows(CALLBACK, VARIABLE)" call write_Row('SYSPROCS', proto_id, proto_rec, 1) call declare_fcns(proto_id) end * Create the call back handle. We will recursively * call back to ourselves in this test. CallBack=CreateCallBack("INT STDCALL CALLBACK_TEST(HANDLE, VARIABLE)") if not(num(CallBack)) then debug ;* error!!! end Windows=' a=EnumWindows(CallBack, Windows) * Windows now contains all desktop window handles. return Windows ---- === At 03 AUG 2006 01:19PM [url=http://www.sprezzatura.com]The Sprezzatura Group[/url] wrote: === A useful technique indeed! We've used this to great effect at Sprezz Towers to enumerate monitors in a multiple monitor environment so we can more effectively work out to to lay out our more sophisticated OI apps. [url=http://www.sprezzatura.com]The Sprezzatura Group[/url] [i]World leaders in all things RevSoft[/i] [img]http://www.sprezzatura.com/zz.gif[/img] ---- === At 03 AUG 2006 01:58PM Mike Ruane wrote: === Sprezz Towers? ---- === At 03 AUG 2006 02:54PM [url=http://www.sprezzatura.com]The Sprezzatura Group[/url] wrote: === [img]http://www.sprezzatura.com/images/sprezz.jpg[/img] :) [url=http://www.sprezzatura.com]The Sprezzatura Group[/url] [i]World leaders in all things RevSoft[/i] [img]http://www.sprezzatura.com/zz.gif[/img] ---- === At 04 AUG 2006 07:29PM Bob Carten wrote: === suite! [[https://www.revelation.com/revweb/oecgi4p.php/O4W_HANDOFF?DESTN=O4W_RUN_FORM&INQID=WORKS_READ&SUMMARY=1&KEY=A589FB6F69E2899F852571BF005D62A9|View this thread on the Works forum...]]