#Region #AutoIt3Wrapper_Icon=icon\bl-xl_1.ico #AutoIt3Wrapper_Compression=4 #AutoIt3Wrapper_Compile_Both=n #AutoIt3Wrapper_UseX64=Y #AutoIt3Wrapper_UseUpx=N #AutoIt3Wrapper_Res_Language=1031 #EndRegion #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #Region ### START Koda GUI section ### Form= Global $hWnd, $inFile, $editQR, $btFileExit, $sIssuer, $sKontoname, $editCode, $png, $hImage, $Bmp Global $btDelete, $btCalculate, $sPath = @ScriptDir, $sFile, $aMsg, $iErr = 0 Global $aStatusBar, $g_sString, $g_sDecoded, $g_sEncoded, $sEncodeCode, $g_sEncoded, $vCode, $vKey, $sKey, $vCreate Global $BASE32_DECODE_TABLE[128], $BASE32_INIT = 0, $btFileExit, $btCalculate, $btRandomCode, $btRandomKey Global $ActiveTabCount, $QRCodeText Global Const $BASE32CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567" Global $hWnd = GUICreate("QR-Codes erstellen", 1700, 1000, -1, -1, $WS_SIZEBOX + $WS_SYSMENU) Global $Pic1 = GUICtrlCreatePic("", 1200, 60, 300, 300) GUICtrlSetBkColor(0, 0xB9D1EA) #Region ;**** Tab-Control erstellen **** Global $Tab1 = GUICtrlCreateTab(200, 0, 1000, 950) GUICtrlSetBkColor(0, 0xB9D1EA) #EndRegion ;**** --- **** #Region ;**** Erstes Tab füllen **** Global $TabSheet1 = GUICtrlCreateTabItem("MFA/2FA") GUICtrlCreateGroup(' Grundeinstellungen ', 210, 40, 420, 280) ; Kontoname GUICtrlCreateLabel('Kontoname/Benutzername:', 225, 60) Global $mfaKonto = GUICtrlCreateEdit('', 225, 80, 380, 20, BitOR($ES_WANTRETURN, $ES_MULTILINE)) ; Anzeigename GUICtrlCreateLabel('Anzeigename/Anbietername:', 225, 110) Global $mfaName = GUICtrlCreateEdit('', 225, 130, 380, 20, BitOR($ES_WANTRETURN, $ES_MULTILINE)) ; Securecode GUICtrlCreateLabel('Securecode:', 225, 160) Global $mfaSecure = GUICtrlCreateEdit('', 225, 180, 380, 20, BitOR($ES_WANTRETURN, $ES_MULTILINE)) ; Herausgeber GUICtrlCreateLabel('Herausgeber (optional)', 225, 210) Global $mfaHerausgeber = GUICtrlCreateEdit('', 225, 230, 380, 20, BitOR($ES_WANTRETURN, $ES_MULTILINE)) ; Image GUICtrlCreateLabel('Image/Bild-Url (optional)', 225, 260) Global $mfaImage = GUICtrlCreateEdit('', 225, 280, 380, 20, BitOR($ES_WANTRETURN, $ES_MULTILINE)) GUICtrlCreateGroup("", -99, -99, 1, 1) GuiCtrlGroupSetColor(210, 40, 420, 280, 0x8B008B) ; Rahmenfarbe Gruppe "QR-Code erstellen" GUICtrlCreateGroup(' Weitere Einstellungen ', 210, 340, 420, 400) ; Verschlüsselung GUICtrlCreateLabel('Verschlüsselung (Standard ist SHA1):', 225, 370) Global $mfaCodierung = GUICtrlCreateCombo('SHA1', 225, 390, 380, 20) GUICtrlSetData($mfaCodierung, "SHA224|SHA256|SHA384|SHA512", "SHA1") ; Digits GUICtrlCreateLabel('Digits (Standard ist 6):', 225, 420) Global $mfADigits = GUICtrlCreateCombo('6', 225, 440, 380, 20) GUICtrlSetData($mfaDigits, "6|7|8|9|10|11|12", "6") ; Timeout GUICtrlCreateLabel('Timeout (Standard sind 30s):', 225, 470) Global $mfaTimeout = GUICtrlCreateCombo('30s', 225, 490, 380, 20, BitOR($ES_WANTRETURN, $ES_MULTILINE)) GUICtrlSetData($mfaTimeout, "15s|1m|2m|5m|10m", "30s") ; Counter GUICtrlCreateLabel('Counter (Stabdard ist 0):', 225, 520) Global $mfaCounter = GUICtrlCreateCombo('0', 225, 540, 380, 20, BitOR($ES_WANTRETURN, $ES_MULTILINE)) GUICtrlSetData($mfaCounter, "1|2|3|4|5|6", "30s") ; Standard Global $mfaStandard = GUICtrlCreateCheckbox("Standard verwenden", 225, 580, 380, 20) GUICtrlSetState(-1, $GUI_CHECKED) GUIStartGroup() Global $mfaTimebased = GUICtrlCreateRadio("Time based (Standard)", 230, 630, 380, 20) GUICtrlSetState(-1, $GUI_CHECKED) Global $mfaCounterbased = GUICtrlCreateRadio("Counter based", 230, 660, 380, 20) Global $mfaGroup = GUICtrlCreateGroup("Zählart", 225, 610, 380, 80) GUICtrlCreateGroup("", -99, -99, 1, 1) GuiCtrlGroupSetColor(210, 340, 420, 400, 0x8B008B) ; Rahmenfarbe Gruppe "QR-Code erstellen" #EndRegion ;**** --- **** #Region ;**** Zweites Register füllen **** Global $TabSheet2 = GUICtrlCreateTabItem("Email") GUICtrlCreateGroup(' QR-Code erstellen ', 210, 140, 480, 280) ; Email-Adresse GUICtrlCreateLabel('Emailadresse:', 225, 173) Global $editAddress = GUICtrlCreateEdit('Emailadresse eingeben', 290, 170, 380, 20, BitOR($ES_WANTRETURN, $ES_MULTILINE)) ; Betreff GUICtrlCreateLabel('Betreff:', 225, 203) Global $editSubject = GUICtrlCreateEdit('Betreff eingeben', 290, 200, 380, 20, BitOR($ES_WANTRETURN, $ES_MULTILINE)) ; Emailtext GUICtrlCreateLabel('Text:', 225, 253) Global $editBody = GUICtrlCreateEdit('Emailtext eingeben.', 290, 250, 380, 140, BitOR($ES_WANTRETURN, $ES_MULTILINE)) GUICtrlSetBkColor(-1, 0x00FFFF) GUICtrlCreateGroup("", -99, -99, 1, 1) GuiCtrlGroupSetColor(210, 140, 480, 280, 0x8B008B) ; Rahmenfarbe Gruppe "QR-Code erstellen" #EndRegion ;**** --- **** #Region ;**** Drittes Register füllen **** Global $TabSheet3 = GUICtrlCreateTabItem("Giro-Code") ; Servicetag GUICtrlCreateLabel('Servicetag:', 225, 60) Global $giroTag = GUICtrlCreateEdit('BCD', 225, 80, 380, 20, BitOR($ES_WANTRETURN, $ES_MULTILINE)) ; Version GUICtrlCreateLabel('Version (Möglich: 001 oder 002):', 225, 110) Global $giroVersion = GUICtrlCreateEdit('001', 225, 130, 380, 20, BitOR($ES_WANTRETURN, $ES_MULTILINE)) ; Zeichencodierung GUICtrlCreateLabel('Zeichencodierung (siehe Hinweis):', 225, 160) Global $giroCodierung = GUICtrlCreateEdit('1', 225, 180, 380, 20, BitOR($ES_WANTRETURN, $ES_MULTILINE)) ; Art GUICtrlCreateLabel('Art (SCT = Sepa Credit Transfer)', 225, 210) Global $giroArt = GUICtrlCreateEdit('SCT', 225, 230, 380, 20, BitOR($ES_WANTRETURN, $ES_MULTILINE)) ; BIC GUICtrlCreateLabel('BIC der Empfängerbank (in der EU entbehrlich)', 225, 260) Global $giroBic = GUICtrlCreateEdit('', 225, 280, 380, 20, BitOR($ES_WANTRETURN, $ES_MULTILINE)) ; Emfpänger GUICtrlCreateLabel('Empfänger:', 225, 310) Global $giroInhaber = GUICtrlCreateEdit('', 225, 330, 380, 20, BitOR($ES_WANTRETURN, $ES_MULTILINE)) ; IBAN GUICtrlCreateLabel('IBAN des Zahlungsemfpängers:', 225, 360) Global $giroIBAN = GUICtrlCreateEdit('', 225, 380, 380, 20, BitOR($ES_WANTRETURN, $ES_MULTILINE)) ; Betrag GUICtrlCreateLabel('Betrag (Durch Punkt getrennt):', 225, 410) Global $giroBetrag = GUICtrlCreateEdit('0.01', 225, 430, 380, 20, BitOR($ES_WANTRETURN, $ES_MULTILINE)) ; Char GUICtrlCreateLabel('Char (Zweck. 4-stelliger Zahlencode. Optional):', 225, 460) Global $giroChar = GUICtrlCreateEdit('', 225, 480, 380, 20, BitOR($ES_WANTRETURN, $ES_MULTILINE)) ; Referenz GUICtrlCreateLabel('Referenz (Strukturierter 35-Zeichencode gem. ISO 11649 RF Creditor-Referenz):', 225, 510) Global $giroRef = GUICtrlCreateEdit('', 225, 530, 380, 20, BitOR($ES_WANTRETURN, $ES_MULTILINE)) ; Verwendungszweck GUICtrlCreateLabel('Verwendungszweck:', 225, 560) Global $giroZweck = GUICtrlCreateEdit('', 225, 580, 380, 20, BitOR($ES_WANTRETURN, $ES_MULTILINE)) ; Nutzerhinweis GUICtrlCreateLabel('Hinweis an den Nutzer (Optional):', 225, 610) Global $giroOpt = GUICtrlCreateEdit('', 225, 630, 380, 20, BitOR($ES_WANTRETURN, $ES_MULTILINE)) #EndRegion ;**** --- **** #Region ;**** Viertes Register füllen **** Global $TabSheet4 = GUICtrlCreateTabItem("Webseite") GUICtrlCreateLabel('Internetadresse:', 225, 60) Global $webAddress = GUICtrlCreateEdit('https://www.rholtz-office.de', 225, 80, 380, 20, BitOR($ES_WANTRETURN, $ES_MULTILINE)) #EndRegion ;**** --- **** #Region ;**** Fünftes Register füllen **** Global $TabSheet5 = GUICtrlCreateTabItem("VCard") #EndRegion ;**** --- **** #Region ;**** Sechstes Register füllen **** Global $TabSheet6 = GUICtrlCreateTabItem("Micro-QR") GUICtrlCreateLabel('Text eingeben. Maximal 35 Zeichen:', 225, 60) Global $microText = GUICtrlCreateEdit('', 225, 80, 380, 20, BitOR($ES_WANTRETURN, $ES_MULTILINE)) GUICtrlSetLimit(-1, 35) #EndRegion ;**** --- **** #Region ;**** Siebtes Register füllen **** Global $TabSheet7 = GUICtrlCreateTabItem("Standard") GUICtrlCreateLabel('Text eingeben. Maximal 4129 Zeichen:', 225, 60) Global $standardText = GUICtrlCreateEdit('', 225, 80, 800, 600, BitOR($ES_WANTRETURN, $ES_MULTILINE)) GUICtrlSetLimit(-1, 4129) #EndRegion ;**** --- **** #Region ;**** Achtes Register füllen **** Global $TabSheet8 = GUICtrlCreateTabItem("WLAN/WIFI") GUICtrlCreateGroup(' Einstellungen ', 210, 40, 420, 220) ; Kontoname GUICtrlCreateLabel('Netzwerkname (SSID):', 225, 60) Global $wifiNetzwerkname = GUICtrlCreateEdit('', 225, 80, 380, 20, BitOR($ES_WANTRETURN, $ES_MULTILINE)) ; Anzeigename GUICtrlCreateLabel('Passwort:', 225, 110) Global $wifiPasswort = GUICtrlCreateEdit('', 225, 130, 380, 20, BitOR($ES_WANTRETURN, $ES_MULTILINE)) GUICtrlCreateLabel('Verschlüsselungstyp:', 225, 160) Global $wifiSecTyp = GUICtrlCreateCombo('WPA', 225, 180, 380, 20) GUICtrlSetData($wifiSecTyp, "WPE", "WPA") Global $wifeHideSSID= GUICtrlCreateCheckbox("SSID verstecken", 225, 210, 380, 20) GUICtrlCreateGroup("", -99, -99, 1, 1) GuiCtrlGroupSetColor(210, 40, 420, 220, 0x8B008B) ; Rahmenfarbe Gruppe "QR-Code erstellen" #EndRegion ;**** --- **** #Region ;**** Neuntes Register füllen **** Global $TabSheet9 = GUICtrlCreateTabItem("Telefon") GUICtrlCreateLabel('Telefonnummer eingeben:', 225, 60) Global $telNumber = GUICtrlCreateEdit('0123 12345678', 225, 80, 380, 20, BitOR($ES_WANTRETURN, $ES_MULTILINE)) #EndRegion ;**** --- **** #Region ;**** Zehntes Register füllen **** Global $TabSheet10 = GUICtrlCreateTabItem("SMS") GUICtrlCreateLabel('SMS-Text (maximal 160 Zeichen):', 225, 60) Global $smsText = GUICtrlCreateEdit('Nur ein Test', 225, 80, 380, 20, BitOR($ES_WANTRETURN, $ES_MULTILINE)) #EndRegion ;**** --- **** #Region ;**** Elftes Register füllen **** Global $TabSheet11 = GUICtrlCreateTabItem("Kalender") ; Kontoname GUICtrlCreateLabel('Name der Veranstaltung:', 225, 60) Global $vcalWorkname = GUICtrlCreateEdit('', 225, 80, 380, 20, BitOR($ES_WANTRETURN, $ES_MULTILINE)) ; Anzeigename GUICtrlCreateLabel('Kurzbeschreibung der Veranstaltung:', 225, 110) Global $vcalDescription = GUICtrlCreateEdit('', 225, 130, 380, 60, BitOR($ES_WANTRETURN, $ES_MULTILINE)) GUICtrlCreateLabel('Beginn:', 225, 210) Global $vcalBeginn = GUICtrlCreateDate("", 225, 230, 200, 20) Global $idDate = GUICtrlCreateDate("", 440, 230, 100, 20, $DTS_TIMEFORMAT) GUICtrlCreateLabel('Beginn:', 225, 210) Global $vcalDateBeginn = GUICtrlCreateDate("", 225, 230, 200, 20) Global $vcalTimeBeginn = GUICtrlCreateDate("", 440, 230, 100, 20, $DTS_TIMEFORMAT) GUICtrlCreateLabel('Ende:', 225, 260) Global $vcalDateEnde = GUICtrlCreateDate("", 225, 280, 200, 20) Global $vcalTimeEnde = GUICtrlCreateDate("", 440, 280, 100, 20, $DTS_TIMEFORMAT) #EndRegion ;**** --- **** #Region ;**** ZwölftesRegister füllen **** Global $TabSheet12 = GUICtrlCreateTabItem("Me-Card") #EndRegion ;**** --- **** GUICtrlSetState(-1,$GUI_SHOW) GUICtrlSetPos($Pic1, 1300, 60, 360, 360) GUICtrlCreateTabItem("") Global $btFileSave = GUICtrlCreateButton('QR-Code erstellen', 6, 905, 145, 22) GUICtrlSetBkColor(-1, 0x008000) Global $btFileExit = GUICtrlCreateButton('Beenden', 6, 930, 145, 22) GUICtrlSetBkColor(-1, 0xFF7F50) GUICtrlCreateGroup(' Dateieinstellungen ', 1250, 825, 430, 123) GUICtrlCreateLabel('Ordner:', 1255, 853, 50, 17) Global $inPath = GUICtrlCreateEdit(@ScriptDir, 1315, 850, 300, 20, BitOR($ES_WANTRETURN, $ES_MULTILINE)) Global $btPath = GUICtrlCreateButton('Ordner wählen', 1516, 872, 100, 22) GUICtrlSetTip(-1, "Ordner wählen") GUICtrlCreateLabel('Dateiname:', 1255, 913, 70, 17) Global $inFile = GUICtrlCreateEdit('Daniel-Mairing-Test', 1315, 910, 300, 20, BitOR($ES_WANTRETURN, $ES_MULTILINE)) GUICtrlCreateGroup("", -99, -99, 1, 1) GuiCtrlGroupSetColor( 1250, 825, 430, 123, 0x8B008B) ; Rahmenfarbe Gruppe "Dateieinstellungen" #Region ;**** Startbild laden" **** _GDIPlus_Startup() $png = @ScriptDir & "\beispiel.png" $hImage = _GDIPlus_ImageLoadFromFile($png) $Bmp = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage) _WinAPI_DeleteObject(GUICtrlSendMsg($Pic1, $STM_SETIMAGE, $IMAGE_BITMAP, $Bmp)) #EndRegion ;**** --- **** #Region ;**** Statusbar erstellen **** $aStatusBar = _StatusbarCreate($hWnd, '75|75|70|-1', '|||', 'c|c|c|l', 'Consolas|10|0') StatusbarSetColors($aStatusBar, -1, 0x001FD3) #EndRegion ;**** --- **** GUISetState(@SW_SHOW, $hWnd) #EndRegion ### END Koda GUI section ### Global $iLastTab While True $aMsg = GUIGetMsg(1) Switch $aMsg[0] ; Programm beenden Case $btFileExit Exit ; Dateipfad festlegen Case $btPath $sPath = FileSelectFolder('Wähle den Ordner für die QR-Code-Datei', '', 7) If $sPath = '' Then $sPath = @ScriptDir GUICtrlSetData($inPath, $sPath) ; Tab-Nummer speichern Case $Tab1 $iCurrTab = GUICtrlRead($Tab1) Switch $iCurrTab Case -1 Case Else $ActiveTabCount = $iCurrTab EndSwitch ; QR-Code erstellen Case $btFileSave If $ActiveTabCount = 0 Then ___Create_2FA_Code() ElseIf $ActiveTabCount = 1 Then ___Create_Email_Code() ElseIf $ActiveTabCount = 2 Then ___Create_Giro_Code() ElseIf $ActiveTabCount = 3 Then ___Create_Web_Code() ElseIf $ActiveTabCount = 4 Then ___Create_VCard_Code() ElseIf $ActiveTabCount = 5 Then ___Create_Micro_Code() ElseIf $ActiveTabCount = 6 Then ___Create_Standard_Code() ElseIf $ActiveTabCount = 7 Then ___Create_WiFi_Code() ElseIf $ActiveTabCount = 8 Then ___Create_Phone_Code() ElseIf $ActiveTabCount = 9 Then ___Create_SMS_Code() ElseIf $ActiveTabCount = 10 Then ___Create_Cal_Code() ElseIf $ActiveTabCount= 11 Then ___Create_MeCard_Code() Else MsgBox(64,"Hinweis", "Im gewählten Tab sind noch keine Funktionen enthalten") EndIf EndSwitch ; Eingabefelder bei Mausklick leeren $aInfo = GUIGetCursorInfo($hWnd) If $aInfo[2] Then If $aInfo[4] = $editAddress Then GUICtrlSetData($editAddress, "") If $aInfo[4] = $vCode Then GUICtrlSetData($vCode, "") If $aInfo[4] = $inFile Then GUICtrlSetData($inFile, "") If $aInfo[4] = $editSubject Then GUICtrlSetData($editSubject, "") If $aInfo[4] = $editBody Then GUICtrlSetData($editBody, "") If $aInfo[4] = $inPath Then GUICtrlSetData($inPath, "") EndIf WEnd #Region ;**** 2FA-Code erstellen **** Func ___Create_2FA_Code() $strMfaText = "otpauth://" & ((GuiCtrlRead($mfaTimebased) = $GUI_CHECKED = True) ? "t" : "h") & "otp/" $strMfaText = $strMfaText & (GuiCtrlRead($mfaName) <> "" ? GuiCtrlRead($mfaName) & ":" & GuiCtrlRead($mfaKonto) : GuiCtrlRead($mfaKonto)) $strMfaText = StringReplace($strMfaText, "@", "%40") $strMfaText = $strMfaText & "?secret=" & GuiCtrlRead($mfaSecure) $strMfaText = (GuiCtrlRead($mfaHerausgeber) <> "" ? $strMfaText & "&issuer=" & GuiCtrlRead($mfaHerausgeber) : $strMfaText) $strMfaText = (GuiCtrlRead($mfaImage) <> "" ? $strMfaText & "&image=" & GuiCtrlRead($mfaImage) : $strMfaText) If GuiCtrlRead($mfaStandard) = $GUI_CHECKED = False Then $strReplaces = StringReplace(GuiCtrlRead($mfaTimeOut), "s", "") $strMfaText = GuiCtrlRead($mfaTimebased) = $GUI_CHECKED = True ? $strMfaText & "%26period=" & $strReplaces : $strMfaText & "&counter=" & GuiCtrlRead($mfaCounter) $strMfaText = $strMfaText & "&algorithm=" & GuiCtrlRead($mfaCodierung) $strMfaText = $strMfaText & "&digits=" & GuiCtrlRead($mfaDigits) Else ;$strMfaText = $strMfaText & "&period=30" & "&algorithm=SHA1" & "&digits=6" EndIf QR_generatePNG($strMfaText, CreateFullPath() & 'png', 10, 4, 0) $iErr = @error _GDIPlus_Startup() $png = GUICtrlRead($inPath) & "\" & GUICtrlRead($inFile) & ".png" $hImage = _GDIPlus_ImageLoadFromFile($png) $Bmp = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage) _WinAPI_DeleteObject(GUICtrlSendMsg($Pic1, $STM_SETIMAGE, $IMAGE_BITMAP, $Bmp)) $iErr = @error StatusbarSetColors($aStatusBar, -1, 0x001FD3) StatusBarShowResult() EndFunc #EndRegion ;**** --- **** #Region ;**** QR-Email erstellen **** Func ___Create_Email_Code() QR_generatePNG("MATMSG:TO:" & GUICtrlRead($editAddress) & ";SUB:" & GUICtrlRead($editSubject) & ";BODY:" & GUICtrlRead($editBody) & ";;", CreateFullPath() & 'png', 10, 4, 0) _GDIPlus_Startup() $png = GUICtrlRead($inPath) & "\" & GUICtrlRead($inFile) & ".png" $hImage = _GDIPlus_ImageLoadFromFile($png) $Bmp = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage) _WinAPI_DeleteObject(GUICtrlSendMsg($Pic1, $STM_SETIMAGE, $IMAGE_BITMAP, $Bmp)) $iErr = @error StatusbarSetColors($aStatusBar, -1, 0x001FD3) StatusBarShowResult() EndFunc #EndRegion ;**** --- **** #Region ;**** Giro-Code erstellen **** Func ___Create_Giro_Code() ; MsgBox(64, "Hinweis", "Giro-Code kann noch nicht erstellt werden.") $strGiroText = $giroTag & @CRLF $strGiroText = $strGiroText & GUICtrlRead($giroVersion) & @CRLF $strGiroText = $strGiroText & GUICtrlRead($giroCodierung) & @CRLF $strGiroText = $strGiroText & GUICtrlRead($giroArt) & @CRLF $strGiroText = $strGiroText & GUICtrlRead($giroBic) & @CRLF $strGiroText = $strGiroText & GUICtrlRead($giroInhaber) & @CRLF $strGiroText = $strGiroText & GUICtrlRead($giroIBAN) & @CRLF $strGiroText = $strGiroText & "EUR" & GUICtrlRead($giroBetrag) & @CRLF $strGiroText = $strGiroText & GUICtrlRead($giroChar) & @CRLF $strGiroText = $strGiroText & GUICtrlRead($giroRef) & @CRLF $strGiroText = $strGiroText & GUICtrlRead($giroZweck) & @CRLF $strGiroText = $strGiroText & GUICtrlRead($giroOpt) $strGiroText = StringReplace($strGiroText, " ", Chr(160)) QR_generatePNG($strGiroText, CreateFullPath() & 'png', 10, 4, 0) _GDIPlus_Startup() $png = GUICtrlRead($inPath) & "\" & GUICtrlRead($inFile) & ".png" $hImage = _GDIPlus_ImageLoadFromFile($png) $Bmp = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage) _WinAPI_DeleteObject(GUICtrlSendMsg($Pic1, $STM_SETIMAGE, $IMAGE_BITMAP, $Bmp)) $iErr = @error StatusbarSetColors($aStatusBar, -1, 0x001FD3) StatusBarShowResult() EndFunc #EndRegion ;**** --- **** #Region ;**** WebCode erstellen **** Func ___Create_Web_Code() QR_generatePNG(GUICtrlRead($webAddress), CreateFullPath() & 'png', 10, 4, 0) _GDIPlus_Startup() $png = GUICtrlRead($inPath) & "\" & GUICtrlRead($inFile) & ".png" $hImage = _GDIPlus_ImageLoadFromFile($png) $Bmp = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage) _WinAPI_DeleteObject(GUICtrlSendMsg($Pic1, $STM_SETIMAGE, $IMAGE_BITMAP, $Bmp)) $iErr = @error StatusbarSetColors($aStatusBar, -1, 0x001FD3) StatusBarShowResult() EndFunc #EndRegion ;**** --- **** #Region ;**** VCard erstellen **** Func ___Create_VCard_Code() MsgBox(64, "Hinweis", "VCard kann noch nicht erstellt werden.") EndFunc ; VCard, Kalender, MECard #EndRegion ;**** --- **** #Region ;**** MicroCode erstellen **** Func ___Create_Micro_Code() QR_generatePNG(GUICtrlRead($microText), CreateFullPath() & 'png', 10, 4, 0) _GDIPlus_Startup() $png = GUICtrlRead($inPath) & "\" & GUICtrlRead($inFile) & ".png" $hImage = _GDIPlus_ImageLoadFromFile($png) $Bmp = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage) _WinAPI_DeleteObject(GUICtrlSendMsg($Pic1, $STM_SETIMAGE, $IMAGE_BITMAP, $Bmp)) $iErr = @error StatusbarSetColors($aStatusBar, -1, 0x001FD3) StatusBarShowResult() EndFunc #EndRegion ;**** --- **** #Region ;**** Standard erstellen **** Func ___Create_Standard_Code() QR_generatePNG(GUICtrlRead($standardText), CreateFullPath() & 'png', 10, 4, 0) _GDIPlus_Startup() $png = GUICtrlRead($inPath) & "\" & GUICtrlRead($inFile) & ".png" $hImage = _GDIPlus_ImageLoadFromFile($png) $Bmp = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage) _WinAPI_DeleteObject(GUICtrlSendMsg($Pic1, $STM_SETIMAGE, $IMAGE_BITMAP, $Bmp)) $iErr = @error StatusbarSetColors($aStatusBar, -1, 0x001FD3) StatusBarShowResult() EndFunc #EndRegion ;**** --- **** #Region ;**** WiFi-Code erstellen **** Func ___Create_WiFi_Code() $strWifiText = "WIFI:T:" $strWifiText = $strWifiText & GUICtrlRead($wifiSecTyp) & ";" $strWifiText = $strWifiText & "S:" & GUICtrlRead($wifiNetzwerkname) & ";" $strWifiText = $strWifiText & "P:" & GUICtrlRead($wifiPasswort) & ";" $strWifiText = GuiCtrlRead($wifeHideSSID) = $GUI_CHECKED = True ? $strWifiText & "H:" & "true;" : $strWifiText & ";" QR_generatePNG($strWiFiText, CreateFullPath() & 'png', 10, 4, 0) _GDIPlus_Startup() $png = GUICtrlRead($inPath) & "\" & GUICtrlRead($inFile) & ".png" $hImage = _GDIPlus_ImageLoadFromFile($png) $Bmp = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage) _WinAPI_DeleteObject(GUICtrlSendMsg($Pic1, $STM_SETIMAGE, $IMAGE_BITMAP, $Bmp)) $iErr = @error StatusbarSetColors($aStatusBar, -1, 0x001FD3) StatusBarShowResult() EndFunc #EndRegion ;**** --- **** #Region ;**** Telefon erstellen **** Func ___Create_Phone_Code() QR_generatePNG("tel:" & GUICtrlRead($telNumber), CreateFullPath() & 'png', 10, 4, 0) _GDIPlus_Startup() $png = GUICtrlRead($inPath) & "\" & GUICtrlRead($inFile) & ".png" $hImage = _GDIPlus_ImageLoadFromFile($png) $Bmp = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage) _WinAPI_DeleteObject(GUICtrlSendMsg($Pic1, $STM_SETIMAGE, $IMAGE_BITMAP, $Bmp)) $iErr = @error StatusbarSetColors($aStatusBar, -1, 0x001FD3) StatusBarShowResult() EndFunc #EndRegion ;**** --- **** #Region ;**** SMS-Code erstellen **** Func ___Create_SMS_Code() QR_generatePNG("smsto:" & GUICtrlRead($smsText), CreateFullPath() & 'png', 10, 4, 0) _GDIPlus_Startup() $png = GUICtrlRead($inPath) & "\" & GUICtrlRead($inFile) & ".png" $hImage = _GDIPlus_ImageLoadFromFile($png) $Bmp = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage) _WinAPI_DeleteObject(GUICtrlSendMsg($Pic1, $STM_SETIMAGE, $IMAGE_BITMAP, $Bmp)) $iErr = @error StatusbarSetColors($aStatusBar, -1, 0x001FD3) StatusBarShowResult() EndFunc #EndRegion ;**** --- **** #Region ;**** Kalender erstellen **** Func ___Create_Cal_Code() MsgBox(64, "Hinweis", "Kalender-Code kann noch nicht erstellt werden.") EndFunc #EndRegion ;**** --- **** #Region ;**** Me-Card erstellen **** Func ___Create_MeCard_Code() MsgBox(64, "Hinweis", "Me-Card kann noch nicht erstellt werden.") EndFunc #EndRegion ;**** --- **** #Region ;**** Pfad erstellen **** Func CreateFullPath() $sFile = GUICtrlRead($inFile) If $sFile = '' Then $sFile = _QR_FileDefault() If StringRegExp($sFile, '(?i)\.bmp|png') Then $sFile = StringTrimRight($sFile, 4) GUICtrlSetData($inFile, $sFile) Return StringFormat('%s\%s.', $sPath, $sFile) EndFunc #EndRegion ;**** --- **** #Region ;*** Resultate in Statusbar schreiben **** Func StatusBarShowResult() Local Static $iRed = 0xDB0E00, $iGreen = 0x289916 Local $tRes = _QR_getLastCall() StatusbarSetColors($aStatusBar, 1, ($tRes.success ? $iGreen : $iRed)) Local $aText[4] = [($tRes.type = 'B' ? 'HBMP': ($tRes.type = 'C' ? 'CLIPBOARD' : ($tRes.type = 'R' ? 'RESIZED' : 'FILECREATE'))), _ ($tRes.success ? 'SUCCES' : 'FAILED'), ($tRes.success ? StringFormat('%dx%d', $tRes.width, $tRes.width) : ''), _ ($tRes.type = 'F' ? ShrinkPath($tRes.output) : '')] If $tRes.type = 'R' Then $aText[3] = ($tRes.width = -1 ? $tRes.output : ShrinkPath($tRes.output)) If $tRes.width = -1 Then StatusbarSetColors($aStatusBar, 3, $iRed) EndIf StatusbarSetText($aStatusBar, '0|1|2|3', $aText) EndFunc #EndRegion ;**** --- **** #Region ;**** Pfadagaben bereinigen **** Func ShrinkPath($_sPath) Local $sLeft = StringLeft($_sPath, 3) Local $sRight = StringTrimLeft($_sPath, (StringInStr($_sPath, '\', 0, -1) -1)) Return StringFormat('%s..%s', $sLeft, $sRight) EndFunc #EndRegion ;**** --- **** #Region ;**** Gruppenrahmen färben **** Func GuiCtrlGroupSetColor($iLeft, $iTop, $iWidth, $iHeight, $iBorderColor = 0x8B008B, $iBkGndCol0r = $GUI_BKCOLOR_TRANSPARENT) GUICtrlCreateGraphic($iLeft, $iTop, $iWidth, $iHeight) GUICtrlSetGraphic(-1, $GUI_GR_COLOR, $iBorderColor, $iBkGndCol0r) GUICtrlSetGraphic(-1, $GUI_GR_RECT, -1, 7, $iWidth, $iHeight - 7) EndFunc #EndRegion ;**** --- ****