On Tuesday, 26 May 2020 at 12:41:20 UTC, John Chapman wrote:
On Monday, 25 May 2020 at 16:26:31 UTC, Vinod K Chandran wrote:
Here is my full code. Please take a look.
https://pastebin.com/av3nrvtT

Change line 124 to:

SetWindowSubclass(this.mHandle, SUBCLASSPROC(&btnWndProc), UINT_PTR(subClsID), cast(DWORD_PTR)cast(void*)this);

That is, change `&this` to `cast(void*)this`.

Hi,
Thanks for the reply. That will work like charm but we need to change the code in subclassed button's WndProc like this--
extern(Windows)
private LRESULT btnWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam, UINT_PTR scID, DWORD_PTR refData) {
    try  {

        Button thisBtn = cast(Button)cast(void*)refData;
     {
    catch (Exception e) {}
    ....

Reply via email to