Jump to content

Recommended Posts

Posted

Yes, you're right, I was reporting something that someone had posted today. I didn't pay enough attention to how he'd changed the msgbox data so that it was different from the Help file example. I took a quick look at the example and thought they were written the same, and they're not.

Mea culpa. :)

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

  Reveal hidden contents

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Posted

Strange I was just looking at your comment back in 2011 in one thread. I honestly don't know. This is for a dev to answer.

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

Posted (edited)

_GUICtrlSlider_SetToolTips

When a slidert control is created with the

_GUICtrlSlider_GetTic

Valid indexes are in the range from zero to two less than the tick count returned by the _GUICtrlSlider_GetNumTics function.

_GUICtrlSlider_GetNumTics depends on the _GUICtrlSlider_SetTicFreq

_GUICtrlSlider_Create, GUI Control Styles

$TBS_VERT Places ticks on the left side of a vertical trackbar.

$TBS_VERT Creates a vertical slider

_WinAPI_FlashWindow

$hwnd = GUICreate("__WinAPI_FlashWindow Example", 200, 200)

_________________^

_WinAPI_GetTextExtentPoint32

Do

Sleep(50)

Until GUIGetMsg() = $GUI_EVENT_CLOSE

_WinAPI_SetEvent

$hEvent Handle to the event objec

objec -> object

_WinAPI_CreateEvent

_WinAPI_SetEvent

_WinAPI_WaitForMultipleObjects

_WinAPI_WaitForSingleObject

These functions are dependent on each other?

###Related###

_WinAPI_GetParent

_WinAPI_SetParent

###Related###

_WinAPI_SetFont

_WinAPI_CreateFont

_WinAPI_CreateFontIndirect

###Related###

_WinAPI_SetCapture

_WinAPI_ReleaseCapture

_WinAPI_SetFont

#include <GuiListBox.au3>
#include <GuiButton.au3>
#include <FontConstants.au3>

Example()

Func Example()
    Local $hGUI, $hFont, $hFontList, $iBtn, $hBtn, $hListBox

    $hGUI = GUICreate(StringTrimRight(@ScriptName, 4), 350, 200)

    ; $iBtn = GUICtrlCreateButton("Button", 10, 10, 270, 34)
    ; $hBtn = GUICtrlGetHandle(-1)
    $hBtn = _GUICtrlButton_Create($hGUI, "Button", 10, 10, 270, 34)

    $hListBox = _GUICtrlListBox_Create($hGUI, "Bold", 10, 50, 270, 150)

    _GUICtrlListBox_BeginUpdate($hListBox)
    _GUICtrlListBox_Dir($hListBox, "", $DDL_DRIVES, False)
    _GUICtrlListBox_EndUpdate($hListBox)

    $hFont = _WinAPI_CreateFont(30, 0, 0, 0, 400, False, False, False, $DEFAULT_CHARSET, _
            $OUT_DEFAULT_PRECIS, $CLIP_DEFAULT_PRECIS, $DEFAULT_QUALITY, 0, 'Comic Sans MS')

    $hFontList = _WinAPI_CreateFont(20, 0, 0, 0, 700) ; for ListBox

    _WinAPI_SetFont($hBtn, $hFont)
    _WinAPI_SetFont($hListBox, $hFontList)

    GUISetState()

    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE
    _WinAPI_DeleteObject($hFont)
    _WinAPI_DeleteObject($hFontList)
EndFunc   ;==>Example

_WinAPI_CreateFontIndirect

When you no longer need the font, call the _WinAPI_DeleteObject function to delete it

#include <GuiListBox.au3>
#include <GuiButton.au3>

Example()

Func Example()
    Local $hGUI, $hFont, $hBtn, $hListBox, $tLogFont

    $hGUI = GUICreate(StringTrimRight(@ScriptName, 4), 350, 200)

    $hBtn = _GUICtrlButton_Create($hGUI, "Button", 10, 10, 270, 34)
    $hListBox = _GUICtrlListBox_Create($hGUI, "Bold", 10, 50, 270, 150)

    _GUICtrlListBox_BeginUpdate($hListBox)
    _GUICtrlListBox_Dir($hListBox, "", $DDL_DRIVES, False)
    _GUICtrlListBox_EndUpdate($hListBox)

    $tLogFont = DllStructCreate($tagLOGFONT)
    DllStructSetData($tLogFont, "Height", 22)
    DllStructSetData($tLogFont, "Weight", 700)
    DllStructSetData($tLogFont, "Italic", True)
    DllStructSetData($tLogFont, "FaceName", 'Courier new')
    $hFont = _WinAPI_CreateFontIndirect($tLogFont)

    _WinAPI_SetFont($hBtn, $hFont)
    _WinAPI_SetFont($hListBox, $hFont)

    GUISetState()

    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE
    _WinAPI_DeleteObject($hFont)
EndFunc   ;==>Example
Edited by AZJIO
Posted (edited)

Why did I do that last night? Idiot! It was because the original was If @error <> 0 Then.

Edit: I also have no qualms people correcting me, if I'm wrong.

Edited by guinness

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

Posted

Yeh, I changed it to that. Sleep deprivation was the cause of that @error!

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

Posted

GUICreate Page in help files states in the extended style table:

$WS_EX_ACCEPTFILES:

Allow an edit or input control within the created GUI window to receive filenames via drag and drop. The control must have also the $GUI_DROPACCEPTED state set by GUICtrlSetState. for other controls the drag&drop info can be retrieved with @GUI_DRAGID, @GUI_DRAGFILE, @GUIDROPID.

Where it should be @GUI_DROPID

  Reveal hidden contents

IUIAutomation - Topic with framework and examples

Au3Record.exe

Posted

Already fixed and it should be @GUI_DropId.

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

Posted (edited)

_GUICtrlToolbar_GetButtonInfoEx
Retrieves extended information for a button
Its no

_GUICtrlToolbar_SetButtonInfo
Sets extended information for a button

_GUICtrlToolbar_SetButtonInfoEx
$tButton | $tagBUTTONINFO structure
$tagTBBUTTONINFO

_GUICtrlListView_GetUnicodeFormat
Success: True: Using Unicode characters
Failure: False: Using ANSI characters
The function always succeeds, it simply returns a flag. See _GUICtrlTab_GetUnicodeFormat

_GUICtrlToolbar_GetHotItem
Example does not include the use of
 
_ColorGetCOLORREF
" Red=" & Hex($aColor[0], 2) & " Blue=" & Hex($aColor[1], 2) & " Green=" & Hex($aColor[2], 2))
" Red=" & Hex($aColor[0], 2) & " Green=" & Hex($aColor[1], 2) & " Blue=" & Hex($aColor[2], 2))

_SQLite_Exec
; Without $sCallback it's a resultless statement
???
 
 
_GUICtrlToolbar_AddBitmap
 



  Quote

$VIEW_DETAILS - View details image
$VIEW_LARGEICONS - View large icons image
$VIEW_LIST - View list image
$VIEW_SMALLICONS - View small icons image.
$VIEW_SORTDATE - Sort by date image.
$VIEW_SORTNAME - Sort by name image.
$VIEW_SORTSIZE - Sort by size image.
$VIEW_SORTTYPE - Sort by type image

Constants do not even defined in the header files
 
_GUIImageList_...
$hWnd Handle to the control
$hWnd Handle to the ImageList
 
20f172262d5et.jpg
 
 
IniWrite

  Quote

When writing a value that is quoted, the quotes are stripped. In order to write the quote marks to the value, you must double up the quoting. For example: ""This is a test"" will produce "This is a test" in the file.

What quotes? Those that belong to the syntax? Incorrect wording.

  Quote

To write down data that must be read to have quotation marks, they have to be written down in the ini-file with double quotes, for example key=""value"", then after reading the quote will be removed one at each end.

 

IniWrite
 

  Quote

Leading and trailing whitespace is stripped. In order to preserve the whitespace, the string must be quoted. For example, " this is a test" will preserve the whitespace but per above, the quotation marks are stripped.

key=" this is a test"

Has to show that the text is in the ini-file, instead of in a script. It was then he will be read with whitespace.

 

IniReadSectionNames
Only the first 32767 chars are taken in account in an section due to Win9x compatibility.

This string should not be in this description

 

AutoIt3_Index.hhk

<LI><OBJECT type="text/sitemap"><param name="Name" value="*"><param name="Local" value="html\intro\lang_operators.htm"></OBJECT>
<LI><OBJECT type="text/sitemap"><param name="Name" value="+"><param name="Local" value="html\intro\lang_operators.htm"></OBJECT>
<LI><OBJECT type="text/sitemap"><param name="Name" value="-"><param name="Local" value="html\intro\lang_operators.htm"></OBJECT>
<LI><OBJECT type="text/sitemap"><param name="Name" value="/"><param name="Local" value="html\intro\lang_operators.htm"></OBJECT>
<LI><OBJECT type="text/sitemap"><param name="Name" value="="><param name="Local" value="html\intro\lang_operators.htm"></OBJECT>
<LI><OBJECT type="text/sitemap"><param name="Name" value="^"><param name="Local" value="html\intro\lang_operators.htm"></OBJECT>
<LI><OBJECT type="text/sitemap"><param name="Name" value="&amp;"><param name="Local" value="html\intro\lang_operators.htm"></OBJECT>
<LI><OBJECT type="text/sitemap"><param name="Name" value="&lt;"><param name="Local" value="html\intro\lang_operators.htm"></OBJECT>
<LI><OBJECT type="text/sitemap"><param name="Name" value="&gt;"><param name="Local" value="html\intro\lang_operators.htm"></OBJECT>
<LI><OBJECT type="text/sitemap"><param name="Name" value="And"><param name="Local" value="html\intro\lang_operators.htm"></OBJECT>
<LI><OBJECT type="text/sitemap"><param name="Name" value="Or"><param name="Local" value="html\intro\lang_operators.htm"></OBJECT>
<LI><OBJECT type="text/sitemap"><param name="Name" value="Not"><param name="Local" value="html\intro\lang_operators.htm"></OBJECT>

DllCall

$aRes = DllCall("shell32.dll", "int", 62, "hwnd", 0, "ptr", DllStructGetPtr($stString), "int", $structsize, "ptr", DllStructGetPtr($stIcon))
If @error Or Not $aRes[0] Then Exit ; Cancel
Edited by AZJIO
  • 3 weeks later...
Posted (edited)

GUICtrlCreateAvi

The animation does not fit in the GUI

Buttons at many examples the small. As the standard it is possible to use 90x27

GUICtrlSetPos, GUISetStyle

If $right = 0 Then
    $right = 1
    GUICtrlSetPos($label, 20, 20)
Else
    $right = 0
    GUICtrlSetPos($label, 10, 20)
EndIf
$bToggle = Not $bToggle
If $bToggle Then
    GUICtrlSetPos($iLabel, 20, 20)
Else
    GUICtrlSetPos($iLabel, 20, 30)
EndIf

GUICtrlCreateIcon

While ($a < 300) And ($b < 300)
        $a = $a + Int(Random(0, 1) + 0.5)
        $b = $b + Int(Random(0, 1) + 0.5)
        GUICtrlSetPos($n1, $a, 0)
        GUICtrlSetPos($n2, $b, 40)
        Sleep(20)
    WEnd
    Sleep(1000)
    Opt("GUICoordMode", $iOldOpt)
EndFunc
While ($a < 300) And ($b < 300)
        $a += Random(0, 1, 1)
        $b += Random(0, 1, 1)
        GUICtrlSetPos($icon1, $a, 0)
        GUICtrlSetPos($icon2, $b, 40)
        Sleep(10)
    WEnd
    Opt("GUICoordMode", $iOldOpt)
    If $a > $b Then
        MsgBox(0, 'Race results', 'The dinosaur won', 0, $hGUI)
    Else
        MsgBox(0, 'Race results', 'The horse won', 0, $hGUI)
    EndIf
EndFunc
Edited by AZJIO
Posted

I don't understand.

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

  • Moderators
Posted

guinness,

I had to read it twice:

 

key - The key name in the in the .ini file

 

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:

  Reveal hidden contents

 

Posted (edited)

Fixed. I have a really small font for viewing the Forum (8pt) so this is why I couldn't see it.

  Quote
Revision: 7751
Author: guinness
Date: 04 June 2013 21:50:46
Message:
Fixed: Grammatical error.
----
Modified : /trunk/docs/autoitx/english/txt2htm/txtMethods/IniRead.txt
 
Edited by guinness

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

Posted

Is there any site where I can see actual version of Help Documentation ?

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

No. The help file represents the current version of AutoIt it is shipped with. Uploading a new version would cause havoc as it contains, fixes, additions & experimental features that may or may not be in v3.3.8.1.

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

Posted

I think this is a good idea

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Guest
This topic is now closed to further replies.
×
×
  • Create New...