Jump to content

how do I show the gui over the mouse


Draygoes
 Share

Recommended Posts

Hi all.

Im starting a new screen saver and im using gui creation mixed with avi creation to do it. I havent gone far in the script but I would like to tackle a fresh problem in the begining so that it doesnt show up later and bite me. I would like to hide the curser while the script is running and show the curser again when the script exits.

heres my code:

#include<GUIConstants.au3>
$mainsaver = GUICreate("",@DesktopWidth,@DesktopHeight,0,0,$WS_POPUP)
GUISetBkColor (0x000000)
HotKeySet("{ESC}", "Terminate")
GuiSetState() 
While 1 
    $msg = GuiGetMsg() 
    Select 
    Case $msg = $GUI_EVENT_CLOSE 
        ExitLoop 
        
    EndSelect
WEnd
Exit

Func Terminate()
    Exit 0
EndFunc

Could someone plz help?

p.s.

I probably wouldnt know where in the script to insert the code, so if someone could show me, I would be greatful.

thx

Spoiler

 

"If a vegetarian eats vegetables,What the heck does a humanitarian eat?"

"I hear voices in my head, but I ignore them and continue on killing."

"You have forced me to raise the indifference warning to beige, it's a beige alert people. As with all beige alerts please prepare to think about the possibility of caring."

An optimist says that giving someone power DOESN'T immediately turn them into a sadist. A pessimist says that giving someone power doesn't IMMEDIATELY turn them into a sadist.

 

 
Link to comment
Share on other sites

There's a very easy way to do this using GUISetCursor. I've also included another way using DllCall, which you probably won't need.

#include <GUIConstants.au3>

$gui = GUICreate('', 200, 200)

; Method 1: Hides the cursor in client area
; Uncomment following line for example
; GUISetCursor(16, 1)

; Method 2: Hides cursor for entire window (even the titlebar)
; Uncomment following line for example
; DllCall('user32.dll', 'int', 'ShowCursor', 'int', 0)

GUICtrlCreateLabel('Your mouse will disappear when over this window. Press Escape while this window is focussed to exit.', 0, 0, 200, 200)
GUISetState()

While 1
    $gm = GUIGetMsg()
    Switch $gm
        Case $GUI_EVENT_CLOSE
            ExitLoop
    EndSwitch
WEndoÝ÷ ج¶éÜ¢i×¢¶«¶zØ^v'ßz·§qà%²î²×è®HÈZ½æ¥¢¶Øb°wöƧ¢Ø^®g­h~f¤x~ée±ÊÞz|"Ú0jëh×6#include <GUIConstants.au3>

GUICreate('Fullscreen', 1, 1, Default, Default, BitOr($WS_POPUP, $WS_MAXIMIZE))
; Yes it's only 1x1. Just try it, you'll see.
GUISetState()

Sleep(3000)
Link to comment
Share on other sites

Thank you very much!!! This is ausom!

Just one more question? Sence its going to be a screen saver, its going to need to be able to close when the user moves the mouse. Is there a code to make that work?

Spoiler

 

"If a vegetarian eats vegetables,What the heck does a humanitarian eat?"

"I hear voices in my head, but I ignore them and continue on killing."

"You have forced me to raise the indifference warning to beige, it's a beige alert people. As with all beige alerts please prepare to think about the possibility of caring."

An optimist says that giving someone power DOESN'T immediately turn them into a sadist. A pessimist says that giving someone power doesn't IMMEDIATELY turn them into a sadist.

 

 
Link to comment
Share on other sites

Thank you very much!!! This is ausom!

Just one more question? Sence its going to be a screen saver, its going to need to be able to close when the user moves the mouse. Is there a code to make that work?

If you haven't already seen them have a look at lokster's screen savers in Example scripts. They're really good and it will show you how it's all done.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...