[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: GUI Toolkit for Win32
- From: CHU Run-min <churunmin@...>
- Date: Thu, 5 Jan 2006 10:41:44 +0800
My idea is that Lua script like a hook to the native GUI system.
There is a general hook function in Lua, OnWindowMessage(hwnd, msg_name,...)
There is also a general window procedure in C. It translates some
necessary window messages to Lua by calling OnWindowMessage.
We will subclass all created window to the general window procedure
and save old window procedure in window's user data field.
SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)SubclassWindow(hwnd,
SubclassProc));
The window message will be forward to old window procedure unless
OnWindowMessage returns true.
Now, we call do something with OnWindowMessage.