• 0

[VB.NET] Monitor Window events


Question

Hello gang,

I need to be able to get the following events from ALL windows:

Load/Unload, Get/Lose focus

I need to be able to get the window information of applications that load, and when they unload as well as when an application gets focus.

I was looking into the Messaging namespace... but that SEEMS to involve MSMQ. There has to be a way to recieve window messages.... right?

Thanks for any help.

Link to comment
https://www.neowin.net/forum/topic/471976-vbnet-monitor-window-events/
Share on other sites

7 answers to this question

Recommended Posts

  • 0

>.keywords: message hook. You'll need to write some C for that tho.

Really? It's my understanding that the System.Messaging namespace will provide me with the functions I need. I'm reading the docs now... and I may be wrong...

In either case, thanks for the info.

  • 0
  Quote
The System.Messaging namespace provides classes that allow you to connect to, monitor, and administer message queues on the network and send, receive, or peek messages.

The docs say the namespace is used for network message queueing, not for windowmanager message interception/monitoring. I'm no .NET guru at all tho, more a win32 guy.

  • 0

>>The docs say the namespace is used for network message queueing, not for windowmanager message interception/monitoring. I'm no .NET guru at all tho, more a win32 guy.

Andreas,

yea, Ive been finding that out in the past few hours. Im surprised how difficult it is to find information on this process. Spy++ is showing tons of good info... now if I could tap into that data stream.

But I have started looking into hooks... thank you very much again.

  • 0

To narrow your search down a little, you're wanting to create a CBT hook. It actually isn't too hard to do in VB.NET but I don't remember if the one I wrote was global. If I get a chance I'll see if I can get you some sample code that I wrote a long time ago... If I still have it.

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • Saw this on Twitter/X. Can't imagine the emotional rollercoaster going on inside of her head.
    • It's telling how brainwashed  and triggered you are that you immediately think it's because he was MAGA.    There's tons of things he's done throughout his wrestling career alone that wrestling fans right wing/ or left wing have problems with.  Not to mention his personal life. 
    • UK enforces strict new online age checks today by Paul Hill As of today, July 25, 2025, new Ofcom regulations mandate that “highly effective” age checks are in place for online services. These new rules apply to any websites or platforms that host pornography, self-harm, suicide, or eating disorder content. Major platforms like Pornhub, Bluesky, Discord, Grindr, Reddit, and X have committed to implementing age-gating. These age checks are part of the broader Online Safety Act, which is designed to make the internet safer, particularly for kids. These measures move away from just confirming you’re 18 by clicking a button to having to actually verify your age with ID or a face scan, but this move is not without its critics. Starting today, Ofcom will actively check compliance with the new rules and start launching investigations into non-compliant services, starting next week. The current enforcement program that’s focused on studio porn services is extending to all platforms allowing user-shared pornographic material, not just those websites dedicated to that. Ofcom is also launching another enforcement program that will target websites specifically dedicated to harmful content like self-harm, suicide, eating disorders, and extreme violence/gore. Ofcom has strong enforcement powers under the Online Safety Act, it can dish out fines of up to 10% of qualifying worldwide revenue or £18 million. For the worst offenders, Ofcom can even get websites blocked in the UK. Ofcom is already investigating 11 companies that it doesn’t think are following the rules. Aside from age checks, Ofcom’s Codes also require websites to protect children from dangerous stunts, misogynistic, violent, hateful, or abusive material, and online bullying. Algorithms of social media will need to be configured to block harmful content in children’s feeds, for example. Ofcom will be launching an extensive monitoring program requiring risk assessments by August 7 and practical action disclosures by September 30. While some have criticized the Online Safety Act, research cited by Ofcom shows that 71% of UK parents think the changes will positively impact children’s online safety, with 77% being optimistic about the age checks specifically. With that said, a significant minority of parents (41%) are skeptical about whether tech firms will follow the rules. Source: Ofcom | Image via Depositphotos.com
    • Microsoft has known to toggle settings in Windows Updates.
    • Another Linux utility is being rewritten in Rust by David Uzondu Greenboot, the health check tool originally written in bash, is getting a rewrite in Rust, courtesy of engineers at Red Hat. This useful tool started in mid‑2018 as a Google Summer of Code project for Fedora IoT, designed to keep atomically updated systems from self-destructing after a bad update. At its heart, Greenboot is a framework that hooks into systemd to run health checks every time a machine boots. It looks for scripts in specific directories; anything in /etc/greenboot/check/required.d/ absolutely must pass. If a required script fails, Greenboot triggers a reboot to retry. After a few failed attempts, it executes scripts in /etc/greenboot/red.d/ and initiates a system rollback to the last known-good deployment, preventing an update from bricking your system. When all required checks succeed, it runs scripts from /etc/greenboot/green.d/ and marks the boot as successful by setting a GRUB environment variable. This whole process is kicked off by the greenboot-healthcheck.service before systemd's normal boot-complete.target is reached. As for why Red Hat is choosing this rewrite, it comes down to creating a more robust and secure utility. This is definitely not the only *-rs tool rewrite we have seen lately; you have probably heard about sudo-rs, which is a project to build a memory-safe replacement for the classic sudo utility. Building these fundamental system components in a memory-safe language like Rust helps eliminate entire categories of security vulnerabilities. According to the official Fedora change proposal, the rewrite expands support for both bootc and rpm-ostree based systems, whereas the original Bash version was built only for rpm-ostree. Red Hat developers have submitted a proposal to ship this new Rust version in Fedora 43. According to Phoronix, while the plan still needs a final vote from the Fedora Engineering and Steering Committee, it looks very likely to be approved. For current Fedora IoT users, the change promises to be a simple, seamless upgrade.
  • Recent Achievements

    • Very Popular
      d4l3d earned a badge
      Very Popular
    • Dedicated
      Stephen Leibowitz earned a badge
      Dedicated
    • Dedicated
      Snake Doc earned a badge
      Dedicated
    • One Month Later
      Philsl earned a badge
      One Month Later
    • One Month Later
      armandointerior640 earned a badge
      One Month Later
  • Popular Contributors

    1. 1
      +primortal
      625
    2. 2
      ATLien_0
      240
    3. 3
      Xenon
      163
    4. 4
      +FloatingFatMan
      124
    5. 5
      neufuse
      123
  • Tell a friend

    Love Neowin? Tell a friend!