   using WndProc in .NET (part 2)
  i need to pass HWND of the main window to HANDLE_ENABLE() that have as prototype and body this:public: void HANDLE_ENABLE( HWND handle, System::Windows::Forms::Message __gc* msg, LPARAM Lparam ){DefWindowProc( handle, msg->Msg, TRUE, Lparam ); }but i''m not success to get the HWND by "this->", just the handle with "this->handle" but i don''t know how to convert it in HWND, this is the code:public: void WndProc( Message __gc* msg ){switch (msg->Msg){case WM_ENABLE :if( this->getActive() ) this->setActive(false); else this->setActive(true);HndWindows->HANDLE_ENABLE( this->get_Handle(), msg, (int)msg->LParam );break; 
  this->get_Handle()->ToPointer(). That gives you a void*. Apply other casts as needed.   --AnkhSVN - A Visual Studio .NET Addin for the Subversion version control system.[Project site] [Blog] [RSS] [Browse the source] [IRC channel] ;  so (HWND)this->get_Handle().ToPointer() is the way acepted? ;  Why don''t you try it and let us know? ;  becouse it doesn''t work. ;  And what does "doesn''t work" mean? It doesn''t compile? It fails at runtime? You get an exception? The moon turns into a blob of pink cheese? The universe ends in a big crunch? ;  The moon turns into a blob of pink cheese OF COURSE!joke to part, it works correctly (without error) but i seems the pointer doesn''t point to a correct window handle couse it doesn''t make what i tell to do....anyway i''ll test better and i will can tell you.Thanks a lot, for the moment. ;  i know this moon-issue. happens quite often..:D   If that''s not the help you''re after then you''re going to have to explain the problem better than what you have. - joanusdmentiadavepermen.net 