-
November 25th, 2010, 08:36 AM
#1
Subclassing a button
I uploaded the Main.cpp. I tried to subclass a button but after
Code:
OldButtonProcedure = (WNDPROC)SetWindowLongPtr(hButton, GWLP_WNDPROC, (LONG_PTR)ButtonProcedure);
the button dissapears. What is wrong ?
Last edited by Sevko; November 2nd, 2011 at 05:53 PM.
-
November 25th, 2010, 11:12 AM
#2
Re: Subclassing a button
Replace:
Code:
return OldButtonProcedure(hwnd, message, wParam, lParam);
with:
Code:
return CallWindowProc(OldButtonProcedure, hwnd, message, wParam, lParam);
Maybe, also:
Code:
OldButtonProcedure = (WNDPROC)SetWindowLongPtr(hButton, GWLP_WNDPROC, (LONG_PTR)ButtonProcedure);
with:
Code:
OldButtonProcedure = (WNDPROC)SetWindowLong(hButton, GWL_WNDPROC, (LPARAM)ButtonProcedure);
-
November 26th, 2010, 08:25 AM
#3
Re: Subclassing a button
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.
-
November 28th, 2010, 04:01 PM
#4
Re: Subclassing a button
ImageList_Create
Header
Commctrl.h
Library
Comctl32.lib
Does this ring any bells?
Best regards,
Igor
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|