how to make transparent static control clickable

Imagine there is image on the main window with objects painted on the background but they are not clickable.

Here what I'm trying to do is create invisible static controls on top of those objects and make them clickable, but I don't know how to do that. I'm still learning c++ and win32 so don't understand most of the stuff.

here I made a test program and what I was able to make so far:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
//Global variables
HWND Label1, Object1;
bool checked1;

//WndProc
case WM_CREATE: 
    Label1 = CreateWindow("STATIC", "Label1", WS_VISIBLE | WS_CHILD,
                          10,560,60,18, hwnd, NULL, NULL, NULL);
    Object1 = CreateWindow("STATIC", "", WS_VISIBLE | WS_CHILD | SS_NOTIFY,
                           395,190,85,40, hwnd, (HMENU)1, NULL, NULL);

    //ShowWindow(Object1, SW_HIDE);
break;
case WM_COMMAND:
    switch (LOWORD(wParam)) 
    {
        case 1:
            if (checked1) {
                checked1 = false;
                SetWindowText(Label1, "unclicked");
            } else {
                checked1 = true;
                SetWindowText(Label1, "clicked");
            }
    }
break;



Last edited on
Topic archived. No new replies allowed.