Jump to content

Ghost Interface


Adele
 Share

Recommended Posts

I'm trying to make an always on top interface showing informations on an edge of desktop. I'd like that it doesn't disturb the user, so when the user moved cursor over the transparent interface, the cursor should be detected by the bottom window like the interface never exist. Good day.

Edited by Adele
Link to comment
Share on other sites

  • Moderators

@Adele that is a great explanation of what you want. Now, how about what you have tried? There are functions in the help file for making a GUI always on top, as well as transparency. Why don't you post what you have tried on your own, and where you're stuck?

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

If you aren't kidding me, it's good to hear that I've explained good, I hadn't thought that my English was enough.

I need just help about to make detecting cursor by the bottom window when cursor was moved over the window. I know things like using gui, transparency.

Edited by Adele
Link to comment
Share on other sites

Check out 4th return array value of 

GUIGetCursorInfo

 

Edited by UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

@UEZ I've looked it, it isn't actually relevant to that I want but it has given me an idea. I will use that on smartboard (so it is used with touch panel). When a user clicked point where does the interface exist, the script will get cursor's coordinates and quickly click the actual location over bottom window hiding itself. I would want to make that without hiding quickly the interface but it isn't a badly needed. Maybe if I would use that on desktop... If someone has still idea about how can we do that please let them share.

Edited by Adele
Link to comment
Share on other sites

Something like this here?

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <WinAPIGdi.au3>

Global $hGUI = GUICreate("Ghost", 100, 50, @DesktopWidth - 100, 0, $WS_POPUP, $WS_EX_TOPMOST)
GUISetBkColor(0x808080)
Global $iLbl = GUICtrlCreateLabel("Hover me :-)", 10, 10)
GUICtrlSetColor(-1, 0xFFFFFF)
GUISetState()

AdlibRegister("HoverChk", 50)
Do
Until GUIGetMsg() = -3
AdlibUnRegister("HoverChk")
GUIDelete()


Func HoverChk()
    Local $iFadeIn = 8, $iFadeOut = 64
    Local Static $iTransparency = 255
    Local $aPos = WinGetPos($hGUI)
    If _WinAPI_PtInRectEx(MouseGetPos(0), MouseGetPos(1), $aPos[0], $aPos[1], $aPos[2] + $aPos[0] + 1, $aPos[3] + $aPos[1] + 1) Then
        If $iTransparency >= 0 Then
            $iTransparency -= $iFadeOut
            $iTransparency = $iTransparency < 0 ? 0 : $iTransparency
            WinSetTrans($hGUI, "", $iTransparency)
        EndIf
    Else
        If $iTransparency <= 255 Then
            $iTransparency += $iFadeIn
            $iTransparency = $iTransparency > 255 ? 255 : $iTransparency
            WinSetTrans($hGUI, "", $iTransparency)
        EndIf
    EndIf
EndFunc

 

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

  • 2 months later...
On 30.09.2016 at 7:42 PM, UEZ said:

Something like this here?

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <WinAPIGdi.au3>

Global $hGUI = GUICreate("Ghost", 100, 50, @DesktopWidth - 100, 0, $WS_POPUP, $WS_EX_TOPMOST)
GUISetBkColor(0x808080)
Global $iLbl = GUICtrlCreateLabel("Hover me :-)", 10, 10)
GUICtrlSetColor(-1, 0xFFFFFF)
GUISetState()

AdlibRegister("HoverChk", 50)
Do
Until GUIGetMsg() = -3
AdlibUnRegister("HoverChk")
GUIDelete()


Func HoverChk()
    Local $iFadeIn = 8, $iFadeOut = 64
    Local Static $iTransparency = 255
    Local $aPos = WinGetPos($hGUI)
    If _WinAPI_PtInRectEx(MouseGetPos(0), MouseGetPos(1), $aPos[0], $aPos[1], $aPos[2] + $aPos[0] + 1, $aPos[3] + $aPos[1] + 1) Then
        If $iTransparency >= 0 Then
            $iTransparency -= $iFadeOut
            $iTransparency = $iTransparency < 0 ? 0 : $iTransparency
            WinSetTrans($hGUI, "", $iTransparency)
        EndIf
    Else
        If $iTransparency <= 255 Then
            $iTransparency += $iFadeIn
            $iTransparency = $iTransparency > 255 ? 255 : $iTransparency
            WinSetTrans($hGUI, "", $iTransparency)
        EndIf
    EndIf
EndFunc

 

Is it possible to make it completely transparent instead of trying to hide a little?

Link to comment
Share on other sites

On 12/16/2016 at 5:50 PM, Scrappy53 said:

Is it possible to make it completely transparent instead of trying to hide a little?

I do not understand what you mean!

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

If I understand you correctly, try this:

#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <WinAPIGdi.au3>

Global $hGUI = GUICreate("Ghost", 200, 100, @DesktopWidth - 210, 10, $WS_POPUP, BitOR($WS_EX_TOPMOST, $WS_EX_TRANSPARENT))
GUISetBkColor(0x808080)
Global $iLbl = GUICtrlCreateLabel("Hover me :-)", 10, 10, 180, 80, BitOR($SS_CENTERIMAGE, $SS_CENTER))
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetFont(-1, 24)
GUISetState()

Global $iMin = 64

AdlibRegister("HoverChk", 50)
Do
Until GUIGetMsg() = -3
AdlibUnRegister("HoverChk")
GUIDelete()


Func HoverChk()
    Local $iFadeIn = 8, $iFadeOut = 64
    Local Static $iTransparency = 255
    Local $aPos = WinGetPos($hGUI)
    If _WinAPI_PtInRectEx(MouseGetPos(0), MouseGetPos(1), $aPos[0], $aPos[1], $aPos[2] + $aPos[0] + 1, $aPos[3] + $aPos[1] + 1) Then
        If $iTransparency >= $iMin Then
            $iTransparency -= $iFadeOut
            $iTransparency = ($iTransparency < $iMin) ? $iMin : $iTransparency
            WinSetTrans($hGUI, "", $iTransparency)
        EndIf
    Else
        If $iTransparency <= 255 Then
            $iTransparency += $iFadeIn
            $iTransparency = ($iTransparency > 255) ? 255 : $iTransparency
            WinSetTrans($hGUI, "", $iTransparency)
        EndIf
    EndIf
EndFunc

 

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

17 hours ago, UEZ said:

If I understand you correctly, try this:

#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <WinAPIGdi.au3>

Global $hGUI = GUICreate("Ghost", 200, 100, @DesktopWidth - 210, 10, $WS_POPUP, BitOR($WS_EX_TOPMOST, $WS_EX_TRANSPARENT))
GUISetBkColor(0x808080)
Global $iLbl = GUICtrlCreateLabel("Hover me :-)", 10, 10, 180, 80, BitOR($SS_CENTERIMAGE, $SS_CENTER))
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetFont(-1, 24)
GUISetState()

Global $iMin = 64

AdlibRegister("HoverChk", 50)
Do
Until GUIGetMsg() = -3
AdlibUnRegister("HoverChk")
GUIDelete()


Func HoverChk()
    Local $iFadeIn = 8, $iFadeOut = 64
    Local Static $iTransparency = 255
    Local $aPos = WinGetPos($hGUI)
    If _WinAPI_PtInRectEx(MouseGetPos(0), MouseGetPos(1), $aPos[0], $aPos[1], $aPos[2] + $aPos[0] + 1, $aPos[3] + $aPos[1] + 1) Then
        If $iTransparency >= $iMin Then
            $iTransparency -= $iFadeOut
            $iTransparency = ($iTransparency < $iMin) ? $iMin : $iTransparency
            WinSetTrans($hGUI, "", $iTransparency)
        EndIf
    Else
        If $iTransparency <= 255 Then
            $iTransparency += $iFadeIn
            $iTransparency = ($iTransparency > 255) ? 255 : $iTransparency
            WinSetTrans($hGUI, "", $iTransparency)
        EndIf
    EndIf
EndFunc

 

 

@EUZ Thanks again, I start to have a issue to generate a similar UI and you already have an answer, your UI magic is always welcome.

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...