Results 1 to 3 of 3

Thread: how to make a button click using API's?

  1. #1

    Thread Starter
    Lively Member Nerd-Man's Avatar
    Join Date
    Dec 2006
    Location
    India
    Posts
    119

    Arrow how to make a button click using API's?

    hi everybody, i am just trying to play with API's. however i dont have any knowledge about them. but i want to learn. so what i want to do is i want to make a OK button click of a another application from my program. i have downloaded pator jks api spy 51 that let me see the name of the window and the button. but i dont know how to make them click or do anything on the window.
    Forgive me if I make mistakes because you know I wear really thick glass and I cannot see things well.

  2. #2
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,710

    Re: how to make a button click using API's?

    You need to use FindWindow to get the main forms window handle. Then use FindWindowEx to drill down the window heirarchy structure to the desired control. Once you have its handle then you can use SendMessage or PostMessage passing the BM_CLICK window message.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  3. #3

    Thread Starter
    Lively Member Nerd-Man's Avatar
    Join Date
    Dec 2006
    Location
    India
    Posts
    119

    Re: how to make a button click using API's?

    thanks, let me try and if i get any problem, then i will post here back.
    Forgive me if I make mistakes because you know I wear really thick glass and I cannot see things well.

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