Search the Community
Showing results for tags 'ctrl'.
-
Hello Dear Sirs, I have a question please About UPDown ctrl Where I want to adjust its format For example, I want to create a window to set the clock like the window in the system Can this be done? here's the example ______ #include <WindowsConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <UpDownConstants.au3> goto() func Goto() local $wGoto = GUICreate("go to spissific position", 250, 180, @DesktopWidth / 2 - 192, @DesktopHeight / 2 - 235, -1) GUICtrlCreateLabel("please write a corect position to go to it", 50, 10, 220, 20) GUICtrlCreateLabel("hours", 0, 80, 100, 30) local $Inp1 = GUICtrlCreateInput("00", 0, 90, 100, 20, $ES_NUMBER + $WS_TABSTOP) GUICtrlCreateUpdown($Inp1, $UDS_ARROWKEYS) GUICtrlSetLimit(-1, 23, 0) GUICtrlCreateLabel("minuts", 110, 80, 100, 30) local $Inp2 = GUICtrlCreateInput("00", 110, 90, 100, 20, $ES_NUMBER + $WS_TABSTOP) GUICtrlCreateUpdown($Inp2, $UDS_ARROWKEYS) GUICtrlSetLimit(-1, 60, 0) GUICtrlCreateLabel("seconds", 220, 80, 100, 30) local $Inp3 = GUICtrlCreateInput("00", 220, 90, 100, 20, $ES_NUMBER + $WS_TABSTOP) GUICtrlCreateUpdown($Inp3, $UDS_ARROWKEYS) GUICtrlSetLimit(-1, 60, 0) local $Ok = GUICtrlCreateButton("&ok", 0, 150, 50, 30, 0x01) local $cancel = GUICtrlCreateButton("&cancel", 200, 150, 50, 30) GUISetState(@sw_show, $WgoTo) while 1 switch GUIGetMSG() case $GUI_Event_Close, $cancel exit case $OK local $read1 = GUICtrlRead($inp1) if $read1 >= 1 then $Read1 = ($Read1*60)*60 local $read2 = GUICtrlRead($inp2) if $read2 >= 1 then $Read2 = $Read2*60 local $read3 = GUICtrlRead($inp3) GUIDelete($WgoTo) Return $read1+$read2+$read3 exit endSwitch Wend EndFunc ________ What I need is to be the contents of the inputs as follows when i change the value of the UPDown CTRL 00 01 02 03 ...
-
This is what I'm trying to do: In Firefox, if you hold down CTRL + C for about 200ms, then press CTRL + T. This is my code: While WinActive(" - Mozilla Firefox") If _IsPressed("A2", $hDLL) And _IsPressed("43", $hDLL) Then $timer = TimerInit() While _IsPressed("A2", $hDLL) And _IsPressed("43", $hDLL) Sleep(10) $diff = TimerDiff($timer) If $diff > 200 Then Send("^{T}") While _IsPressed("A2", $hDLL) And _IsPressed("43", $hDLL) Sleep(10) WEnd EndIf WEnd EndIf WEnd The problem is that the CTRL key gets stuck down after Send("^{T}"). I found this, but what I understand that happens when I release, and that is not what I want. The "General unstuck method" did nothing.
-
This is my function to put round brackets "()" around a selected text: HotKeySet("^+9", "Encl") While 1 Sleep(10000) WEnd Func Encl() ClipPut("") Send( "^x" ) Sleep(200) local $ClipEncl = ClipGet() Switch @HotKeyPressed Case "^+9" $ClipEncl = '(' & $ClipEncl & ')' EndSwitch ClipPut($ClipEncl ) Send("^v") EndFunc The problem is that many times the ctrl or shift or ctrl-shift key is stuck after I invoke the above hotkey and I have to push the ctrl, shift or both keys again to be able to use these as before. Does anyone know what I did wrong in this function?
-
I want that the Listview acts as CTRL key was pressed by default to avoid any deletion when the listview was clicked. Here an example code: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <GUIListView.au3> $hGUI = GUICreate("ListView Test", 400, 550) $iLV = GUICtrlCreateListView("", 0, 10, 400, 480, $LVS_SHOWSELALWAYS, BitOR($LVS_EX_FLATSB, $LVS_EX_CHECKBOXES, $LVS_EX_FULLROWSELECT, $LVS_EX_DOUBLEBUFFER)) _GUICtrlListView_AddColumn($iLV, "Date", 100, 1) _GUICtrlListView_AddColumn($iLV, "Size (bytes)", 100, 1) _GUICtrlListView_AddColumn($iLV, "File Name", 100, 1) For $i = 0 to 150 _GUICtrlListView_AddItem($iLV, "Row " & $i) _GUICtrlListView_AddSubItem($iLV, $i, $i * 2, 1) _GUICtrlListView_AddSubItem($iLV, $i, $i * 4, 2) Next $cButton = GUICtrlCreateButton("Reset", 10, 510, 80, 30) GUISetState() _GUICtrlListView_SetItemChecked($iLV, 0) _GUICtrlListView_SetItemSelected($iLV, 0) _GUICtrlListView_SetItemChecked($iLV, 1) _GUICtrlListView_SetItemSelected($iLV, 1) _GUICtrlListView_SetItemChecked($iLV, 2) _GUICtrlListView_SetItemSelected($iLV, 2) ControlFocus($hGUI, "", $iLV) ; Create array to hold selection state Global $aSelected[_GUICtrlListView_GetItemCount($iLV)] GUIRegisterMsg($WM_NOTIFY, "_WM_NOTIFY") While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $cButton ; Clear all selections _GUICtrlListView_SetItemSelected($iLV, -1, False) ; Clear selected array Global $aSelected[_GUICtrlListView_GetItemCount($iLV)] EndSwitch WEnd Func _WM_NOTIFY($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg, $wParam ; Struct = $tagNMHDR and "int Item;int SubItem" from $tagNMLISTVIEW Local $tStruct = DllStructCreate("hwnd;uint_ptr;int_ptr;int;int", $lParam) If @error Then Return Local $tNMHDR = DllStructCreate($tagNMHDR, $lParam) Local $hWndFrom = HWnd($tNMHDR.hWndFrom) Local $iIDFrom = $tNMHDR.IDFrom Local $iCode = $tNMHDR.Code Local Static $iCount = 0 Local $tInfo = DllStructCreate($tagNMLISTVIEW, $lParam) Switch $iCode Case $LVN_ITEMCHANGED If BitAND($tInfo.Changed, $LVIF_STATE) = $LVIF_STATE Then Switch $tInfo.NewState Case 8192 ;item checked _GUICtrlListView_SetItemSelected($iLV, $tInfo.Item, True) Case 4096 ;item unchecked _GUICtrlListView_SetItemSelected($iLV, $tInfo.Item, False) EndSwitch EndIf Case $NM_CLICK $tInfo = DllStructCreate($tagNMITEMACTIVATE, $lParam) ;~ _DebugPrint("$NM_CLICK" & @CRLF & "--> hWndFrom:" & @TAB & $hWndFrom & @CRLF & _ ;~ "-->IDFrom:" & @TAB & $iIDFrom & @CRLF & _ ;~ "-->Code:" & @TAB & $iCode & @CRLF & _ ;~ "-->Index:" & @TAB & $tInfo.Index & @CRLF & _ ;~ "-->SubItem:" & @TAB & $tInfo.SubItem & @CRLF & _ ;~ "-->NewState:" & @TAB & $tInfo.NewState & @CRLF & _ ;~ "-->OldState:" & @TAB & $tInfo.OldState & @CRLF & _ ;~ "-->Changed:" & @TAB & $tInfo.Changed & @CRLF & _ ;~ "-->ActionX:" & @TAB & $tInfo.ActionX & @CRLF & _ ;~ "-->ActionY:" & @TAB & $tInfo.ActionY & @CRLF & _ ;~ "-->lParam:" & @TAB & $tInfo.lParam & @CRLF & _ ;~ "-->KeyFlags:" & @TAB & $tInfo.KeyFlags) _GUICtrlListView_SetItemChecked($iLV, $tInfo.Index, _GUICtrlListView_GetItemState($iLV, $tInfo.Index, $LVIS_SELECTED)) EndSwitch Return $__LISTVIEWCONSTANT_GUI_RUNDEFMSG EndFunc Func _DebugPrint($s_Text , $sLine = @ScriptLineNumber) ConsoleWrite( _ "!===========================================================" & @CRLF & _ "+======================================================" & @CRLF & _ "-->Line(" & StringFormat("%04d", $sLine) & "):" & @TAB & $s_Text & @CRLF & _ "+======================================================" & @CRLF) EndFunc ;==>_DebugPrint Just cklick the listview and you will see that the selection is deleted. Repeat it and hold the CTRL key pressed. Any ideas? I don't want to read the listview and check whether the checkbox is checked and mark the row appropriately! It's lagging... Thanks, UEZ
-
For example my GUICtrlCreateEdit() contains: Line 1 Line 2 Line 3 When I IniWrite() the content of it, the value will be look like this: [SectionName] Key=Line 1 Line 2 Line 3 But when I IniRead() that key like this: GUICtrlCreateEdit(IniRead(@ScriptDir & "/data.ini", "SectionName", "Key", ""), 1, 1, 200, 100) The value of the GUI edit field is only "Line 1".. How can I INI write and read a text with line breaks in a GUICtrlCreateEdit() ?
-
Hi, Is it possible to get the GUI size when all controls are visible ? For example this would be 800x400 if a ctrl is out of the GUI positioned at 700px with a width of 100px from a 400x400 GUI. Another one: the GUI would resize in order to show every control, so to the most [left,top,]right,bottom controls. Thanks for anyhelp. Br, FireFox.
-
Hi, I was wondering why there is no panel control in autoit, this can be useful for moving/hidding more than one control at time. I have made some searches and I found nothing on it so I decided to create an UDF on it. In order to do that, It creates child GUIs and you can manage it as real controls (coord mode based on the parent GUI and not on the screen), so I have made it to be really easy in use like any other ctrl. Preview : Example : #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> #include "GUIPanel_UDF.au3" Opt("GUIOnEventMode", 1) Global $sLogo4imgPath = @ProgramFilesDir & "\AutoIt3\Examples\GUI\logo4.gif" Global $iPanel1step = 0, $iPanel3step = 0 #region GUI $GUI = GUICreate("GUIPanel UDF - Example", 400, 350) GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit") GUICtrlCreateLabel("Label on the GUI", 300, 320) #region Panel1 $hPanel1 = _GUICtrlPanel_Create($GUI, "Coords", 10, 40, 200, 50) _GUICtrlPanel_SetBackground($hPanel1, 0xFF0000) GUICtrlCreateLabel("Label on the Panel1", 5, 5, 95, 13) $btnPanel1 = GUICtrlCreateButton("Swap with Panel4", 10, 20, 100, 22) GUICtrlSetOnEvent($btnPanel1, "_Panel1_BtnEvent") #endregion Panel1 #region Panel2 $hPanel2 = _GUICtrlPanel_Create($GUI, "BottomLeft", 0, 0, 200, 100, $WS_BORDER, @SW_SHOWNA, 0x00FF00) GUICtrlCreateLabel("Label on the Panel2", 5, 5, 95, 13) #region Panel2Sub $hPanel2Sub = _GUICtrlPanel_Create($hPanel2, "CenterRight", 0, 0, 120, 30, $WS_BORDER, @SW_SHOWNA) Global $aGUIPanelExample_Panel2SubPos = _GUICtrlPanel_GetPos($hPanel2Sub) GUICtrlCreateLabel("Pos (X, Y) : " & $aGUIPanelExample_Panel2SubPos[0] & ", " & $aGUIPanelExample_Panel2SubPos[1], 5, 8, 100, 13) #endregion #endregion Panel2 #region Panel3 $hPanel3 = _GUICtrlPanel_Create($GUI, "Centered", 0, 0, 169, 68, $WS_BORDER, @SW_SHOWNA, $sLogo4imgPath) $btnPanel3 = GUICtrlCreateButton("Move me", 10, 10, 70, 22) GUICtrlSetOnEvent($btnPanel3, "_Panel3_BtnEvent") GUICtrlCreateCheckbox("no event", 70, 55, 68, 13) GUICtrlSetBkColor(-1, 0xFFFFFF) #endregion Panel3 #region Panel4 $hPanel4 = _GUICtrlPanel_Create($GUI, "TopRight", 0, 0, 100, 50, $WS_BORDER) GUICtrlCreateCombo("Panel4", 10, 10, 80) #endregion Panel4 GUISetState(@SW_SHOW, $GUI) #endregion GUI While 1 Sleep(1000) WEnd Func _Panel3_BtnEvent() Switch $iPanel3step Case 0 _GUICtrlPanel_SetPos($hPanel3, "CenterRight") GUICtrlSetData($btnPanel3, "Hide me") Case 1 _GUICtrlPanel_SetState($hPanel3, @SW_HIDE) EndSwitch $iPanel3step += 1 EndFunc ;==>_Panel3_BtnEvent Func _Panel1_BtnEvent() Switch $iPanel1step Case 0 _GUICtrlPanel_SetPos($hPanel1, "TopRight") _GUICtrlPanel_SetPos($hPanel4, "Coords", 10, 40) GUICtrlSetData($btnPanel1, "Disable me") Case 1 _GUICtrlPanel_SetState($hPanel1, @SW_DISABLE) GUICtrlSetData($btnPanel1, "Disabled") EndSwitch $iPanel1step += 1 EndFunc ;==>_Panel1_BtnEvent Func _Exit() Exit EndFunc ;==>_Exit Attachments : GUIPanel_UDF.au3 (Previous: 279 downloads) GUIPanel_Example.au3 Enjoy !
- 2 replies
-
- gui panel
- panel ctrl
-
(and 3 more)
Tagged with:
-
Hi, I have a child GUI with the $WS_CHILD style inside a main gui, the problem is if there is ctrls (which are on the main GUI) behind the child GUI, they are visible, meaning that they are topmost of the child GUI. I there a solution to this, like making the child GUI on top ? P.S : I'm off to use the _WinAPI_SetParent. Br, FireFox.
-
Hi All, I'm trying to create a script that makes it able to just hit a combination like CTRL+G to login to Gmail.com and CTRL+F to login on Facebook. The problem is that when I used one of those hotkeys it seems to hold down the CTRL button so everytime I hit the 'F' or 'G' it runs the function. My script below: #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** HotKeySet ( "^g", "google" ) HotKeySet ( "^l", "linkedin" ) HotKeySet ( "^f", "facebook" ) HotKeySet ( "^h", "hyves" ) While 1;loop forever sleep(100) WEnd Func Google() Send ("username") Send ("{TAB}") Send ("password") Send ("{TAB}") Send ("{SPACE}") EndFunc Func linkedin() Send ("username") Send ("{TAB}") Send ("password") Send ("{TAB}") Send ("{SPACE}") EndFunc Func facebook() Send ("username") Send ("{TAB}") Send ("password") Send ("{TAB}") Send ("{SPACE}") EndFunc Func hyves() Send ("username") Send ("{TAB}") Send ("password") Send ("{TAB}") Send ("{SPACE}") EndFunc Exit Why is that happening?
-
Hey everyone, I am making a program which acts like a clipboard, but it also does a number of alterations to the data, like removing certain elements from HTML that has been copied. One problem I have come up against, is that I cannot send the keystroke CTRL+V when hotkeyset is specifying that that hotkey points to the paste function. The only way I have found around this (Other than using another hotkey for pasting, Ctrl+Shift+V which pastes straight from the windows clipboard anyway), is to input the data with the send command. The problem with this however, is that as I am sending thousands of letters at a time, it is taking forever to type it all out. Does anybody know a way around this? I am aware that there is a Hotkey UDF. Does anybody know if this addresses this problem? Thanks.