Log buttons clicked and other user activity?-VBForums
Results 1 to 6 of 6

Thread: Log buttons clicked and other user activity?

  1. #1

    Thread Starter
    Member
    Join Date
    Jul 2006
    Posts
    51

    Question Log buttons clicked and other user activity?

    Is there a way to log all the buttons clicked on any form in my application from a central place (in the same application)?

    I have a very big application so adding code to each button click will be a very big task.
    If I can have an API function to log all button clicks on all forms, logging button name, form, etc it will help a lot.

    Does anyone have any ideas?
    Maybe API calls are not even needed?


  2. #2
    Frenzied Member Zvoni's Avatar
    Join Date
    Sep 2012
    Location
    To the moon and then left
    Posts
    1,079

    Re: Log buttons clicked and other user activity?

    You would have to subclass each of your forms, and then catch the corresponding WM_LBUTTONUP-Messages
    People call me crazy because i'm jumping out of perfectly fine airplanes.
    I say you're crazy not to!
    --------------------------------------------------------------------------------------------------
    For health reasons i try to avoid reading unformatted Code

  3. #3

    Thread Starter
    Member
    Join Date
    Jul 2006
    Posts
    51

    Re: Log buttons clicked and other user activity?

    Thanks for the reply.
    Can you give me a bit more info please?
    Maybe a small example?

  4. #4
    Frenzied Member Zvoni's Avatar
    Join Date
    Sep 2012
    Location
    To the moon and then left
    Posts
    1,079

    Re: Log buttons clicked and other user activity?

    Subclassing is pretty advanced stuff, but there are good tutorials on the net. Just have a look at google with " visual basic windows subclassing"
    People call me crazy because i'm jumping out of perfectly fine airplanes.
    I say you're crazy not to!
    --------------------------------------------------------------------------------------------------
    For health reasons i try to avoid reading unformatted Code

  5. #5
    Default Member Bonnie West's Avatar
    Join Date
    Jun 2012
    Location
    InIDE
    Posts
    4,057

    Re: Log buttons clicked and other user activity?

    Here is a small example of what Zvoni was talking about. The subclassing code here uses the BN_CLICKED notification code instead of the WM_LBUTTONUP message so that only a few controls will need to be subclassed.


    Name:  ButtonLogger.png
Views: 452
Size:  16.0 KB
    Attached Files Attached Files
    Last edited by Bonnie West; Jan 2nd, 2014 at 10:41 AM.
    On Local Error Resume Next: If Not Empty Is Nothing Then Do While Null: ReDim i(True To False) As Currency: Loop: Else Debug.Assert CCur(CLng(CInt(CBool(False Imp True Xor False Eqv True)))): Stop: On Local Error GoTo 0
    Declare Sub CrashVB Lib "msvbvm60" (Optional DontPassMe As Any)

  6. #6

    Thread Starter
    Member
    Join Date
    Jul 2006
    Posts
    51

    Re: Log buttons clicked and other user activity?

    Yeah!!!

    That's what I'm talking about!

    Thanks a lot guys!!

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.