Hi Nicolai, missed this thread - sorry. To my knowledge there was a call in NB for CreateWindow but there was no example in opening a new window. For X-Windows there was an example if I remember correctly.
Basically I would like to add support for this into OS-Windows, yes. Some parts are there and UFFI now has easy callbacks. Havent looked at OSWindow yet - but I guess the goal is to create native windows as well. Also I would like to add more support in manipulating/quering other external windows (which can be done using the already built in support for process and window handles). In Win32 to create a window one has to register a window class first and use the window class name afterwards in the CreateWindow API function. No time to look into this this week ... but can give a try afterwards. The WNDCLASS/WNDCLASSEX structure needs to be wrapped, RegisterClass called and CreateWindowEx with a callback for a function to process window messages. Dont know how if this interferes with the VM's own processing loop ... but we should give a try. If you catch me on Slack next week we can try together. Bye Torsten Gesendet: Sonntag, 24. April 2016 um 12:17 Uhr Von: "Nicolai Hess" <[email protected]> An: "Pharo Development List" <[email protected]> Betreff: Re: [Pharo-dev] OS-Windows and UnifiedFFI 2016-04-15 21:58 GMT+02:00 Nicolai Hess <[email protected]>: Hi Torsten, Esteban, I try to use OS-Windows (not OSWindow :) ) with latest spur VM and UnifiedFFI.As far as I can see, you (Torsten) already ported some parts to UnifiedFFI - great, thanks! I now try to open a new window withWinWindow>>createWindowEx ....as I took this example originally from NBOpenGL, it seems I have to define a Window Class first, with WinWndClassEx This seems to work in the old NBOpenGL/NBWin32 code but not with OS-Windows WinWndClassEx first, NBOpenGL uses NativeBoostWin32 getVMModuleHandle for an HModule instance there is a similar call in OS-Windows, WinProcess getVMModuleHandle (I needed to define a missing type, HMODULE, but that works). What does not work is this part: | hInst wndClass | hInst := WinProcess getVMModuleHandle. wndClass := WinWndClassEx new. wndClass hInstance: hInst. FF complains about pointerAt: byteOffset put: value "Store a pointer object at the given byte address" value isExternalAddress here value is not a handle, but a small integer, and it does not define isExternalAddress I tried to put the handle instead of the handles value, but this does not work either. Any Idea what is missing here, I need a way to store the HMODULE handle in the structure of the WinWNdClassEx Thanks in advance. Anyone?
