I have created a WinForm application in which, when I hit a key, it’s name (or code) is displayed on a transparent form. What I want is to make this form click-through, meaning: when I click on the form or hit a key on the keyboard, I want its name to be shown on my app but also it should work on the window behind my app’s form. For instance if I open a web browser, open my app and click on the area that the close button (x) of the browser is, the browser should close but my app should display: “Left button”. How can I do this?
Share
This VB.net article seems to accomplish what you require. Haven’t tested it, but hope it helps. Good Luck!
EDIT: This seems to only take care of the click-thru part of what you want to accomplish. For the key forwarding part, I would use
GetTopWindow()andGetNextWindow()API functions to navigate the window stack and find out the window handle that’s behind your application’s Z-order, and thenSendMessage()to forward the key press events to the window behind your app.