❔ rendering windows forms over another window

hello : ) my goal is to make a checklist application that can be rendered over other windows so you the other window does not loose focus in c#. can you give me some advice on how I should execute/render my forms so they are rendered over a different window so you can click buttons and press key in the window of your choice and my own form gui at the same time?
18 Replies
Pobiega
Pobiega9mo ago
you want an overlay. There are ways to render overlays in C#. Give it a google and you should be fine
【7Focus】
thanks for the tip
WEIRD FLEX
WEIRD FLEX9mo ago
like the topmost style or drawing on the hdc 0 (the "butcher solution")
【7Focus】
I got the overlay working thanks next step would be a key logger
Pobiega
Pobiega9mo ago
A key logger you say? Why would you need a key logger?
【7Focus】
because I want to catch the user input for hotkeys Im making a checklist that is drawn over other apps and you should be able to navigate threw your checklist using your keyboard without moving the mouse away from the app youre using maybe you can name it a key "event handler" or something
Pobiega
Pobiega9mo ago
You want a global input hook/listener Calling it a keylogger is an excellent way to get banned
Will
Will9mo ago
there are libraries to do this, or you could look up RegisterHotkey (pinvoke method), but i could see an issue with this, if you use the arrow keys or something then those keys will be simply eaten by your program and you'd have to unregister the hotkeys to allow user input to whatever program again
Will
Will9mo ago
global keyboard inputs are usually more complex key sequences that involve multiple modifiers so other programs don't conflict
Pobiega
Pobiega9mo ago
Yeah you can either "consume" the key or not
Will
Will9mo ago
either way it might result in strange behaviour
Pobiega
Pobiega9mo ago
Yup
【7Focus】
I dont have a problem with "consuming" it maybe I would change it in the future idk going to try it out
Will
Will9mo ago
alright then, these are two of the libraries i was talking about, they should be pretty similar https://github.com/thomaslevesque/NHotkey https://github.com/TolikPylypchuk/SharpHook or you can implement it manually yourself via RegisterHotKey, it's not too much code
【7Focus】
got it working thanks a lot
Accord
Accord9mo ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server
More Posts