-
Posts
1,213 -
Joined
-
Last visited
-
Days Won
7
Content Type
Forums
Downloads
Forum Articles
Events
Everything posted by JScript
-
This snippet caught my attention: Local $hRgn3 = _WinAPI_CreateRectRgn($iW - $r - $w - 5, 2, $iW - $r - $w, $iH + $p) Local $hRgn3 = _WinAPI_CreatePolygonRgn($aPointl) The variable has been redefined... JS
-
Perfect friend! Thanks for your great help, JS
-
@taietel Hello friend! First, thanks for your help, the result was better than I thought, was excellent! I noticed you did not use the function of polygons, so I assume that the effect shown below is no longer possible: JS
-
Here's a test I did in my program: One question: How to round the edges? There is a possibility for a shadow? JS
-
@taietel Excellent friend, is this basically what I wanted!!! This "graphic" explanation helped me understand the workings of _WinAPI_CreatePolygonRgn() function: #cs <----------------------- $iW -----------------------> | | $iH | | - <--------- $w -------><--- $r ---> | | $p | | - #ce I'll do some tests, Thanks mate! JS
-
Friends, I saw an example in the help file and made some minor changes in the creation of the star, but did not quite understand the dynamics of the function. #include <GUIConstantsEx.au3> #include <WinAPIGdi.au3> #include <WindowsConstants.au3> ; Create GUI Local $hForm = GUICreate('Test ' & StringReplace(@ScriptName, '.au3', '()'), 500, 475, -1, -1, $WS_POPUP, $WS_EX_TOPMOST) Local $idButton = GUICtrlCreateButton('Exit', 215, 10, 70, 23) GUIRegisterMsg($WM_NCHITTEST, 'WM_NCHITTEST') GUISetBkColor(0xC0C0C0) ; Create polygonal region and set it to the window Local $aPoint[10][2] = [[0, 0],[0, 0],[0, 100],[0, 0],[0, 0],[500, 0],[500, 60],[0, 60],[0, 0],[0, 0]] Local $hRgn = _WinAPI_CreatePolygonRgn($aPoint) _WinAPI_SetWindowRgn($hForm, $hRgn, 0) GUISetState(@SW_SHOW) Do Until GUIGetMsg() = $idButton Func WM_NCHITTEST($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg, $wParam, $lParam Return $HTCAPTION EndFunc ;==>WM_NCHITTEST If anyone knows how to model the example above... JS
-
@JLogan3o13 Hello, is just one example of demonstration, with that I will improve the look of my project '?do=embed' frameborder='0' data-embedContent>> JS
-
@Melba23 It is an excellent option friend! I'll implement here, but I believe it is something with GDI, anyway I'll test your code, thanks! @AdmiralAlkex Yes, I think it is too, but not very well dominate this area, if you have examples in which I can adapt, or something. Thanks for the attention of you friends, JS
-
Hello friends! Has anyone ever done something like this window in slide format? I'm lousy at math calculations and I do not have much experience in such windows, who can give me a hand I am grateful! JS
-
GUIRegisterMsg replacement for GUICtrlSetOnEvent and GUIGetMsg
JScript replied to BrewManNH's topic in AutoIt Example Scripts
@BrewManNH That's better my friend! Let's keep this thread updated with more information, I'll exhaustive tests on various versions of Windows since I have VMware and I can test it! JS -
Finally an elegant solution!Thank you friend JS
-
OnEvent Mode and more than one loop!
JScript replied to JScript's topic in AutoIt GUI Help and Support
Yes, it is an alternative, but unfortunately I can not run the two code snippets in one loop... Edit: I think in this form will be the only way that will work! I'll try, thank you! JS -
Hello everybody! I need to run two codes in separate loops, one in the main window and another when the second window is called, all in OnEvent mode! But in practice, when the second window opens, the second loop somehow disables "events", see the sample code below: #include <GUIConstantsEx.au3> Opt("GUIOnEventMode", 1) Global $hGUI1, $hGUI2 = 9999, $hButton1, $hButton2, $hButton3 = 9999 ; Predeclare the variables with dummy values to prevent firing the Case statements gui1() Func gui1() $hGUI1 = GUICreate("Gui 1", 200, 200, 100, 100) GUISetOnEvent($GUI_EVENT_CLOSE, "On_Close") ; Call a common GUI close function $hButton1 = GUICtrlCreateButton("Msgbox 1", 10, 10, 80, 30) GUICtrlSetOnEvent(-1, "On_Button") ; Call a common button function $hButton2 = GUICtrlCreateButton("Show Gui 2", 10, 60, 80, 30) GUICtrlSetOnEvent(-1, "On_Button") ; Call a common button function GUISetState() While 1 ; Here I need to run code inside this loop... Sleep(10) WEnd EndFunc ;==>gui1 Func gui2() $hGUI2 = GUICreate("Gui 2", 200, 200, 350, 350) GUISetOnEvent($GUI_EVENT_CLOSE, "On_Close") ; Call a common GUI close function $hButton3 = GUICtrlCreateButton("MsgBox 2", 10, 10, 80, 30) GUICtrlSetOnEvent(-1, "On_Button") ; Call a common button function GUISetState() While 1 ; Here I also need to run another code within this loop!!! Sleep(10) WEnd EndFunc ;==>gui2 Func On_Close() Switch @GUI_WinHandle ; See which GUI sent the CLOSE message Case $hGUI1 Exit ; If it was this GUI - we exit <<<<<<<<<<<<<<< Case $hGUI2 GUIDelete($hGUI2) ; If it was this GUI - we just delete the GUI <<<<<<<<<<<<<<< GUICtrlSetState($hButton2, $GUI_ENABLE) EndSwitch EndFunc ;==>On_Close Func On_Button() Switch @GUI_CtrlId ; See which button sent the message Case $hButton1 MessageBox(1) ; We can call a function with parameters here <<<<<<<<<<<<<<<<<<< Case $hButton2 GUICtrlSetState($hButton2, $GUI_DISABLE) gui2() Case $hButton3 MessageBox(2) ; We can call a function with parameters here <<<<<<<<<<<<<<<<<<< EndSwitch EndFunc ;==>On_Button Func MessageBox($iIndex) MsgBox("", "MsgBox " & $iIndex, "Test from Gui " & $iIndex) EndFunc ;==>MessageBox I appreciate all the help, JS
-
Ok, now I understand better, thanks! JS
-
I realized that some parameters of the dlls have changed, eg: CreateDIBSection before: DllCall('gdi32.dll', _ 'ptr', 'CreateDIBSection', _ 'hwnd', 0, _ 'ptr', DllStructGetPtr($tBITMAPINFO), _ 'uint', 0, _ 'ptr*', 0, _ 'ptr', 0, _ 'uint', 0) After: DllCall('gdi32.dll', _ 'handle', 'CreateDIBSection', _ 'handle', 0, _ 'struct*', $tBITMAPINFO, _ 'uint', 0, _ 'ptr*', 0, _ 'handle', 0, _ 'dword', 0) Any particular reason for this? Although in both modes it works normally... JS
-
This is quite interesting because it is not in the help file, but I only got success in this way: If @error > 0 Then JS
-
Hi Hello, thanks for the reply, but unfortunately it did not work... I'm testing as follows: If @error > 0 Then JS
-
Hello to all! I will comment on the version v3.3.12.0, which I was surprised by the speed of the build really is super fast compared to previous! The organization of includes folder is perfect, well synchronized and divided, congratulations to all who participate in the development of this wonderful scripting language. However, I still used the version 3.3.8.1 because it still caters to the requirements of my code, but with the improvements in the current version, so I decided to install. However, I have noticed that the TCPRecv () function does not work the same way in version 3.3.8.1, I've seen comments about it and I have seen that the behavior is really different! Before I just used something like this code below: $vDataRecv = TCPRecv($iConnected, 200) If @error Then MsgBox(262160, "Error!", "A conexão com o computador remoto falhou!") Return 0 EndIf However, with the new version does not work anymore, always returns me error! Could someone tell me another way to code up? I appreciate everyone's help, JS
-
_GUICtrlToolbar_Create and arrow keys...
JScript replied to JScript's topic in AutoIt General Help and Support
Perfect my friend, is what I need, thank you! JS -
_GUICtrlToolbar_Create and arrow keys...
JScript replied to JScript's topic in AutoIt General Help and Support
I'm glad you understood! But does this not have a solution? JS -
Help File/Documentation Issues. (Discussion Only)
JScript replied to guinness's topic in AutoIt Technical Discussion
Any chance we have an example of using this function: _WinAPI_CopyRect() ; Description....: Copies the coordinates of one rectangle to another. JS -
_GUICtrlToolbar_Create and arrow keys...
JScript replied to JScript's topic in AutoIt General Help and Support
@Melba23 Forgive me, but be assured that it was an error on Google Translator! I meant that "I tested your code, but unfortunately it did not work." Note: I had to by the quotes "" to get the translation right. JS -
_GUICtrlToolbar_Create and arrow keys...
JScript replied to JScript's topic in AutoIt General Help and Support
I had already done this test, but unfortunately does not work if the edit control is disabled, see: #include <GuiToolbar.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <Constants.au3> $Debug_TB = False ; Check ClassName being passed to functions, set to True and use a handle to another control to see it work Global $hToolbar, $iMemo Global $iItem ; Command identifier of the button associated with the notification. Global Enum $idNew = 1000, $idOpen, $idSave, $idHelp _Main() Func _Main() Local $hGUI, $aSize ; Create GUI $hGUI = GUICreate("Toolbar", 600, 400) $hToolbar = _GUICtrlToolbar_Create($hGUI) $aSize = _GUICtrlToolbar_GetMaxSize($hToolbar) GUICtrlCreateLabel("Teste", 0, 0) $iMemo = GUICtrlCreateEdit("", 2, $aSize[1] + 20, 596, 396 - ($aSize[1] + 20), $WS_VSCROLL) ; ----> Note: I want to disable edit control!!! GUICtrlSetState(-1, $GUI_DISABLE) ; <---- GUICtrlSetFont($iMemo, 9, 400, 0, "Courier New") GUISetState() GUIRegisterMsg($WM_NOTIFY, "_WM_NOTIFY") ; Add standard system bitmaps _GUICtrlToolbar_AddBitmap($hToolbar, 1, -1, $IDB_STD_LARGE_COLOR) ; Add buttons _GUICtrlToolbar_AddButton($hToolbar, $idNew, $STD_FILENEW) _GUICtrlToolbar_AddButton($hToolbar, $idOpen, $STD_FILEOPEN) _GUICtrlToolbar_AddButton($hToolbar, $idSave, $STD_FILESAVE) _GUICtrlToolbar_AddButtonSep($hToolbar) _GUICtrlToolbar_AddButton($hToolbar, $idHelp, $STD_HELP) ; Loop until user exits Do Until GUIGetMsg() = $GUI_EVENT_CLOSE EndFunc ;==>_Main ; Write message to memo Func MemoWrite($sMessage = "") GUICtrlSetData($iMemo, $sMessage & @CRLF, 1) EndFunc ;==>MemoWrite ; WM_NOTIFY event handler Func _WM_NOTIFY($hWndGUI, $MsgID, $wParam, $lParam) #forceref $hWndGUI, $MsgID, $wParam Local $tNMHDR, $hwndFrom, $code, $i_idNew, $dwFlags, $i_idOld Local $tNMTBHOTITEM $tNMHDR = DllStructCreate($tagNMHDR, $lParam) $hwndFrom = DllStructGetData($tNMHDR, "hWndFrom") $code = DllStructGetData($tNMHDR, "Code") Switch $hwndFrom Case $hToolbar Switch $code Case $NM_LDOWN ;---------------------------------------------------------------------------------------------- MemoWrite("$NM_LDOWN: Clicked Item: " & $iItem & " at index: " & _GUICtrlToolbar_CommandToIndex($hToolbar, $iItem)) ;---------------------------------------------------------------------------------------------- Case $TBN_HOTITEMCHANGE $tNMTBHOTITEM = DllStructCreate($tagNMTBHOTITEM, $lParam) $i_idOld = DllStructGetData($tNMTBHOTITEM, "idOld") $i_idNew = DllStructGetData($tNMTBHOTITEM, "idNew") $iItem = $i_idNew $dwFlags = DllStructGetData($tNMTBHOTITEM, "dwFlags") If BitAND($dwFlags, $HICF_LEAVING) = $HICF_LEAVING Then MemoWrite("$HICF_LEAVING: " & $i_idOld) Elseif BitAND($dwFlags, $HICF_ARROWKEYS) = $HICF_ARROWKEYS Then _WinAPI_SetFocus($iMemo) Else Switch $i_idNew Case $idNew ;---------------------------------------------------------------------------------------------- MemoWrite("$TBN_HOTITEMCHANGE: $idNew") ;---------------------------------------------------------------------------------------------- Case $idOpen ;---------------------------------------------------------------------------------------------- MemoWrite("$TBN_HOTITEMCHANGE: $idOpen") ;---------------------------------------------------------------------------------------------- Case $idSave ;---------------------------------------------------------------------------------------------- MemoWrite("$TBN_HOTITEMCHANGE: $idSave") ;---------------------------------------------------------------------------------------------- Case $idHelp ;---------------------------------------------------------------------------------------------- MemoWrite("$TBN_HOTITEMCHANGE: $idHelp") ;---------------------------------------------------------------------------------------------- EndSwitch EndIf EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>_WM_NOTIFY And I need the edit control is disabled, JS -
_GUICtrlToolbar_Create and arrow keys...
JScript replied to JScript's topic in AutoIt General Help and Support
So, run the example below and use the arrow keys on the keyboard and see that they activate the buttons on the toll bar! #include <GuiToolbar.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <Constants.au3> $Debug_TB = False ; Check ClassName being passed to functions, set to True and use a handle to another control to see it work _Main() Func _Main() Local $hGUI, $hToolbar Local Enum $idNew = 1000, $idOpen, $idSave, $idHelp ; Create GUI $hGUI = GUICreate("Toolbar", 400, 300) $hToolbar = _GUICtrlToolbar_Create($hGUI) GUISetState() ; Add standard system bitmaps _GUICtrlToolbar_AddBitmap($hToolbar, 1, -1, $IDB_STD_LARGE_COLOR) ; Add buttons _GUICtrlToolbar_AddButton($hToolbar, $idNew, $STD_FILENEW) _GUICtrlToolbar_AddButton($hToolbar, $idOpen, $STD_FILEOPEN) _GUICtrlToolbar_AddButton($hToolbar, $idSave, $STD_FILESAVE) _GUICtrlToolbar_AddButtonSep($hToolbar) _GUICtrlToolbar_AddButton($hToolbar, $idHelp, $STD_HELP) ; Loop until user exits Do Until GUIGetMsg() = $GUI_EVENT_CLOSE EndFunc ;==>_Main How to turn this off? JS -
Hello everybody. Someone could inform how to prevent the arrow keys work in _GUICtrlToolbar_Create ? Thank you in advance, JS