Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 07/14/2017 in Posts

  1. Hi Guys, When I used to scratch the surface with Delphi5, I could only create a simple Notepad program. Now that I'm into AutoIt, I've created just a bare bone Notepad. Can be improved, but maybe this will be useful for those, like me, starting out with programming. I know there are way better notepads out there like Aupad, but, #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <APIDlgConstants.au3> #include <Memory.au3> #include <WinAPIDlg.au3> #include <WinAPIFiles.au3> Opt('WinTitleMatchMode', 3) #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Notepad", 620, 440, 192, 124) $MenuItem1 = GUICtrlCreateMenu("File") $MenuItem4 = GUICtrlCreateMenuItem("New" & @TAB & "Ctrl+N", $MenuItem1) $MenuItem5 = GUICtrlCreateMenuItem("Open" & @TAB & "Ctrl+O", $MenuItem1) $MenuItem6 = GUICtrlCreateMenuItem("Save" & @TAB & "Ctrl+S", $MenuItem1) $MenuItem17 = GUICtrlCreateMenuItem("Print" & @TAB & "Ctrl+P", $MenuItem1) $MenuItem7 = GUICtrlCreateMenuItem("Exit" & @TAB & "Ctrl+W", $MenuItem1) $MenuItem2 = GUICtrlCreateMenu("Edit") $MenuItem8 = GUICtrlCreateMenuItem("Undo" & @TAB & "Ctrl+Z", $MenuItem2) $MenuItem9 = GUICtrlCreateMenuItem("Cut" & @TAB & "Ctrl+X", $MenuItem2) $MenuItem10 = GUICtrlCreateMenuItem("Copy" & @TAB & "Ctrl+C", $MenuItem2) $MenuItem11 = GUICtrlCreateMenuItem("Paste" & @TAB & "Ctrl+V", $MenuItem2) $MenuItem12 = GUICtrlCreateMenuItem("Delete" & @TAB & "Del", $MenuItem2) $MenuItem16 = GUICtrlCreateMenu("Format") $MenuItem19 = GUICtrlCreateMenuItem("Word Wrap", $MenuItem16) $MenuItem18 = GUICtrlCreateMenuItem("Font", $MenuItem16) $MenuItem15 = GUICtrlCreateMenu("View") $MenuItem20 = GUICtrlCreateMenuItem("Status Bar", $MenuItem15) $MenuItem3 = GUICtrlCreateMenu("Help") $MenuItem13 = GUICtrlCreateMenuItem("View Help", $MenuItem3) $MenuItem14 = GUICtrlCreateMenuItem("About Notepad" & @TAB & "F1", $MenuItem3) $Edit1 = GUICtrlCreateEdit("", 0, 0, 620, 420, $ES_WANTRETURN) GUICtrlSetFont($Edit1, 10, 400, -1, "Lucida Console") GUICtrlSetData(-1, "") Dim $Form1_AccelTable[11][2] = [["^n", $MenuItem4], ["^o", $MenuItem5], ["^s", $MenuItem6], ["^p", $MenuItem17], ["^w", $MenuItem7], ["^z", $MenuItem8], ["^x", $MenuItem9], ["^c", $MenuItem10], ["^v", $MenuItem11], ["{DEL}", $MenuItem12], ["{F1}", $MenuItem14]] GUISetAccelerators($Form1_AccelTable) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE #Region --- CodeWizard generated code Start --- ;MsgBox features: Title=Yes, Text=Yes, Buttons=Yes and No, Icon=Warning If Not IsDeclared("iMsgBoxAnswer") Then Local $iMsgBoxAnswer $iMsgBoxAnswer = MsgBox(52, "Notepad Closing", "Are you sure you want to exit?") Select Case $iMsgBoxAnswer = 6 ;Yes Exit Case $iMsgBoxAnswer = 7 ;No EndSelect #EndRegion --- CodeWizard generated code Start --- Case $MenuItem4 GUICtrlSetData($Edit1, "") Case $MenuItem5 FileOpenDialog("Open Text File", @DesktopDir, "Text File (*.txt)") Case $MenuItem6 $filesave = FileSaveDialog("Save Text File", @DesktopDir, "Text File (*.txt)") $Edit1_Read = GUICtrlRead($Edit1) FileWrite($filesave, $Edit1_Read) Case $MenuItem7 #Region --- CodeWizard generated code Start --- ;MsgBox features: Title=Yes, Text=Yes, Buttons=Yes and No, Icon=Warning If Not IsDeclared("iMsgBoxAnswer") Then Local $iMsgBoxAnswer $iMsgBoxAnswer = MsgBox(52, "Notepad Closing", "Are you sure you want to exit?") Select Case $iMsgBoxAnswer = 6 ;Yes Exit Case $iMsgBoxAnswer = 7 ;No EndSelect #EndRegion --- CodeWizard generated code Start --- EndSwitch WEnd If you don't attempt something, you never know you can actually achieve that goal.
    1 point
  2. Skeletor

    Personal Login Storage

    Looks good. Will test this and feedback
    1 point
  3. A Beep music made by me Enjoy ! ;################################################### ; Mario Bros Theme ( Beep Music )################### ;################################################### ;###################### by J0keR ################## ;################################################### Beep(480,200); Beep(1568,200); Beep(1568,200); Beep(1568,200); Beep(739.99,200); Beep(783.99,200); Beep(783.99,200); Beep(783.99,200); Beep(369.99,200); Beep(392,200); Beep(369.99,200); Beep(392,200); Beep(392,400); Beep(196,400); Beep(739.99,200); Beep(783.99,200); Beep(783.99,200); Beep(739.99,200); Beep(783.99,200); Beep(783.99,200); Beep(739.99,200); Beep(83.99,200); Beep(880,200); Beep(830.61,200); Beep(880,200); Beep(987.77,400); Beep(880,200); Beep(783.99,200); Beep(698.46,200); Beep(739.99,200); Beep(783.99,200); Beep(783.99,200); Beep(739.99,200); Beep(783.99,200); Beep(783.99,200); Beep(739.99,200); Beep(783.99,200); Beep(880,200); Beep(830.61,200); Beep(880,200); Beep(987.77,400); Sleep(200); Beep(1108,10); Beep(1174.7,200); Beep(1480,10); Beep(1568,200); Sleep(200); Beep(739.99,200); Beep(783.99,200); Beep(783.99,200); Beep(739.99,200); Beep(783.99,200); Beep(783.99,200); Beep(739.99,200); Beep(783.99,200); Beep(880,200); Beep(830.61,200); Beep(880,200); Beep(987.77,400); Beep(880,200); Beep(783.99,200); Beep(698.46,200); Beep(659.25,200); Beep(698.46,200); Beep(784,200); Beep(880,400); Beep(784,200); Beep(698.46,200); Beep(659.25,200); Beep(587.33,200); Beep(659.25,200); Beep(698.46,200); Beep(784,400); Beep(698.46,200); Beep(659.25,200); Beep(587.33,200); Beep(523.25,200); Beep(587.33,200); Beep(659.25,200); Beep(698.46,400); Beep(659.25,200); Beep(587.33,200); Beep(493.88,200); Beep(523.25,200); Sleep(400); Beep(349.23,400); Beep(392,200); Beep(329.63,200); Beep(523.25,200); Beep(493.88,200); Beep(466.16,200); Beep(440,200); Beep(493.88,200); Beep(523.25,200); Beep(880,200); Beep(493.88,200); Beep(880,200); Beep(1760,200); Beep(440,200); Beep(392,200); Beep(440,200); Beep(493.88,200); Beep(783.99,200); Beep(440, 200); Beep(783.99,200); Beep(1568,200); Beep(392,200); Beep(349.23,200); Beep(392,200); Beep(440,200); Beep(698.46,200); Beep(415.2,200); Beep(698.46,200); Beep(1396.92,200); Beep(349.23,200); Beep(329.63,200); Beep(311.13,200); Beep(329.63,200); Beep(659.25,200); Beep(698.46,400); Beep(783.99,400); Beep(440,200); Beep(493.88,200); Beep(523.25,200); Beep(880,200); Beep(493.88,200); Beep(880,200); Beep(1760,200); Beep(440,200); Beep(392,200); Beep(440,200); Beep(493.88,200); Beep(783.99,200); Beep(440,200); Beep(783.99,200); Beep(1568,200); Beep(392,200); Beep(349.23,200); Beep(392,200); Beep(440,00); Beep(698.46,200); Beep(659.25,200); Beep(698.46,200); Beep(739.99,200); Beep(783.99,200); Beep(392,200); Beep(392,200); Beep(392,200); Beep(392,200); Beep(196,200); Beep(196,200); Beep(196,200); Beep(185,200); Beep(196,200); Beep(185,200); Beep(196,200); Beep(207.65,200); Beep(220,200); Beep(233.08,200); Beep(246.94,200);
    1 point
  4. @Xiengsaephan, FileWriteLine() and FileWrite() can be used for this. #include <ComboConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 615, 438, 192, 124) $Combo1 = GUICtrlCreateCombo("", 40, 24, 201, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL)) GUICtrlSetData($Combo1, "Item 1|Item 2") $Button1 = GUICtrlCreateButton("Button1", 32, 56, 57, 33) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $Button1 Local $file = FileOpen(@ScriptDir & "\Your.ini", 1) FileWriteLine($file, GUICtrlRead($Combo1)) FileClose($file) Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd KS15
    1 point
  5. well anyways I noticed that when searching for the name having the mouse move to the variable coordinate it highlighted the button so I was able to now search for that highlighted button . awesome but for education purposes is there a way to change coordinates based on subtracting from the variable?
    1 point
  6. U r welcome. Try this: Br, UEZ
    1 point
  7. I have change a bit here and there in the Excel UDF myself. Have a few requests.. Additional possibilities in the font parameters. Right now can only change bold, italic, underline. Perhaps something else than a (long) parameter list is better, different functions ? Not sure.. Font .name and .size at leastSet shading and coloring of cellsControl of borders on range / cell, both linestyle, width and colorControl of print area (mark area for printout)Run macro on excel side (execute VBA).Some examples: With Selection.Borders(xlEdgeBottom) .LineStyle = xlContinuous .ColorIndex = xlAutomatic .TintAndShade = 0 .Weight = xlThin End With With Selection.Font .Name = "Calibri" .Size = 14 .Strikethrough = False .Superscript = False .Subscript = False .OutlineFont = False .Shadow = False .Underline = xlUnderlineStyleNone .ThemeColor = xlThemeColorLight1 .TintAndShade = 0 .ThemeFont = xlThemeFontMinor End With With Selection.Interior .Pattern = xlSolid .PatternColorIndex = xlAutomatic .ThemeColor = xlThemeColorLight2 .TintAndShade = 0.399975585192419 .PatternTintAndShade = 0 End With With Selection .HorizontalAlignment = xlLeft .VerticalAlignment = xlBottom .WrapText = False .Orientation = 0 .AddIndent = False .IndentLevel = 0 .ShrinkToFit = False .ReadingOrder = xlContext .MergeCells = False End With With Selection.Borders(xlEdgeLeft) .LineStyle = xlContinuous .ColorIndex = xlAutomatic .TintAndShade = 0 .Weight = xlThin End With
    1 point
  8. GaryFrost

    GUI inside GUI

    Seems like SetParent is what you need to do. #include <GuiConstants.au3> $Main_GUI = GUICreate("Main") $Btn_Exit = GUICtrlCreateButton("E&xit", 10, 10, 90, 20) GUISetState(@SW_SHOW, $Main_GUI) $Child_GUI = GUICreate("Child", 200, 100, 10, 50, $WS_CAPTION) GUISetBkColor(0xfffaf0, $Child_GUI) $Btn_Test = GUICtrlCreateButton("Test", 10, 10, 90, 20) GUISetState(@SW_SHOW, $Child_GUI) DllCall("user32.dll", "int", "SetParent", "hwnd", WinGetHandle($Child_GUI), "hwnd", WinGetHandle($Main_GUI)) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $Btn_Exit Exit Case $Btn_Test MsgBox(0, "Test", "Hit Button on Child Window") EndSwitch WEnd
    1 point
×
×
  • Create New...