Re: How do I do this in Euphoria? Structs and Windows Messag
- Posted by Evan Marshall <1evan at sbcglobal.net> May 30, 2004
- 439 views
To do this in Euphoria; typedef struct tagREGMESSAGE { HWND hWnd UINT uiMessage WPARAM wParam }REGMESSAGE; just do this:
include machine.e atom hWnd, uiMessage, wParam atom REGMESSAGE atom user32 integer SendMessage integer retval -- for holding unneeded return values from functions REGMESSAGE = allocate(12) --REGMESSAGE 'Structure' hWnd = peek4u(REGMESSAGE + 0) --value stored in 1st word uiMessage = peek4u(REGMESSAGE + 4) --value stored in 2nd word wParam = peek4u(REGMESSAGE + 8) --value stored in 3rd word user32 = open_dll("user32.dll") SendMessage = link_c_func(user32, "SendMessageA", {C_POINTER,C_UINT,C_LONG,C_LONG},C_LONG) retval = c_func(SendMessage,{hWnd, uiMessage, wParam, NULL)
This is obviously far from complete, but it should give you a place to start.