Kurto2021 Posted May 17, 2011 Posted May 17, 2011 Is there a way to create a message box that I can then say "Execute A", "Execute B", or "Execute C" instead of the default options that a message box gives?
wakillon Posted May 17, 2011 Posted May 17, 2011 See guicreate function and add some buttons... AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts
Moderators Melba23 Posted May 17, 2011 Moderators Posted May 17, 2011 Kurto2021,Look at the ExtMsgBox UDF in my sig. M23 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: Reveal hidden contents ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
Kurto2021 Posted May 17, 2011 Author Posted May 17, 2011 (edited) Melba thanks for the info...seems like it might be beyond my comprehension at this point in time but I am going to try and go through it. edit aha....figured out how you are using the other files.....there is an include....I will learn this damn thing Edited May 17, 2011 by Kurto2021
Moderators Melba23 Posted May 18, 2011 Moderators Posted May 18, 2011 Kurto2021, Quote ....I will learn this damn thingYou know where I am if you need help. M23 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: Reveal hidden contents ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
Kurto2021 Posted May 18, 2011 Author Posted May 18, 2011 I have torn it apart and started to figure it out....I basically shoehorned in your 2 files into my existing code and edited the pick list options and it working as desired. This damn forum amazes me every time. Thanks
Moderators Melba23 Posted May 18, 2011 Moderators Posted May 18, 2011 Kurto2021, Quote shoehorned in your 2 files into my existing codeWhy not leave it as an include? #include <ExtMsgBox.au3> _ExtMsgBoxSet(0, 0, 0xFFCCCC, 0x008000) Switch _ExtMsgBox(0, "Execute A|Execute B|Execute C", "Chooser", "What do you want to execute?") Case 1 MsgBox(0, "Answer", "You pressed A") Case 2 MsgBox(0, "Answer", "You pressed B") Case 3 MsgBox(0, "Answer", "You pressed C") EndSwitch Seems simpler that way to me. M23 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: Reveal hidden contents ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
Kurto2021 Posted May 18, 2011 Author Posted May 18, 2011 that is pretty much what I did...I just used your files and got it to do what I wanted.....as I go through your files more I will learn more and more.
Moderators Melba23 Posted May 19, 2011 Moderators Posted May 19, 2011 Kurto2021,It was just that "shoehorned in your 2 files into my existing code" made me think that you had acted differently. Do not hesitate to ask if you have any difficulties following any of the code. M23 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: Reveal hidden contents ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
xroot Posted May 19, 2011 Posted May 19, 2011 (edited) On 5/17/2011 at 6:25 PM, 'Kurto2021 said: Is there a way to create a message box that I can then say "Execute A", "Execute B", or "Execute C" instead of the default options that a message box gives? Hi, Kurto2021 Here is an example using a hook message into the MsgBox so you can use the "Msgbox" instruction, no need to create a Gui and Buttons. The return ID for Execute A B C will either be 3,4,or 5. It is not to hard to figure out how it works, go and have some fun with it. expandcollapse popupFunc Hook_Proc($nCode,$wParam,$lParam) Switch $nCode Case $HCBT_ACTIVATE Local $hIcon=DllCall("user32.dll","hwnd","LoadImage","hwnd",0, _ "str",$IconFile, _ "int",$IMAGE_ICON, _ "int",0, _ "int",0, _ "int",$LR_LOADFROMFILE) DllCall("user32.dll","int","SendDlgItemMessage","hwnd",hWnd($wParam), _ "int",20, _ "int",$STM_SETIMAGE, _ "int",$IMAGE_ICON, _ "int",$hIcon[0]) ControlSetText(hWnd($wParam),"",3,"Execute A") ControlSetText(hWnd($wParam),"",4,"Execute B") ControlSetText(hWnd($wParam),"",5,"Execute C") Case Else $RET=DllCall("user32.dll","int","CallNextHookEx","hwnd",$hHook[0], _ "int",$nCode, _ "int",$wParam, _ "int",$lParam) Return $RET[0] EndSwitch Return EndFunc Global Const $HCBT_ACTIVATE=5 Global Const $STM_SETIMAGE=370 Global Const $IMAGE_ICON=1 Global Const $LR_LOADFROMFILE=16 $IconFile=@ScriptDir&"\crapper.ico" MsgBox(66,"MsgBox","Regular MsgBox Information") $hProc=DllCallbackRegister("Hook_Proc","int","int;int;int") $TID=DllCall("Kernel32.dll","int","GetCurrentThreadId") $hHook=DllCall("user32.dll","hwnd","SetWindowsHookExA","int",$HCBT_ACTIVATE, _ "ptr",DllCallbackGetPtr($hProc), _ "hwnd",0, _ "int",$TID[0]) MsgBox(66,"Custom MsgBox","MessageBox Text Information") DllCall("user32.dll","int","UnhookWindowsHookEx","hwnd",$hHook[0]) DllCallbackFree($hProc)crapper.zip Edited May 19, 2011 by xroot
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now