Jump to content

Add a frame to the inputbox


Recommended Posts

Hello,

I have an inputbox, and Iwould like to add a frame to this inputbox. I searched on the forum, but i haven't find a solution.

I have seen many solutions to create animations in windows but no around windows.

$hGUI = GUICreate("", 140, 22, @DesktopWidth-(140+10), @DesktopHeight-(54+22+10), $WS_POPUP, $WS_EX_TOPMOST, $hTaskbar_Wnd)
$Input = GUICtrlCreateInput("", 0, 0, 140, 22)
GUICtrlSetColor($Input, 0xC0C0C0)

GUISetState(@SW_SHOW, $hGUI)

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

Thanks

Qui ose gagneWho Dares Win[left]CyberExploit[/left]

Link to comment
Share on other sites

I have an inputbox, and Iwould like to add a frame to this inputbox. I searched on the forum, but i haven't find a solution.

I have seen many solutions to create animations in windows but no around windows.

What do you mean by "frame"? Something like this?

A picture of what you're trying to accomplish would help.

$hGUI = GUICreate("", 150, 46, @DesktopWidth-(140+10), @DesktopHeight-(54+22+10), $WS_POPUP, $WS_EX_TOPMOST, $hTaskbar_Wnd)
$Group = GUICtrlCreateGroup("Frame?", 2, 0, 146, 42)
$Input = GUICtrlCreateInput("", 5, 15, 140, 22)
GUICtrlSetColor($Input, 0xC0C0C0)

GUISetState(@SW_SHOW, $hGUI)

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

[font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font]

Link to comment
Share on other sites

  • Moderators

jerem488,

Perhaps this might help?

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:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

This wont work because AutoIt waits till the InputBox has finished it's events, but you can probably do it using some other method:

#Include <WinAPI.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Constants.au3>

$GUI = GUICreate("Form1", 633, 447, 193, 125,BitOR($WS_CLIPCHILDREN,$WS_CLIPSIBLINGS,$WS_MAXIMIZEBOX,$WS_MINIMIZEBOX))
$hInput = InputBox("", "")
_WinAPI_SetWindowLong(WinGetHandle($hInput), $GWL_HWNDPARENT, $GUI)
_WinAPI_SetWindowLong(WinGetHandle($hInput), $GWL_STYLE, BitOR($WS_CLIPCHILDREN,$WS_CHILD,$WS_VISIBLE,$WS_MINIMIZEBOX,$WS_SIZEBOX ))
;~ _WinAPI_SetWindowLong(WinGetHandle("AutoIt Help"), $GWL_EXSTYLE,$WS_EX_MDICHILD)
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

Actually, I don't think that is what you want.

Edited by JamesBrooks
Link to comment
Share on other sites

Like this picture.

#include <GUIConstantsEx.au3>
#include <EditConstants.au3>
#include <WindowsConstants.au3>
#Include <WinAPI.au3>
;

$hGUI = GUICreate("", 220, 62, -1, -1, $WS_POPUP, $WS_EX_TOPMOST)
GUISetBkColor(0x004A84)

$Input = GUICtrlCreateInput("INPUTBOX", 20, 20, 180, 22, BitOR($ES_LEFT, $ES_AUTOHSCROLL, $ES_CENTER))

_GUIRoundCorners($hGUI, 2, 2, 25, 25)

GUISetState(@SW_SHOW, $hGUI)
GUIRegisterMsg($WM_NCHITTEST, "WM_NCHITTEST")

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

Func _GUIRoundCorners($hWnd, $iX1, $iY1, $iX2, $iY2)
    Local $aWPos = WinGetPos($hWnd)
    
    Local $aRet = DllCall("gdi32.dll", "long", "CreateRoundRectRgn", _
        "long", $iX1, "long", $iX1, "long", $aWPos[2], "long", $aWPos[3], "long", $iX2, "long", $iY2)
    
    If IsArray($aRet) And $aRet[0] Then _
        Return DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $hWnd, "long", $aRet[0], "int", 1)
EndFunc

Func WM_NCHITTEST($hWnd, $iMsg, $iwParam, $ilParam)
    If $hWnd <> $hGUI Or $iMsg <> $WM_NCHITTEST Then Return $GUI_RUNDEFMSG
    
    Local $iRet = _WinAPI_DefWindowProc($hWnd, $iMsg, $iwParam, $ilParam)
    If $iRet = 1 Then Return 2
    
    Return $iRet
EndFunc

 

Spoiler

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

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