From: Michael Davis Date: 2002-01-15T16:31:46+09:00 Subject: Mswin32.c Would it be possible to get the following methods added to mswin32.c? Please let me know what the proper process for these types of requests. These two methods are needed for my new locana GUI to work with mswin32. static LRESULT CALLBACK Win32API_MessageHandler(hwnd, uMsg, wParam, lParam) // This is a pass through function to the Ruby method called 'Win32API_MessageHandler' that will process windows messages HWND hwnd; UINT uMsg; WPARAM wParam; LPARAM lParam; { VALUE rc = Qnil; ID proc_id; proc_id = (ID)GetWindowLong(hwnd, (int)GWL_USERDATA); // let's see if the user has registered a proc name //printf("Win32API_MessageHandler(%d, ...) - proc_id:'%d'\n", (int)hwnd, proc_id); if (!proc_id) proc_id = rb_intern("Win32API_MessageHandler"); // the default message handler is a Ruby method that you must create called Win32API_MessageHandler if (proc_id) rc = rb_funcall(rb_cObject, proc_id, 4, INT2NUM((long)hwnd), INT2NUM((long)uMsg), INT2NUM((long)wParam), INT2NUM((long)lParam)); if (rc == Qnil) return DefWindowProc(hwnd,uMsg,wParam,lParam); else return (LRESULT)NUM2LONG(rc); } static VALUE Win32API_GetMessageHandler() // RegisterClass needs the C function used for processing messages { return INT2NUM((unsigned long)(Win32API_MessageHandler)); } I also need to add the following to Init_Win32API() in mswin32.c: rb_define_module_function(cWin32API, "get_message_handler", Win32API_GetMessageHandler, 0); Thanks, Michael