Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.

Implementing Rich Text Edit Functionality

2»

Comments

  • Don as I said my API skills are down the drain. (I know I played with all this some 15 years ago, but looking at Bob example i don't know why the program doesn't exit on line 35 )
    Feel like I have to start from scratch.
    Below is Bob's example that I didn't get to work. What did I do wrong?
    Besides not getting the example to work you said that I needed to update DLL_GDI32 or create my own (DLL_FONT32 okay?)
    1 FONT32
    2 INT STDCALL EnumFontFamiliesA(CALLBACK, VARIABLE)
    ------------------------
    function callback_test(hwnd, lParam)
    * ** Demo of Native Callbacks from OI
    * 03-14-04 PJM Created
    * 08-03-06 RJC Add self-prototype
    Debug
    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 l
    Param = 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)
    /* I know it exists and I don't want to mesh up USER32
    1 USER32
    2 UINT STDCALL ArrangeIconicWindows(HANDLE)
    3 INT STDCALL BringWindowToTop(HANDLE)
    4 INT STDCALL EnumWindows(CALLBACK, VARIABLE)
    */
    * 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)

    return

    * Windows now contains all desktop window handles. return Windows
    *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.
    ----------------------
    The error I got was error loading program EnumWindows
Sign In or Register to comment.