Jump to content

Partykilla

Members
  • Posts

    11
  • Joined

  • Last visited

Everything posted by Partykilla

  1. #include _Main() Func _Main() ;Initialize variables Local $GUIWidth = 250, $GUIHeight = 250 Local $ParentWin, $ParentWin_Pos, $ChildWin, $msg ;Create main/parent window $ParentWin = GUICreate("Parent GUI", $GUIWidth, $GUIHeight) $Label1 = GUICtrlCreateLabel("N/A", 30, 40, 131, 21, 0x1000) $Label2 = GUICtrlCreateLabel("N/A", 30, 110, 131, 21, 0x1000) ;Save the position of the parent window $ParentWin_Pos = WinGetPos($ParentWin, "") ;Show the parent window/Make the parent window visible GUISetState(@SW_SHOW) ;Create child window and add the parameter to make it the child of the parent window $ChildWin = GUICreate("Child GUI", $GUIWidth, $GUIHeight, $ParentWin_Pos[0] + 100, $ParentWin_Pos[1] + 100, -1, -1, $ParentWin) $Label_1 = GUICtrlCreateLabel("N/A", 30, 40, 131, 21, 0x1000) $Label_2 = GUICtrlCreateLabel("N/A", 30, 90, 131, 21, 0x1000) $Combo_2 = GUICtrlCreateCombo("", 30, 60, 130, 21) $Combo_3 = GUICtrlCreateCombo("", 30, 110, 130, 21) GUICtrlSetData($Combo_2, "50|49|48|47|46") GUICtrlSetData($Combo_3, "50|49|48|47|46") $button1 = GUICtrlCreateButton("Update (Set Labels)", 30, 200, 130, 20) ;Show the child window/Make the child window visible GUISetState(@SW_SHOW) ;Switch to the parent window GUISwitch($ParentWin) ;Loop until: ;- user presses Esc when focused to the parent window ;- user presses Alt+F4 when focused to the parent window ;- user clicks the close button of the parent window While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop ;When button is pressed, label text is changed ;to combobox value Case $msg = $button1 $data = GUICtrlRead($Combo_2) GUICtrlSetData($Label_1, $data) GUICtrlSetData($Label1, $data) $data = GUICtrlRead($Combo_3) GUICtrlSetData($Label_2, $data) GUICtrlSetData($Label2, $data) EndSelect WEnd EndFunc ;==>_Main
  2. Could you do me a little quick script example? #include _Main() Func _Main() ;Initialize variables Local $GUIWidth = 250, $GUIHeight = 250 Local $ParentWin, $ParentWin_Pos, $ChildWin, $msg ;Create main/parent window $ParentWin = GUICreate("Parent GUI", $GUIWidth, $GUIHeight) $Label_1 = GUICtrlCreateLabel("Label 1", 30, 40, 131, 21, 0x1000) $Label_1 = GUICtrlCreateLabel("Label 2", 30, 110, 131, 21, 0x1000) ;Save the position of the parent window $ParentWin_Pos = WinGetPos($ParentWin, "") ;Show the parent window/Make the parent window visible GUISetState(@SW_SHOW) ;Create child window and add the parameter to make it the child of the parent window $ChildWin = GUICreate("Child GUI", $GUIWidth, $GUIHeight, $ParentWin_Pos[0] + 100, $ParentWin_Pos[1] + 100, -1, -1, $ParentWin) $Label_1 = GUICtrlCreateLabel("Label 1", 30, 40, 131, 21, 0x1000) $Label_2 = GUICtrlCreateLabel("Label 2", 30, 90, 131, 21, 0x1000) $Combo_2 = GUICtrlCreateCombo("", 30, 60, 130, 21) $Combo_3 = GUICtrlCreateCombo("", 30, 110, 130, 21) GUICtrlSetData($Combo_2, "Item1|Item2|Item3|Item4|Item5") $button1 = GUICtrlCreateButton("Update (Set Labels)", 30, 200, 130, 20) ;Show the child window/Make the child window visible GUISetState(@SW_SHOW) ;Switch to the parent window GUISwitch($ParentWin) ;Loop until: ;- user presses Esc when focused to the parent window ;- user presses Alt+F4 when focused to the parent window ;- user clicks the close button of the parent window While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop ;When button is pressed, label text is changed ;to combobox value Case $msg = $button1 $data = GUICtrlRead($Combo_2) GUICtrlSetData($Label_1, $data) EndSelect WEnd EndFunc ;==>_Main
  3. Hello guys, I've tried to get a parent GUI to update an lable within a child GUI, but I cannot get this to work, any ideas on how to make this work? See attached file, Thanks in advance <3
  4. Thanks for replying to both of you <3 I managed to do exatly what I wanted to now Thanks for inspiring me hehe. Here is the result: #include<GUIConstantsEx.au3> #include<ButtonConstants.au3> #include<StaticConstants.au3> HotKeySet("{F4}", "GenHotkey") _Main() ; Func _Main() Local $button1, $button2 Local $msg, $results Global $output, $die GUICreate("Nokas 4 Pin Generator", 265, 150, -1, -1) GUICtrlCreatePic("nokas.gif", 170, 50, 85, 70) GUICtrlCreateLabel("GENERERT PIN KODE:", 30, 15, 150, 15) $button1 = GUICtrlCreateButton("Generer (F4)", 15, 105, 150, 30) $button2 = GUICtrlCreateButton("C", 185, 105, 65, 30, $BS_ICON) GUICtrlSetImage(-1, "shell32.dll", 240) global $output = GUICtrlCreateInput("####", 15, 45, 150, 50, BitOR($BS_PUSHLIKE, $SS_CENTER)) Global $die = GUICtrlCreateLabel(" Nokas", 185, 15, 70, 20, 0x1000) GUICtrlSetFont($output, 24, 800, "", "Comic Sans MS") GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $button1 $results = Random(1000, 9999, 1) ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $results = ' & $results & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console GUICtrlSetData($output, $results) GUICtrlSetData($die, " Ferdig") Case $msg = $button2 GUICtrlSetData($output, "####") GUICtrlSetData($die, " Klar") EndSelect If $msg = $GUI_EVENT_CLOSE Then ExitLoop WEnd EndFunc ;==>_Main ; Func GenHotkey() $results = Random(1000, 9999, 1) ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $results = ' & $results & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console GUICtrlSetData($output, $results) GUICtrlSetData($die, " Ferdig") send($results) EndFunc ;==>SendData This will just simply fill in random pincodes to keycards (Within another system by pressing F4) to access doors
  5. Yeah I cannot get it to work without failing bigtime
  6. #include's are: GUIConstantsEx.au3 ButtonConstants.au3 StaticConstants.au3>
  7. Could someone be so kaind and help me put a hotkey to send the results? This would be a Pincode generator, And I would like it to have a hotkey (F4) to: send($results) AND update the Input and Lable box. And I would like to have the hotkey disabled if it's clicked within the GUI It'll be used to generate pincodes for keycards within another software. Ty for help in advance! In short: I would like F4 to do the same as if you would click "$button1" Only to also send it to active window. <The generated pincode that is. #include #include #include _Main() Func _Main() Local $button1, $button2 Local $output, $die, $msg, $results GUICreate("Nokas 4 Pin Generator", 265, 150, -1, -1) GUICtrlCreatePic("nokas.gif", 170, 50, 85, 70) GUICtrlCreateLabel("GENERERT PIN KODE:", 30, 15, 150, 15) $button1 = GUICtrlCreateButton("Generer (F4)", 15, 105, 150, 30) $button2 = GUICtrlCreateButton("C", 185, 105, 65, 30, $BS_ICON) GUICtrlSetImage(-1, "shell32.dll", 240) $output = GUICtrlCreateInput("####", 15, 45, 150, 50, BitOR($BS_PUSHLIKE, $SS_CENTER)) $die = GUICtrlCreateLabel(" Nokas", 185, 15, 70, 20, 0x1000) GUICtrlSetFont($output, 24, 800, "", "Comic Sans MS") GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $button1 $results = Random(1000, 9999, 1) GUICtrlSetData($output, $results) GUICtrlSetData($die, " Ferdig") Case $msg = $button2 GUICtrlSetData($output, "####") GUICtrlSetData($die, " Klar") EndSelect If $msg = $GUI_EVENT_CLOSE Then ExitLoop WEnd EndFunc
  8. that one ain't working in win7..
  9. #include <GUIConstants.au3> HotKeySet("{Enter}", "terminate") MouseMove(@DesktopWidth, 0, 0) GUICreate ('Bluescreen', @DesktopWidth + '50' , @DesktopHeight + '50') GUISetBkColor (0x0000AA) GUISetIcon('shell32.dll', 295) $w = GUICtrlCreateButton(" Windows ", @DesktopWidth/2.5, 220, 99, 26) GUIctrlSetBkColor($w, 0xC0C0C0) GUICtrlSetFont($w, 17, 400, -1, "Lucida Console") GUICtrlSetColor($w, 0x0000FF) $m1 = GUICtrlCreateLabel ('An critical error has accurred.', @DesktopWidth/3, 300, 700) GUICtrlSetFont($m1, 14, 400, -1, "Lucida Console") GUICtrlSetColor($m1, 0xFFFFFF) $m2 = GUICtrlCreateLabel ('* Press Enter to return to Windows, or', @DesktopWidth/3, 340, 700) GUICtrlSetFont($m2, 14, 400, -1, "Lucida Console") GUICtrlSetColor($m2, 0xFFFFFF) $m3 = GUICtrlCreateLabel ('* Press CTRL+ALT+DEL to restart your computer. If you do this,', @DesktopWidth/3, 370, 700, 23) GUICtrlSetFont($m3, 14, 400, -1, "Lucida Console") GUICtrlSetColor($m3, 0xFFFFFF) $m4 = GUICtrlCreateLabel ('you will lose any unsaved information in all open applications.', @DesktopWidth/3, 395, 700, 23) GUICtrlSetFont($m4, 14, 400, -1, "Lucida Console") GUICtrlSetColor($m4, 0xFFFFFF) $m5 = GUICtrlCreateLabel ('Error: Most likely you are an fagit :)', @DesktopWidth/3, 445, 700) GUICtrlSetFont($m5, 14, 400, -1, "Lucida Console") GUICtrlSetColor($m5, 0xFFFFFF) $m6 = GUICtrlCreateLabel ('Press any key to continue _', @DesktopWidth/3, 540, 700, 25) GUICtrlSetFont($m6, 14, 400, -1, "Lucida Console") GUICtrlSetColor($m6, 0xFFFFFF) GUISetState (@SW_SHOW) Beep(1500,300) while 1=1 MouseMove(@DesktopWidth, 0, 0) wend Func terminate() Exit Endfunc My first script really, Feedbacks are welcome! And sure, make my script better please. -That would be fun! Best Regards EDIT: Corrected an MINOR Error.
  10. I found out myself
  11. Hi guys! So, basicly I've made an fullscreen application: GUICreate ('Main', @DesktopWidth + '1' , @DesktopHeight + '1') And I'd like the text inside it to be centered: $m1 = GUICtrlCreateLabel ('Console', 280, 300, 700) GUICtrlSetFont($m1, 14, 400, -1, "Lucida Console") GUICtrlSetColor($m1, 0xFFFFFF) Is it possible to center the text really? (Console) I know that everyone dosen't use the same resulotion as me therefor I need it centered Thanks in Advance =) -Ch
×
×
  • Create New...