Use desktop under a window?
BlitzPlus Forums/BlitzPlus Programming/Use desktop under a window?
| ||
I may be dreaming here, but is there any way to keep the desktop active (clickable, etc) underneath the active window? I really want a magnifying glass window that is full screen, so you can still open programs and stuff, but all you see is the magnified desktop centered on the mouse pointer. The process would be: 1)Capture area of desktop around mouse 2)Draw to canvas for zoom effect (like Mark's demo) only full screen & allowing you to see and click the desktop under it 3)???? 4)Profit Any chance this can be done? |
| ||
there's probably an api call you can use to simulate a mouseclick at certain coordinates - try google |
| ||
So it will do something like magnify.exe on WinXP? Steps 3 and 4 of your process look the trickiest. |
| ||
This sort-of sounds like my "Dream" of having graphics draw directly to the desktop. See this: http://www.geisswerks.com/drempels/index.html I know I made a request for it... Let's hope:) L8r, |
| ||
pantsonhead.com: Magnify that comes with windows is utter crap, Mark's sample program is friendlier and I could add to it easily. But What I really want is something that works full screen. dan_upright: I don't know anything about API calls or how they work, but this sounds like the way it would have to be done. If I could grab the desktop at specific coordinates, zoom and center that where the simulated mouse was, and send clicks to the desktop when the user clicks, it would be perfect. Right now, I can do everything but send clicks to the desktop. |
| ||
Well, I did some more research on API calls and came up with these two: mouse_event http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/userinput/mouseinput/mouseinputreference/mouseinputfunctions/mouse_event.asp and SendInput http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/WinUI/WindowsUserInterface/UserInput/KeyboardInput/KeyboardInputReference/KeyboardInputFunctions/SendInput.asp They say about mouse_event in Windows NT/2000/XP: This function has been superseded by SendInput. Which is unfortunate because I don't get what all you're supposed to give SendInput. Supposing mouse_event still works, what are the values for the flags they list? Are they listed in 0,1,2,4,8...etc order? Or should I just start guessing :S Also, it wants DWORDs and a ULONG_PTR, can Blitz handle that? SetWindowPos looks like it was a lot easier! |
| ||
whew... well, mouse_event works to simulate mouse clicks, but unfortunately I don't think you can specify where it's clicking. So I don't think you can't have it click the window behind it. If you're interested anyway: in the .decls file .lib "user32.dll" mouse_event(dwFlags%,dx%,dy%,dwData%,dwExtraInfo%):"mouse_event" And be careful hacking with this, you can hose yourself if you can't click back on the window to end the program! It simulates a mouse click once a second. You can see it plot on the little window when you click. You can also end up clicking around your desktop so BE CAREFUL! I assume no responsibility for your own goofery. title$="mouse test!" W=200 H=200 winX=(GadgetWidth(Desktop())/2)-(W/2) winY=(GadgetHeight(Desktop()) /2)-(H/2) Global window=CreateWindow(title$, winX, winY, W, H, 0, 0) Global canvas=CreateCanvas(0,0,W,H,window) SetBuffer CanvasBuffer(canvas) timer=CreateTimer(20) Color 255,255,255 Repeat e=PeekEvent() If MilliSecs()-countdown>1000 ok=True countdown=MilliSecs() count=0 EndIf If ok If count=0 Then mouse_event(2,MouseX(),MouseY(),0,0) count=count+1 If count>1 mouse_event(4,MouseX(),MouseY(),0,0) count=0 ok=False EndIf EndIf If MouseDown(1) Plot MouseX()-winX,MouseY()-winY EndIf FlipCanvas canvas WaitTimer(timer) If e=$803 Or KeyDown(1) Or Then quit=True Until quit=True |
| ||
This sort-of sounds like my "Dream" of having graphics draw directly to the desktop setbuffer desktopbuffer() |
| ||
Hey, neato. I didn't know you could do that either!w=GadgetWidth(Desktop()) h=GadgetHeight(Desktop()) SetBuffer DesktopBuffer() timer=CreateTimer(15) window=CreateWindow("EYES:Esc to quit",0,0,200,20,0,13) Repeat e=PeekEvent() drawEye(w-110,10,90) drawEye(w-210,10,90) WaitTimer(timer) Until KeyDown(1) SetGadgetShape(window,0,0,w,h) FreeGadget(window) End Function drawEye(x,y,s) Color 0,0,0 Oval x,y,s,s Color 255,255,255 Oval x+5,y+5,s-10,s-10 mx=x+(s/2) my=y+(s/2) dx=MouseX()-mx dy=MouseY()-my angle=ATan2(dy,dx) s=s/4 o=s*Sin(angle) a=s*Cos(angle) Color 0,0,0 Oval a+mx-(s/2),o+my-(s/2),s,s End Function |
| ||
Interesting... by the way, the right eye has a noticable refresh bar going across it... changing the timer to 50 instead made it run smoother, without the visible refresh. (Win2000, 1.2 GHz Athlon, voodoo3 3000) |