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
    PowerPoster Zvoni's Avatar
    Join Date
    Sep 2012
    Location
    To the moon and then left
    Posts
    2,511

    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
    One System to rule them all, One IDE to find them,
    One Code to bring them all, and to the Framework bind them,
    in the Land of Redmond, where the Windows lie
    ---------------------------------------------------------------------------------
    People call me crazy because i'm jumping out of perfectly fine airplanes.
    ---------------------------------------------------------------------------------
    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
    PowerPoster Zvoni's Avatar
    Join Date
    Sep 2012
    Location
    To the moon and then left
    Posts
    2,511

    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"
    One System to rule them all, One IDE to find them,
    One Code to bring them all, and to the Framework bind them,
    in the Land of Redmond, where the Windows lie
    ---------------------------------------------------------------------------------
    People call me crazy because i'm jumping out of perfectly fine airplanes.
    ---------------------------------------------------------------------------------
    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,060

    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: 841
Size:  16.0 KB
    Attached Files Attached Files
    Last edited by Bonnie West; Jan 2nd, 2014 at 11: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
  •  



Click Here to Expand Forum to Full Width