How do control buttons know they've been clicked? - visual-c++

I have written an application in c++ visual studio 6 that looks for the WM_LBUTTONDOWN message to carry out a certain task. This works fine except when using a touchscreen. The Wm_lbuttondown or any other button message is not sent when the screen is touched. However, the control buttons still operate normally, so they know they are being clicked. I would like to know how the buttons detect the touch. I would like to detect when the screen is touched in a similar way to how I detect a mouse click. Is there a different WM I can use other than WM_LBUTTONDOWN?
My old version of visual studio doesn't seem to recognise WM_TOUCH so I haven't been able to try that.

Related

Android Studio detect when a switch's text is clicked

As the title says, I am trying to make something happen in my application whenever a switch's text is clicked.
How can I implement this ? A simple onClickListener only detects whenever the switch is clicked
I tried many different methods but none of them worked for me. I am a beginner

When switching Layouts in Android-studio, how to go back if there was no layout when app started? Or how to un-set a new layout?

I‘ve developed a game in Love2d (Lua), and used love-android as the tool to make it run on android-studio. The game works perfectly in Android devices, so now I’m trying to add billingclient.
My problem is, the Project created by love-android has only 1 activity (gameActivity) that extends SdlActivity. Somehow it runs the zipped game .love, but it has no layouts.
So, when I create a button so players can buy in-apps, I set a layout. But after the onClick, I cannot get rid of this button layout, because I have no layout to setContentView back. I’ve also tried to hide the billing layout with “GONE”, “INVISIBLE”, button.enable(false), but it just goes to a black screen. Since I’m new to Android Studio and still haven’t found how the game runs after the android tool is used, I’m not sure even if it is still running after I call this button. Any suggestion on how can I implement a full working button in such case?
If you need more info, I’d be happy to provide it.

Submit bug report without a mouse

I've been trying to use the IDE without resorting to a mouse and I've been quite successful so far. Except when the IDE identifies an internal problem and a red button blinks at the bottom right of the IDE. And then I need to use the mouse to click there and get to the "IDE Fatal Errors" dialog, so I can submit the bug report.
How can I get there without using a mouse?
PS: I'm on windows

Dialog on Screen Rotation on Android 4.3

I noticed a problem that seems to only occur on Android 4.3. I'm using a AlertDialog and I dismiss and show it in the onCreate function when an orientation change occurs by storing the dialog state in onSaveInstanceState().
On other versions of android (4.0.x, 4.1.x, 4.2.x, 2.3.x), this works perfectly fine. I can rotate the device multiple times and the dialog will never disappear but on Android 4.3, if I rotate the screen enough, the dialog will disappear but instantly reappear if I rotate the screen again. I noticed that everytime the dialog disappears I'd see a GL_INVALID_OPERATION error in Logcat.
I'm wondering if this is a known bug or if there are any work arounds.
After heavy testing, it appears that this is a timing glitch. I'm not too sure of what's going on in the background but I can guess from the behavior that some GL object are not ready when attempting to display the dialog cause the dialogs not to be drawn.
I found a workaround by just declaring a handler in the class and doing a post event to the handler to show the dialog. It seems to give the activity enough time to intialize everything and the problem no longer occurs.

Why does the task bar appear when I display a self-drawn modeless dialog? .. sometimes?

I have an interesting (but frustraring) problem. I have an application which uses the full screen (this is meant to simulate a third-party fullscreen POS application).
My application displays a sequence of modeless dialog boxes on top of the full screen application. It shows one, hides it, then shows the next, hides it etc. After the 3rd show, the Windows taskbar appears about 1 second later. I can't figure out why.
I've stripped my code right back to see if its something I'm doing in my OnNcActivate handler (which I use to draw my skinned window) but I don't think it is as the problem appears to be timing related. I've tried running Spy++ as well as dumping messages in m WindowProc myself and I still can't see anything odd that would give me any clues.
There are some messages with ID 0x36e in my logs but I can't find out what they are supposed to be. I've checked various message ID lists and can't find them. They shouldn't be any message IDs of my own since WM_USER doesn't start until 0x400.
I know I could get around this problem by auto-hiding the taskbar but I can't ask our customers to configure their taskbars to auto-hide to get round my problem.
Any ideas why the taskbar would appear in relation to my modeless dialog boxes?
EDIT: I completely stripped out my self-drawn GUI code and I still have the same problem. I could be wrong but it would seem that when I call ShowWindow( SW_HIDE) first, Windows tries to activate "another Window" (as it says in MSDN). I think in this case its activating the taskbar rather than the POS application. If on the other hand I open my second window before calling ShowWindow( SW_HIDE ) on the second, then it seems to behave itself.
Cheers
Sparky
Following a long discussion I come to the conclusion that DestroyWindow was not the problem. I found in the end that displaying a dialog.. clicking on the POS, then clicking back on the dialog that sometimes the taskbar would appear. I have spent an entire week trying to find reasons for all of this but to no avail. I thought that assigning the POS window as the owner would solve the problem - it didn't. In the end the solution for my problem was to determine if the taskbar is obscured completely before showing my dialog. If it is, I hide the taskbar for the duration which my dialog is displayed (set its placement to SW_HIDE) and then set it to SW_SHOW when I close my dialog. The task bar doesn't pop up and annoy people anymore. Not a fantastic solution for other peoples' applications perhaps, but perfect for our customers.

Resources