I uploaded the Main.cpp. I tried to subclass a button but afterthe button dissapears. What is wrong ?Code:OldButtonProcedure = (WNDPROC)SetWindowLongPtr(hButton, GWLP_WNDPROC, (LONG_PTR)ButtonProcedure);
Printable View
I uploaded the Main.cpp. I tried to subclass a button but afterthe button dissapears. What is wrong ?Code:OldButtonProcedure = (WNDPROC)SetWindowLongPtr(hButton, GWLP_WNDPROC, (LONG_PTR)ButtonProcedure);
Replace:
with:Code:return OldButtonProcedure(hwnd, message, wParam, lParam);
Maybe, also:Code:return CallWindowProc(OldButtonProcedure, hwnd, message, wParam, lParam);
with:Code:OldButtonProcedure = (WNDPROC)SetWindowLongPtr(hButton, GWLP_WNDPROC, (LONG_PTR)ButtonProcedure);
Code:OldButtonProcedure = (WNDPROC)SetWindowLong(hButton, GWL_WNDPROC, (LPARAM)ButtonProcedure);
Thanks it works now, but I found out about BCM_SETIMAGELIST so the whole mouse track to change buttons on hover was a bad idea. If any 1 happens to know how to use ImageList_Create and Add without: [Linker error] undefined reference to `ImageList_Create@20'. Please let me know in this post. Otherwise I'll probably post a new thread in a couple of days.
ImageList_Create
Does this ring any bells?Quote:
Header
Commctrl.h
Library
Comctl32.lib