Detecting if a coordinate on the screen is an interact-able. [closed] - c++

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
This is regarding the C/C++ language ->
Is there some kind of Windows API that checks if a given position on the screen is clickable? For example, the windows icon on the bottom left, the red X on the top right of a program, or maybe the "enter" button in a web browser's search engine.
This sounds a bit complex, but maybe through IPC there's a way to do something like this? Thanks!
EDIT: By clickable, i mean anything you can associate with / interact with.

Almost anything on screen is clickable (except things that hit-test as HTERROR, HTNOWHERE and HTTRANSPARENT).
The sane approach is to use UI Automation/MSAA. Call WindowFromPoint, ChildWindowFromPoint or RealChildWindowFromPoint to get a HWND and then call AccessibleObjectFromWindow to get a IAccessible interface and call accDoDefaultAction.
A less sane option is to use WM_NCHITTEST to figure out what the mouse is over and send some fake WM_NCLBUTTON* messages.

Related

MFC create application just show in task bar like the date widget [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 months ago.
Improve this question
I want to create an application using MFC that mainly runs in background, and show the system cpu usage on the taskbar just like the system date in the taskbar shown in the below.
Key feature is:
an icon in the taskbar;
change the words or info intervally.
How to implement this?
There are public APIs you can use to display yourself in the taskbar:
Shell_NotifyIcon to create a "tray" icon. You can update the icon as often as you want. This is what Task manager does.
Taskbar toolbar (IDeskBand). This lets you create a much larger surface in the taskbar. Currently not supported on Windows 11.

How to change the mouse cursor to something else in c++? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 1 year ago.
Improve this question
How can I change the mouse cursor to something else in c++, Windows? I mean, change the pointer to another system default, for example, the hand icon.
I don't know what code I can provide you, since I don't really have anything for the mouse. The only thing I have for the mouse, that isn't in use, is to hide it. If this helps tell you what I use or anything like that, here:
SDL_ShowCursor (SDL_DISABLE);
My c++ version isn't the newest, so that is something to note.
And hiding the mouse pointer and having a picture follow it isn't something I can do since it uses way too many resources and is slow.
Use SDL_SetCursor If you want a system cursor, you can pass the return value of SDL_CreateSystemCursor to that function. See the documentation:
https://wiki.libsdl.org/SDL_SetCursor
https://wiki.libsdl.org/SDL_CreateSystemCursor
https://web.archive.org/web/20210211163214/https://wiki.libsdl.org/SDL_CreateSystemCursor
The documentation is currently somewhat lacking. The last link refers to the archived documentation, which contains the list of possible values for SDL_CreateSystemCursor
Example:
SDL_Cursor* cursor;
cursor = SDL_CreateSystemCursor(SDL_SYSTEM_CURSOR_HAND);
SDL_SetCursor(cursor);

How to make a form in c++ from scratch without winforms? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I want to make desktop application with cpp and make a completely new form and I don't want to use winforms or any external addons just cpp.
When presenting output to screen you almost always have to call some kind of system call at some point. So the next closest thing to winforms is probably the winapi, but you could try some kind of graphical library for example sdl2 or sfml which encapsulates these calls with their own api. But you wouldn't have all these nice native windows buttons and tabviews and scrollbars and textboxes and ... only some basic shapes, images and pixel buffers

C++ MFC, Custom Grid with CheckBox, RadioButton [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I want to create Custom Grid which shall have inline edit feature, Checkbox, Radio button and Images.
I came across very good article << http://www.codeproject.com/Articles/8/MFC-Grid-control;
Here DrawFrameControl is used to draw Check box and Radio Button
I have a requirement to customize the look and feel of check box.
Is it possible to customize DrawFrameControl's or is a good idea to create custom control (check box and radio button)?
Will there be any performance issue in case of custom controls?
Regards,
Sanjay
No. You can't customize DrawFrameControl. It uses the system standard to draw the control.
If you need to customize it you have to draw the items by yourself. But using an image list it shoudn't be complicated to. Using CImageList is well documented everywhere ...

Remote program control using winapi [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
How I can remotely control a GUI program using winapi?
I need to open skype or icq and click on the right contact and then read the last message. There's a program in VS spy++, but if you want to trace window messages, you need to remotely control spy++. So the problem is how can you remotely control a program and the other thing, where can you find application codes.
The White framework hides a lot of the details of UI automation, and you may find it easier to use than raw UI Automation.