0

"the type or name space name 'HWND' couldnot be found.are you missing a using directive or assembly reference".i got this error message when i run below code in c#.

        {
          LRESULT CALLBACK NewListViewWndProc(HWND hwnd, UINT uiMsg, WPARAM wParam, LPARAM lParam)

                    switch (uiMsg)
                    {
                        case WM_CONTEXTMENU:    // trying to create a context menu?
                            {
                                return 0;       // eat this message, prevent context menu
                            }

                            break;
                    }


        }

how can i solve it????????????

3
Contributors
3
Replies
25
Views
3 Years
Discussion Span
Last Post by ddanbe
0

This is C++ code and won't work in C# unless you import the relevent Windows API DLLs.

See pinvoke.net for more information on how to do that and what is available to you.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.