Gadget event invisibility.

BlitzMax Forums/BlitzMax Programming/Gadget event invisibility.

mk2y10(Posted 2012) [#1]
I have recently been working on a new project that works much like a screensaver, but for the desktop background. I have already been able to access the wallpaper gadgets, hide the list item view and set the window's parent as the Window's shell gadget. All this allows flawless work. The object stays in the background, and all events go to the window's shell gadget. (Right-clicking does the same as on the regular desktop.)

Now, the problem I have is the fact that a window, and only a window, placed as a child in my application window will stop events from reaching the desktop itself. I have looked for the past few days trying to find a way make a gadget 'invisible' to mouse input. I have also found a method that causes a false mouse event on any window you specify. This works fine for all gadgets, except for the desktop. (of course.) This is where I need some advice on where to look, as this project is going to have user made IAds (InterActive Desktops.)

In short, I need to make my window either be 'invisible' to mouse events, or relay a mouse event to the desktop correctly when my window receives one. The goal is to display the pop-up menu you get when you right-click on the wallpaper.

Anyone have any ideas?


col(Posted 2012) [#2]
Hiya

Assuming you're using MaxGUI, have you tried using the PostEvent command to redirect messages from your window to the desktop?


mk2y10(Posted 2012) [#3]
Hey col, i'm sorry my post was a little specific, I need to adapt it using windows API so I can use it in C++, Blitz3D, BlitzPlus and some java applets as well, i have to make it bilingual in a way lol


col(Posted 2012) [#4]
Uh huh. I understand.

What language do you have your 'working' code in so far? BMax? How are you handling the messages so far? I would think if you have the underlying hWnd handle then you can simply pass the message along using SendMessageW.

Last edited 2012


mk2y10(Posted 2012) [#5]
I tried the SendMessage command, but with no luck, either i have the wrong window handle (the gadget that takes in the keystrokes) or the desktop is not able to accept program generated message commands (which it should.) I found the desktop is layered like this:

Desktop Gadget
-Program Manager Window
---Shell Window
-----List View Window

As for gadgets and windows below that, I can not get the handles. When I send a message to the List View Window, it reacts as if I am selecting something. A message to the shell and program manager does nothing. There is either a gadget that I am not getting, or something else completely keeps track of mouse input.

I will deepen my search online, I hope a day of rest from the project will help me look at it with fresh eyes. Let's see what I can dig up.


mk2y10(Posted 2012) [#6]
I was able to find a collection of pages and put together a working solution. By using the following:

PostMessage (hWND , WM_RBUTTONDOWN , 0x02 , lParam)
PostMessage (hWND , WM_RBUTTONUP , 0x00 , lParam)

where:

>>hWND is the List View Item's handle (Not the Desktop window's handle)
>>WM Style is the second parameter.
>>A hex value for the key states. (0x02 is rightdown, 0x01 is leftdown, 0x00 is none)
>>lParam is a Int like so:

The integer is the same as as a memory structure of:

Short[0] = X value
Short[1] = Y value
(as) Int

This seems to work with any object, gadget or not, and generates a true windows event without moving the pointer and such. All the window needs to do is forward the event to the desktop. I already have a working example, and it is running right now on my laptop :)

Thanks for the help col!

Last edited 2012