Jump to content

Recommended Posts

Posted

Hello

I'm trying to put a gui with an edit box containing some text on top of another window - this was easy with WinSetOnTop()

The window (right now) is just an edit box, showing me some useful information.

What I want to do is show the text only -- is that possible? I tried with WinSetTrans() but then the whole window became invisible(including text).

I want the text to remain visible - no window.

Any help or ideas appreciated a lot.

Thanks

  • Moderators
Posted (edited)

JohnMcTon,

Welcome to the AutoIt forum. :)

This might well be what you want:

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <WINAPI.au3>
#include <SendMessage.au3>

Global Const $SC_DRAGMOVE = 0xF012

HotKeySet("{ESC}", "_Exit")

$hGUI = GUICreate("Test", 200, 200, -1, -1, $WS_POPUP, $WS_EX_LAYERED)
GUISetBkColor(0xABCDEF)

GUICtrlCreateLabel("Click on the text to drag this transparent GUI" & @CRLF & "Press ESC to exit", 10, 10)

_WinAPI_SetLayeredWindowAttributes($hGUI, 0xABCDEF, 250)

GUISetState()

While 1
    Switch GUIGetMsg()
       Case $GUI_EVENT_PRIMARYDOWN
            _SendMessage($hGUI, $WM_SYSCOMMAND, $SC_DRAGMOVE, 0)
    EndSwitch
WEnd

Func _Exit()
    Exit
EndFunc

Any use? :huh:

M23

Edited by Melba23
Added {} to HotKey declaration

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

  Reveal hidden contents

 

  • Moderators
Posted

Gotemp,

Would you care to enlighten us about the mistake you found in that script? :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

  Reveal hidden contents

 

Posted (edited)

No braces around ESC on your HotKey?

Edited by boththose

  Reveal hidden contents

  • Moderators
Posted

boththose,

Good spot! :thumbsup:

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

  Reveal hidden contents

 

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
  • Recently Browsing   0 members

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