Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/23/2011 in all areas

  1. sleepydvdr

    HTML format like form

    Do you mean something like this? #include <GUIConstants.au3> $Form1 = GUICreate("Form1", 399, 129) $Label1 = GUICtrlCreateLabel("User Name:", 24, 16, 60, 17) $Label2 = GUICtrlCreateLabel("Password:", 24, 48, 53, 17) $Label3 = GUICtrlCreateLabel("Domain:", 24, 80, 43, 17) $inputUserName = GUICtrlCreateInput("", 88, 16, 169, 21) $inputPassword = GUICtrlCreateInput("", 88, 48, 169, 21) $inputDomain = GUICtrlCreateInput("", 88, 80, 169, 21) $Button1 = GUICtrlCreateButton("Go", 288, 48, 75, 25, 0) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 $userName = GUICtrlRead($inputUserName) $password = GUICtrlRead($inputPassword) $domain = GUICtrlRead($inputDomain) MsgBox(0, "", "You typed in the following information:" & @CRLF & $userName & @CRLF & $password & @CRLF & $domain) EndSwitch WEnd
    1 point
  2. MrVietA2, Just make the edit control read only. #include <GUIConstantsEx.au3> #include <EditConstants.au3> $hGUI = GUICreate("Test", 500, 500) $hEdit = GUICtrlCreateEdit("Try and delete me!", 10, 10, 200, 200, BitOr($GUI_SS_DEFAULT_EDIT, $ES_READONLY)) ; <<<<<<<<<<<<<<<< GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd M23
    1 point
  3. MrVietA2, Put the possible options into an array and then choose a random element when you start the script: #include <GUIConstantsEx.au3> Global $aInputs[3] = ["Hello", "How are you", "Pretty simple really!"] $hGUI = GUICreate("Test", 500, 500) $hInput = GUICtrlCreateInput($aInputs[Random(0, 2, 1)], 10, 10, 200, 20) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd M23
    1 point
  4. Ascend4nt

    WinAPIEx UDF

    Regarding the DLLStruct issue - Ward is correct here in that its dangerous to wrap memory with a struct without knowing how big the given allocation was. However, I think with 'wchar' wrapped around a null-term string, you *may* be safe depending on how AutoIt pulls the string (my best guess is it scans for a null-term rather than grab the whole chunk, but its best not to guess!). If it was 'byte' then you would definitely have a crash waiting to happen, as AutoIt would try to grab the entire 1024 bytes, which would overstep the size of the allocated memory. The solution here is pretty easy - just declare the return as 'str' or 'wstr'. AutoIt will grab as much as it needs and nothing more. So for example, you can shorten the given example to: $aRet = DllCall('shlwapi.dll', 'wstr', 'PathFindFileNameW', 'wstr', "C:\example\path\with\filename.ext") If @error=0 Then ConsoleWrite("Result of call: "&$aRet[0]&@CRLF) keep up the good work
    1 point
×
×
  • Create New...