Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 02/17/2024 in all areas

  1. @CYCho Thanks for the heads up. I'll take a look at this later. For anyone interested, see here for more details.
    2 points
  2. @Danp2, It seems that Google changed their URL for chromedriver download to: https://storage.googleapis.com/chrome-for-testing-public/121.0.6167.184/win32/chromedriver-win32.zip
    2 points
  3. ..so you know, there is also this: ;~ RegDelete("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\DontShowMeThisDialogAgain", "MyProg") ;~ Exit #include <MsgBoxConstants.au3> #include <WinAPIDlg.au3> Local $iResult = _WinAPI_MessageBoxCheck(BitOR($MB_TOPMOST, $MB_ICONINFORMATION, $MB_CANCELTRYCONTINUE, $MB_HELP), 'MyProg', '_WinAPI_MessageBoxCheck()', 'MyProg') ConsoleWrite('Return: ' & $iResult & @CRLF) Exit
    1 point
  4. hey, I just learned that it can be up to 4 buttons ! ( BitOR($MB_CANCELTRYCONTINUE, $MB_HELP) ) So no new version number but that is something that I didn't think of. We all learn by doing Edit: fixed.
    1 point
  5. Ops, I have made some typo mistakes in the example I have wrote, but no problem I'll update the example later, also my example are too poor I haven't even able to compare both returned values from message box at same time :p. I always keep the I store UDF updated
    1 point
  6. Ok, fixed. And added a callback function just to have your joke applied mercifully You'll need the new version for this to even run. #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <MsgBoxConstants.au3> #include <MsgBox_Extn.au3> ; https://www.autoitscript.com/forum/index.php?showtopic=211499&view=findpost&p=1530323 If _MsgBox_Extn_Version() < 4 Then Exit ConsoleWrite(@CRLF & 'Get the new version UDF from:' & @CRLF & _ 'https://www.autoitscript.com/forum/topic/211499-create-a-msgbox-with-buttons-disabled-for-specific-amount-of-time/#comment-1530323' & @CRLF) #Region ### START Koda GUI section ### Form= Global $Form1 = GUICreate("Form1", 339, 131, -1, -1) Global $Label1 = GUICtrlCreateLabel("Welcome to the empty frame software :)", 72, 32, 191, 17) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### Global $MsgText, $MixButton, $anwser1, $anwser2 NagMsg() ; run function While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE GUIDelete() ExitLoop EndSwitch WEnd Func NagMsg() Local $returned, $MixQuestion, $MixAnwser, $punish $MixQuestion = Random(1, 3, 1) $MixAnwser = Random(1, 2, 1) If $MixQuestion = '1' Then ; the var $anwser1 always holds the correct anwser ! $MsgText = 'What is the easiest function newbie can learn in GUI?' $anwser1 = 'MessageBox' $anwser2 = "Function" $MixButton = $MB_YESNO ElseIf $MixQuestion = '2' Then $MsgText = 'What is the first two words every programmer learn?' $anwser1 = 'Hello World' $anwser2 = 'Message Box' $MixButton = $MB_YESNO ElseIf $MixQuestion = '3' Then $MsgText = 'What kernel are Windows based on?' $anwser1 = 'NT' $anwser2 = 'WIN_KERNEL' EndIf If $MixAnwser = '1' Then _MsgBox_Extn_SetButtonText($anwser1, $anwser2) $MixButton = $MB_YESNO Else _MsgBox_Extn_SetButtonText($anwser2, $anwser1) $MixButton = $MB_RETRYCANCEL EndIf $returned = _MsgBox_Extn(1, BitOR($MB_TOPMOST, $MB_ICONINFORMATION, $MixButton), 'Info', $MsgText, 0, $Form1) If $returned = $IDNO Then $punish = 'yes' ElseIf $returned = $IDRETRY Then $punish = 'yes' EndIf If $punish = 'yes' Then $MsgText = 'You have selected a wrong anwser !' & @CRLF $MsgText &= 'Now this program will punish you' & @CRLF $MsgText &= 'by wasting 60 seconds of your life :D' _MsgBox_Extn_SetCallBackFunc(HaveMercy) ConsoleWrite('using "' & FuncName(_MsgBox_Extn_SetCallBackFunc()) & '()" as callback function.' & @CRLF) $returned = _MsgBox_Extn(60, BitOR($MB_TOPMOST, $MB_ICONINFORMATION, $MB_OK), 'Info', $MsgText, 0, $Form1) _MsgBox_Extn_SetCallBackFunc(Default) ; if you're not gonna use it anymore. EndIf EndFunc ;==>NagMsg Func HaveMercy() If _MsgBox_Extn_SecCount() = 56 Then _MsgBox_Extn_SecCount(4) _MsgBox_Extn_SetMessageText('Nah, just kidding =)') EndIf EndFunc Edit: added _MsgBox_Extn_SetMessageText()
    1 point
  7. Nope. It escaped me. I'll fix it. Thanks for reporting.
    1 point
  8. c'mon !, change it to 5 sec. Should be a demo, not a torture machine !
    1 point
  9. Here's an updated example to show case use of the updated UDF here, the example uses custom text in each button of the message box This example uses random function to jump into one of the three questions If the users selects a wrong answer then the program will punish him by showing an message box with disabled button, and then the user will be required to wait until timeout is over Edit: updated the example nag_messagebox.au3: #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <MsgBoxConstants.au3> #include <MsgBox_Extn.au3>; https://www.autoitscript.com/forum/index.php?showtopic=211499&view=findpost&p=1530323 If _MsgBox_Extn_Version() < 4 Then Exit ConsoleWrite(@CRLF & 'Get the new version UDF from:' & @CRLF & _ 'https://www.autoitscript.com/forum/topic/211499-create-a-msgbox-with-buttons-disabled-for-specific-amount-of-time/#comment-1530323' & @CRLF) #Region ### START Koda GUI section ### Form= Global $Form1 = GUICreate("Form1", 339, 131, -1, -1) Global $Label1 = GUICtrlCreateLabel("Welcome to the empty frame software :)", 72, 32, 191, 17) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### Global $MsgText, $MixButton, $anwser1, $anwser2 NagMsg() ; run function While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE GUIDelete() ExitLoop EndSwitch WEnd Func NagMsg() Local $returned, $MixQuestion, $MixAnwser $MixQuestion = Random(1, 3, 1) $MixAnwser = Random(1, 2, 1) If $MixQuestion = '1' Then ; the var $anwser1 always holds the correct anwser ! $MsgText = 'What is the easiest function newbie can learn in GUI?' $anwser1 = 'MessageBox' $anwser2 = "Function" ElseIf $MixQuestion = '2' Then $MsgText = 'What is the first two words every programmer learn?' $anwser1 = 'Hello World' $anwser2 = 'Message Box' ElseIf $MixQuestion = '3' Then $MsgText = 'What kernel are Windows based on?' $anwser1 = 'NT' $anwser2 = 'WIN_KERNEL' EndIf If $MixAnwser = '1' Then _MsgBox_Extn_SetButtonText($anwser1, $anwser2) $MixButton = $MB_YESNO Else _MsgBox_Extn_SetButtonText($anwser2, $anwser1) $MixButton = $MB_RETRYCANCEL EndIf $returned = _MsgBox_Extn(0, BitOR($MB_TOPMOST, $MB_ICONINFORMATION, $MixButton), 'Info', $MsgText, 0, $Form1) If $returned = $IDNO Or $returned = $IDRETRY Then $MsgText = 'You have selected a wrong anwser !' & @CRLF $MsgText &= 'Now this program will punish you' & @CRLF $MsgText &= 'by wasting 60 seconds of your life :D' _MsgBox_Extn_SetCallBackFunc(HaveMercy) ConsoleWrite('using "' & FuncName(_MsgBox_Extn_SetCallBackFunc()) & '()" as callback function.' & @CRLF) $returned = _MsgBox_Extn(60, BitOR($MB_TOPMOST, $MB_ICONINFORMATION, $MB_OK), 'Info', $MsgText, 0, $Form1) _MsgBox_Extn_SetCallBackFunc(Default) ; if you're not gonna use it anymore. EndIf EndFunc ;==>NagMsg Func HaveMercy() If _MsgBox_Extn_SecCount() = 56 Then _MsgBox_Extn_SecCount(4) _MsgBox_Extn_SetMessageText('Nah, just kidding =)') EndIf EndFunc ;==>HaveMercy
    1 point
  10. ..maybe he's just a visual thinker. Paste your answers in a pic. just like I did
    1 point
  11. Your AI-Kungfu is stronger than mine!
    1 point
  12. Hi folks 👋 , just for your information: I added @AspirinJunkie to the list in post #1, because his awesome UDFs lay on GitHub too 👌 . That's all, cheers. Best regards Sven
    1 point
×
×
  • Create New...