5

According to: http://msdn.microsoft.com/en-us/library/windows/desktop/bb762102(v=vs.85).aspx

the SetWindowSubclass prototype is:

BOOL SetWindowSubclass(
   __in  HWND hWnd,
   __in  SUBCLASSPROC pfnSubclass,
   __in  UINT_PTR uIdSubclass,
   __in  DWORD_PTR dwRefData
);

Ok, I understand hWnd, pfnSubclass, and dwRefData.

What I can not find good information on is, what do I set uIdSubclass to?

MSDN says:

The subclass ID. This ID together with the subclass procedure uniquely identify a subclass. To remove a subclass, pass the subclass procedure and this value to the RemoveWindowSubclass function. This value is passed to the subclass procedure in the uIdSubclass parameter.

Ok, understood, but still, where do I get this ID? Is it something I create or do I get it someplace? If it something I create, what should it look like?

I am doing this in C++ and Win32 API, nothing else.

Thanks.

4

0 回答 0