[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: How to get the current thread in C code?
- From: Cloud Wu <cloudwu@...>
- Date: Thu, 21 Dec 2006 14:15:43 +0800
Thursday, December 21, 2006, 9:06:20 AM, you wrote:
mg> Option 2 is for when you need one lua_State per window.
mg> You can read MSDN on GetWindowLong/SetWindowLong (I won't explain them).
mg> But the following code will give you an idea:
But message process and create window may not in the same coroutine.
For example, if you are calling UpdateWindow in a lua coroutine.
UpdateWindow will call SendMessage(hWnd,WM_PAINT) , and this will call
my WinProc . At this time, it needs coroutine's lua_State *L , not the
lua_State at the time window created .