Solved

Getting active application by mouse click

Posted on 2006-11-28
6
199 Views
Last Modified: 2010-04-23
Ok, how about this.....is there a way to capture the application by way of a mouse click event?

So when a user clicks on a application (say Notepad) and then clicks on a button in a Vb.net 2003 program which will display what application they selected.  

0
Comment
Question by:TechMonster
  • 3
  • 2
6 Comments
 
LVL 16

Expert Comment

by:Hillwaaa
Comment Utility
Hi TechMonster,

What are you trying to acheive?  There are ways to get references to other applications like Notepad, using functions from the win32 api, however they are pretty tricky to use...

Cheers,
Hillwaaa
0
 
LVL 85

Expert Comment

by:Mike Tomlinson
Comment Utility
Take a look at my approach here:
http://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/VB_Controls/Q_21567355.html#14929000

It allows you to initiate a drag from your app and it identifies the hWnd of the control where the drop is made.  Then you can figure out the window that owns that control from there.

This is accomplished via the SetCapture() API.

If you think this is workable then I can see about converting the code to VB.Net.  It will be shorter than the solution VB6 since some of that code required APIs that are now encapsulated by the .Net framework.
0
 

Author Comment

by:TechMonster
Comment Utility
The setCapture may work.  I am not 100% sure i understand how to use but it may be heading me in the right direction.
0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
LVL 85

Expert Comment

by:Mike Tomlinson
Comment Utility
I'll work out a sample project to demonstrate it...
0
 
LVL 85

Accepted Solution

by:
Mike Tomlinson earned 500 total points
Comment Utility
0
 

Author Comment

by:TechMonster
Comment Utility
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

771 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now