LB Booster
« List view: detecting columnclick »

Welcome Guest. Please Login or Register.
Apr 1st, 2018, 04:21am



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
We apologize Conforums does not have any export functions to migrate data.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

Thank you Conforums members.
Speed up Liberty BASIC programs by up to ten times!
Compile Liberty BASIC programs to compact, standalone executables!
Overcome many of Liberty BASIC's bugs and limitations!
LB Booster Resources
LB Booster documentation
LB Booster Home Page
LB Booster technical Wiki
Just BASIC forum
BBC BASIC Home Page
Liberty BASIC forum (the original)

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: List view: detecting columnclick  (Read 808 times)
Hans
New Member
Image


member is offline

Avatar




PM

Gender: Male
Posts: 31
xx Re: List view: detecting columnclick
« Reply #3 on: Jul 15th, 2016, 7:43pm »

I never meet crashes using this code.
_WM_LBUTTONDBLCLK works as expected, so does _WM_LBUTTONUP and _WM_RBUTTONUP.
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Re: List view: detecting columnclick
« Reply #4 on: Jul 15th, 2016, 10:48pm »

on Jul 15th, 2016, 7:43pm, Hans wrote:
I use msghook.dll

I'm not familiar with msghook.dll. I would be very interested to know how it compares with WMLiberty.dll; perhaps it has some advantages. Because I've not met it before msghook.dll is not on the list of DLLs (known to be) compatible with LBB. If you have ascertained that it is compatible I will update the list.

Quote:
I never meet crashes using this code.
_WM_LBUTTONDBLCLK works as expected, so does _WM_LBUTTONUP and _WM_RBUTTONUP.

That you don't have crashes, even when you intercept WM_NOTIFY messages (which you do in the code you listed) is encouraging and may suggest that you will be able to make it work, despite the probable high volume of messages.

The code you would need is something like this:

Initialisation Code:
    LVN.COLUMNCLICK = -108
    struct nmhdr, hwndFrom as ulong, idFrom as long, code as long 
 


Intercept Code:
    case _WM_NOTIFY
        nmhdr.struct = msg.lparam.struct
        if nmhdr.code.struct = LVN.COLUMNCLICK then
          ' handle columnclick here
        end if
 

Richard.
« Last Edit: Jul 16th, 2016, 09:02am by Richard Russell » User IP Logged

Hans
New Member
Image


member is offline

Avatar




PM

Gender: Male
Posts: 31
xx Re: List view: detecting columnclick
« Reply #5 on: Jul 18th, 2016, 3:01pm »

The original site of msghook does not exist anymore. But still it can be downloaded at: http://vb.mvps.org/tools/MsgHook/.

So far I don't have succes. I inserted the pieces of code you offered. The program never gets within de part of "case _WM_NOTIFY", which makes all the rest useless.

I added Code:
calldll #MsgHook, "WatchMsg", hLV as ulong, _WM_NOTIFY as long, r as boolean 

in the part "prepare callbacks", that did not help either.

Hans
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Re: List view: detecting columnclick
« Reply #6 on: Jul 18th, 2016, 9:26pm »

on Jul 18th, 2016, 3:01pm, Hans wrote:
So far I don't have success.

I know it can be made to work because I've done it successfully in BBC BASIC. In that case I used the embedded assembler to write my own custom message filter, to avoid overloading BASIC with the high volume of WM_NOTIFY messages.

So, as a last resort, my code could be ported to LBB using the 'BBC BASIC escape' feature (starting a line with an exclamation mark). Obviously the end result would be completely incompatible with LB 4, but at least you would end up with a working solution. Whether you want to go down that route is another matter!

Richard.
User IP Logged

Hans
New Member
Image


member is offline

Avatar




PM

Gender: Male
Posts: 31
xx Re: List view: detecting columnclick
« Reply #7 on: Jul 19th, 2016, 09:27am »

After repeated searching I found a piece of code on the LB forum that does the trick with WMLiberty. After my vacation I'll study it. Maybe I can find what I am doing wrong, maybe WMLiberty is just better for this.

Have a good summer
Hans
User IP Logged

SarmedNafi
Junior Member
ImageImage


member is offline

Avatar




PM


Posts: 93
xx Re: List view: detecting columnclick
« Reply #8 on: Jul 19th, 2016, 11:57am »

I will remain Waiting you Hans.

We got a red summer here.
Sarmed
« Last Edit: Jul 19th, 2016, 11:58am by SarmedNafi » User IP Logged

Hans
New Member
Image


member is offline

Avatar




PM

Gender: Male
Posts: 31
xx Re: List view: detecting columnclick
« Reply #9 on: Aug 30th, 2016, 1:20pm »

Using WMLiberty has serious drawbacks. On punishment of crashes, you can not use Wait, Confirm, Notice, Prompt, PopupMenu, Input and Input$(1) in your code. And who knows what else. On a crash you don't get a clou what happend. My code is quit large, so I don't want to get lost.
Maybe I'll try something with a translucent graphicbox placed over the header. Then I can track clicks on that graphicbox and translate that to which header is clicked.

Hans
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Re: List view: detecting columnclick
« Reply #10 on: Aug 30th, 2016, 3:00pm »

on Aug 30th, 2016, 1:20pm, Hans wrote:
Using WMLiberty has serious drawbacks. On punishment of crashes, you can not use Wait, Confirm, Notice, Prompt, PopupMenu, Input and Input$(1) in your code.

My understanding is that most, if not all, of these limitations are specific to LB 4 and don't apply to LBB. For example I'm certain that it's OK to use WAIT with WMLiberty in LBB, and my expectation would be that the rest are OK too.

Do you have evidence that any of those statements cause problems when using WMLiberty with LBB? If so I would be interested to see examples that demonstrate the problem.

The one thing I do know is bad, when using WMLiberty, is calling the Sleep API for a lengthy period (e.g. for more than a couple of milliseconds) because that will introduce an undesirable latency in handling the trapped message. This is particularly an issue if trying to intercept WM_NOTIFY messages.

Richard.
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls