So as of now, I've managed to successfully get the x and y coordinates.
Inside the panel code.
POINT cursorPos;
GetCursorPos(&cursorPos);
int x;
int y;
x = cursorPos.x;
y = cursorPos.y;
cout << x << endl;
cout << y << endl;
However, the x and y coordinate that I got is global, aka, not within a panel that I want to get my coordinates from.
I do understand that ClientToScreen is required to change the x and y coordinate to its relative placing, but how do i do that in C++/CLR?
Because ClientToScreen requires a handle, which is not introduced in C++/CLR (Pardon me if im wrong about this point). Thanks :)
Update: I tried casting my panel into a hwnd, but still its not working.
HWND hwnd = static_cast<hwnd>(this->panel1->Handle.ToPointer());