Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do I call GetWindowLong to get an HINSTANCE? #136

Open
kozross opened this issue Dec 9, 2019 · 3 comments
Open

How do I call GetWindowLong to get an HINSTANCE? #136

kozross opened this issue Dec 9, 2019 · 3 comments

Comments

@kozross
Copy link

kozross commented Dec 9, 2019

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?

@Mistuke
Copy link
Contributor

Mistuke commented Dec 11, 2019

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.

@kozross
Copy link
Author

kozross commented Dec 11, 2019

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.

@Mistuke
Copy link
Contributor

Mistuke commented Dec 13, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants