Solved

Create Right Click Event on Listview 's Column Header?

Posted on 2001-08-06
11
370 Views
Last Modified: 2007-12-19
Hi experts,

Can i Create Right Click Event on Listview Column Header?

How do i know if my Listview Column Header are Clicked using mouse's right click?

'Thanks.
0
Comment
Question by:Ryan Chong
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 5
11 Comments
 
LVL 28

Accepted Solution

by:
Ark earned 80 total points
ID: 6358275
0
 
LVL 52

Author Comment

by:Ryan Chong
ID: 6358399
Hi Ark,

I tried the code on link provided, but i crash my VB. It got error on Kernel.dll as:

_______________________________________________________

VB6 caused an exception c0000026H in module KERNEL32.DLL at 017f:bff88539.
Registers:
EAX=ffffffff CS=017f EIP=bff88539 EFLGS=00000213
EBX=ffffffff SS=0187 ESP=007ff948 EBP=007ffacc
ECX=ffffffff DS=0187 ESI=007ffa20 FS=0e77
EDX=bff7687a ES=0187 EDI=817c8680 GS=0000
Bytes at CS:EIP:
5f 5e 5b 8b e5 5d c2 10 00 8b 4c 24 04 56 0f b7
Stack dump:
0fc0d000 00000000 0541d864 0001001f 00000000 00000000 00000000 00000000 00000000 00000000 ffff137f ffff0000 ffffffff 00000000 00000000 00000000

______________________________________________________

So how can i overcome the problems?

Or any alternative links or codes? Comments?

Thanks.
0
 
LVL 6

Expert Comment

by:JonFish85
ID: 6358414
did you close the App via the Stop button in the VB IDE? When subclassing a window, you have to close it via the "X" button, or some other coded way... Otherwise, the Unload() code never executes, leaving windows unsure of where to send messages etc (I think, lemme know if im wrong)...
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 52

Author Comment

by:Ryan Chong
ID: 6379066
Hi JonFish85,

Sorry i'm not quite understand on what is your comment.

> did you close the App via the Stop button in the VB IDE?
So what method should i use to "Close" the window?

But before that my VB crashed before the code is successfully executed.

Any comments? Any useful links/ articles?

Thanks A Lot to ALL. : )
0
 
LVL 28

Expert Comment

by:Ark
ID: 6379177
Hi
When using subclassing, you should close program in IDE ONLY with main form [x] button. There won't be a prb when compiled.

Cheers
0
 
LVL 52

Author Comment

by:Ryan Chong
ID: 6760125
Hi Ark,

This question has been opened for a long time now (sorry about that), as got some free time to research recently i go back to this question.

As testing the code form the link you provided (VBNet) i still get the error. This time is:

"Invalid use of AddressOf" in HookWindow. I think this is a typical error. How can i figure it out?

Win2k, VB6 development environment.

Thanks a lot.
0
 
LVL 28

Expert Comment

by:Ark
ID: 6760205
"Invalid use of AddressOf" - this often occure when you place CallBack function at form/class module.
Function which you use in AddressOf operator MUST BE IN A BAS MODULE ONLY and be Public

Cheers
0
 
LVL 28

Expert Comment

by:Ark
ID: 6760207
"Invalid use of AddressOf" - this often occure when you place CallBack function at form/class module.
Function which you use in AddressOf operator MUST BE IN A BAS MODULE ONLY and be Public

Cheers
0
 
LVL 52

Author Comment

by:Ryan Chong
ID: 6760242
Hi Ark,

Although "Invalid use of AddressOf" error had been removed, but the whole running project disappear (corrupted?) from my desktop within seconds. So ..?? What may cause this happen?

Thanks
0
 
LVL 28

Expert Comment

by:Ark
ID: 6760275
Seems it's corrupted. This is subclassing behavior - when you subclass window/control, all messages come to your callback function first. But if you have an error inside function, VB try to interrupt process, while messages continue redirecting to missing(interrupting) function. This cause GPF. Check all code. Follow all instructions from VBNet (i.e. place everything they say "bas module" in bas module, "form code" - into form, name all controls same as in their code).

Cheers
0
 
LVL 52

Author Comment

by:Ryan Chong
ID: 6762904
Find the error, fixed it and finally it works!

Thanks a lot Ark :)
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question