win32 icon indicating copy to clipboard operation
win32 copied to clipboard

How do I call GetWindowLong to get an HINSTANCE?

Open kozross opened this issue 6 years ago • 3 comments

I'm following this tutorial for making a button, and I'm up to this part:

(HINSTANCE)GetWindowLong(m_hwnd, GWL_HINSTANCE)

What should I call from this library's API to achieve the same effect?

kozross avatar Dec 09 '19 22:12 kozross

Are you talking about the missing constant GWL_HINSTANCE? for now just define it yourself or use hsc2hs. create a file that ends in .hsc and just #include <Windows.h> and use {#const GWL_HINSTANCE}.

I'll add the remaining constants later. Thanks for pointing it out.

Mistuke avatar Dec 11 '19 07:12 Mistuke

Not just the constant - I wasn't able to find the GetWindowLong function (or any equivalent) by searching this repo, and I'm not sure where in the Win32 package it resides.

kozross avatar Dec 11 '19 20:12 kozross

https://hackage.haskell.org/package/Win32-2.8.4.0/docs/Graphics-Win32-LayeredWindow.html as msdn says GetWindowLong is an obsolete api. GetWindowLongPtr should be used.

Mistuke avatar Dec 13 '19 07:12 Mistuke