Jump to content

Farbfenster UDF


plfire
 Share

Recommended Posts

Hallo, bin neu hier und begeisterter AutoIt Programmierer!

Was haltet Ihr von meiner 1. UDF?

#include <WindowsConstants.au3>

Func farbfenster($titel, $weite, $hoehe, $mittig, $farbe, $transparenz, $dauer)
    If $mittig="ja" Then
        $left=-1
        $top=-1
    Else
        $left=0
        $top=0
    EndIf
    Local $sleep
    Local $gui
    Global $color
    $gui=GUICreate($titel, $weite, $hoehe, $left, $top, $WS_POPUP)
    If $farbe="blau" Then
        $color=0X0000FF
    ElseIf $farbe="gelb" Then
        $color=0XFFFF00
    ElseIf $farbe="grün" Then
        $color=0X00FF00
    ElseIf $farbe="rot" Then
        $color=0XFF0000
    ElseIf $farbe="schwarz" Then
        $color=0X000000
    ElseIf $farbe="weiß" Then
        $color=0XFFFFFF
    Else
        $color=0X000000
    EndIf
    GUISetBkColor($color, $gui)
    WinSetTrans($titel, "", $transparenz)
    If $dauer=1 Then
        $sleep=1000
    ElseIf $dauer=2 Then
        $sleep=2000
    ElseIf $dauer=3 Then
        $sleep=3000
    ElseIf $dauer=4 Then
        $sleep=4000
    ElseIf $dauer=5 Then
        $sleep=5000
    Else
        $sleep=100
    EndIf
    GUISetState(@SW_SHOW, $titel)
    sleep($sleep)
EndFunc
Edited by Melba23
Added code tags
Link to comment
Share on other sites

Willkommen zu AutoIt und im Forum!

Du kannst hier in jeder Sprache posten - aber der überwiegende Großteil der Threads ist in Englisch.

Was auf jeden Fall fehlt: Du solltest den Code in die Tags [autoit][/autoit] einfügen - das formatiert den Code dann gleich lesbar.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Falls du nicht in Englisch schreiben möchtest, warum auch immer, dann empfehle ich dir das deutsche AutoIt Forum.

Hier kannst du, wie von water gesagt, in der Sprache deiner Wahl posten, macht aber hier keinen Sinn! ;)

Gruß,

UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

Willkommen zu AutoIt und im Forum!

Du kannst hier in jeder Sprache posten - aber der überwiegende Großteil der Threads ist in Englisch.

Was auf jeden Fall fehlt: Du solltest den Code in die Tags [autoit][/autoit] einfügen - das formatiert den Code dann gleich lesbar.

Und wie mach ich das?
Link to comment
Share on other sites

#include <WindowsConstants.au3>

Func farbfenster($titel, $weite, $hoehe, $mittig, $farbe, $transparenz, $dauer)
    If $mittig="ja" Then
        $left=-1
        $top=-1
    Else
        $left=0
        $top=0
    EndIf
    Local $sleep
    Local $gui
    Global $color
    $gui=GUICreate($titel, $weite, $hoehe, $left, $top, $WS_POPUP)
    If $farbe="blau" Then
        $color=0X0000FF
    ElseIf $farbe="gelb" Then
        $color=0XFFFF00
    ElseIf $farbe="grün" Then
        $color=0X00FF00
    ElseIf $farbe="rot" Then
        $color=0XFF0000
    ElseIf $farbe="schwarz" Then
        $color=0X000000
    ElseIf $farbe="weiß" Then
        $color=0XFFFFFF
    Else
        $color=0X000000
    EndIf
    GUISetBkColor($color, $gui)
    WinSetTrans($titel, "", $transparenz)
    If $dauer=1 Then
        $sleep=1000
    ElseIf $dauer=2 Then
        $sleep=2000
    ElseIf $dauer=3 Then
        $sleep=3000
    ElseIf $dauer=4 Then
        $sleep=4000
    ElseIf $dauer=5 Then
        $sleep=5000
    Else
        $sleep=100
    EndIf
    GUISetState(@SW_SHOW, $titel)
    sleep($sleep)
EndFunc

Edited by Melba23
Added code tags
Link to comment
Share on other sites

Du solltest den Code in die Tags [autoit][/autoit] einfügen - das formatiert den Code dann gleich lesbar.Also entweder händisch einfügen oder auf das blaue Icon mit dem A klicken.

Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

  • Moderators

plfire,

I have merged your topics - please stick to just the one in future. ;)

And this is an English speaking-forum - please post in English. Although you can still use German if you add an English translation (via Google if necessary). :)

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

many german speaking people here :huh:

My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Link to comment
Share on other sites

  • Moderators

PhoenixXL,

And I speak languages other than English too - but this is an English-speaking forum. I have no problems with people posting in other languages IF they also provide an English translation (using a translation engine if necessary). I see this as a matter of common courtesy to the majority of forum members. :)

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

@PhoenixXL

Yes, but I get the impression that even more speak Dutch!

Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

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