Jump to content

Recommended Posts

How to disable mouse klicks in

Global $edit = GUICtrlCreateEdit("", 15, 50,810,360, BitOR($ES_READONLY, $WS_VSCROLL, $ES_AUTOVSCROLL), 0)

I do not want to use 

GUICtrlSetState ( $edit, $GUI_DISABLE )

Maybe there's some sort of layering possibility? to use some kind of layer with transparent option.
I use editbox  to show info. (like console) Maybe there's better way for this instead editbox?

Edited by dersiniar
Link to post
Share on other sites

Here is simple solution using WM_KILLFOCUS

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

$GUI = GUICreate("Example", 200, 200)
$INPUT = GUICtrlCreateInput("123", 50, 50, 80, 20, BitOr($GUI_SS_DEFAULT_INPUT, $ES_READONLY))
$hINPUT = GUICtrlGetHandle($INPUT)
$INPUT2 = GUICtrlCreateInput("456", 50, 70, 80, 20)
$ok = GUICtrlCreateButton("OK", 50, 100, 80, 20)
GUISetState()

While 1
    $msg = GUIGetMsg()
    If $msg = -3 Then Exit
    If $msg = $GUI_EVENT_PRIMARYDOWN Then
        _SendMessage($hINPUT, $WM_KILLFOCUS, 0)
;       pseudocode:
;~      If _WinAPI_WindowFromPoint(MouseGetPos()) = $hINPUT Then _SendMessage($hINPUT, $WM_KILLFOCUS, 0)
    EndIf
WEnd

 

Link to post
Share on other sites
19 hours ago, Zedna said:

Here is simple solution using WM_KILLFOCUS

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

$GUI = GUICreate("Example", 200, 200)
$INPUT = GUICtrlCreateInput("123", 50, 50, 80, 20, BitOr($GUI_SS_DEFAULT_INPUT, $ES_READONLY))
$hINPUT = GUICtrlGetHandle($INPUT)
$INPUT2 = GUICtrlCreateInput("456", 50, 70, 80, 20)
$ok = GUICtrlCreateButton("OK", 50, 100, 80, 20)
GUISetState()

While 1
    $msg = GUIGetMsg()
    If $msg = -3 Then Exit
    If $msg = $GUI_EVENT_PRIMARYDOWN Then
        _SendMessage($hINPUT, $WM_KILLFOCUS, 0)
;       pseudocode:
;~      If _WinAPI_WindowFromPoint(MouseGetPos()) = $hINPUT Then _SendMessage($hINPUT, $WM_KILLFOCUS, 0)
    EndIf
WEnd

 

This does not work as needed.
My editbox will receive info from
For $i = 1 to _FileCountLines($file)
Global $url = FileReadLine($file, $i)
to show information. And it takes  about 1hr for loop. So i cant use GUIGetMsg()
Does autoit have a possibility to Layer edit box with something that has transparency so info will be visible.? 
By layering i mean, some square object, blank image etc.

Link to post
Share on other sites

Check example of _WinAPI_SetWindowSubclass.  Instead of subclassing the window, subclass the edit box and intercept $WM_LBUTTONDOWN.

If you require more help, please provide a base snippet of the code you are using so we do not have to recreate one from scratch.

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

    No registered users viewing this page.

×
×
  • Create New...