質問

I'm pretty new to programming and I wanted to create a new project. I have something in mind, but before I start learning how to program it, I need to know something.

I want the program to be able to stay on the foreground, so it always visible when active, but I want it to be only clickable when a certain key-combo (or something like it) is entered.

So it stays visible, but not clickable unless a specific key is tapped, when you go back to the other program (for example while watching a movie) it becomes unclickable again.

Is this possible? And if so, what language you advise me to start this project in?

EDIT: let's say only Windows for now, can I use java for this? How do I approach this problem?

役に立ちましたか?

解決

My C++/Win32 API approach:

The "not clickable" part: just throw away any messages your application receives prior to whatever key combination you're looking for has been pressed. The trickier part is if you want a message aimed at your window to pass through and go to the window behind yours - you would first obtain the HWND of the window behind, and then use the SendMessage function to forward all unwanted messages to that window.

The "stays at the top" part is even easier. Use the extended window style WS_EX_TOPMOST in your call to CreateWindowEx and it'll stay at the top no matter what.

Here's a good Win32 API tutorial if I made your brain explode.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top