yousefsamy Posted June 30, 2014 Share Posted June 30, 2014 (edited) my problem in my title i want tp play sounds or any thing in hide mode !! expandcollapse popup#include <ComboConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <Date.au3> #NoTrayIcon #RequireAdmin FileInstall("azan.mp3",@TempDir"\azan.mp3") FileCopy(@WorkingDir&"\ramadan.exe",@TempDir&"\ramadan.exe") $Ramadan = GUICreate("Ramadan", 362, 566, 308, 98) $File = GUICtrlCreateMenu("File") $Quran = GUICtrlCreateMenuItem("Listen To Quran", $File) $startup = GUICtrlCreateMenuItem("Start With System", $File) $watch = GUICtrlCreateMenuItem("Watch خواطر 10", $File) $Exit = GUICtrlCreateMenuItem("Exit", $File) $About = GUICtrlCreateMenu("About") $Visit = GUICtrlCreateMenuItem("Visit Us[Designer]", $About) $Pic1 = GUICtrlCreatePic("C:\Users\The-Wise\Desktop\صلاتى\design.jpg", 0, 0, 361, 545,$SS_GRAYFRAME) $Time = GUICtrlCreateInput("", 104, 392, 153, 37,$ES_READONLY,$WS_TABSTOP) GUICtrlSetFont(-1, 18, 800, 0, "MS Sans Serif") GUICtrlSetBkColor(-1, 0xC8C8C8) $Combo1 = GUICtrlCreateCombo("الفجر", 88, 288, 185, 25, BitOR($CBS_DROPDOWN,$CBS_SIMPLE)) GUICtrlSetData( $Combo1 ,"الظهر|العصر|المغرب|العشاء") GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif") $Month = GUICtrlCreateInput("", 40, 32, 89, 32,$ES_READONLY,$WS_TABSTOP) GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif") $Year = GUICtrlCreateInput("", 256, 32, 89, 32,$ES_READONLY,$WS_TABSTOP) GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif") GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Combo1 _times() Case $Quran ShellExecute("http://www.mp3quran.net/radio/basitmjd_radio.html") Case $startup FileCreateShortcut(@TempDir&"\ramadan.exe",@StartupCommonDir&"\ramadan.exe",@TempDir&"\ramadan.exe") Case $watch ShellExecute("http://www.youtube.com/channel/UC_Ds7nedV3NqYf0zhpYti4A") Case $Exit Exit Case $Visit ShellExecute("https://www.facebook.com/ZOLODESIGNANDPHOTOGRAPHY") EndSwitch $t = _NowTime(3) $alarm = @HOUR&":"&@MIN&":"&@SEC GUICtrlSetData($Time,$t) GUICtrlSetData($Month,@MON) GUICtrlSetData($Year,@YEAR) If $alarm = "03:16:00" Then ;here is my problem ShellExecute(@TempDir&"\azan.mp3",@SW_HIDE) WEnd Func _times() $k = GUICtrlRead($Combo1) If $k = "الفجر" Then MsgBox(0,"توقيت الصلاة","03:16 صباحا") ElseIf $k = "الظهر" Then MsgBox(0,"توقيت الصلاة","12:00 مساءاً") ElseIf $k = "العصر" Then MsgBox(0,"توقيت الصلاة","03:34 مساءاً") ElseIf $k = "المغرب" Then MsgBox(0,"توقيت الصلاة","07:02 مساءاً") ElseIf $k = "العشاء" Then MsgBox(0,"توقيت الصلاة","08:33 مساءاً") EndIf EndFunc Edited June 30, 2014 by yousefsamy Link to comment Share on other sites More sharing options...
somdcomputerguy Posted June 30, 2014 Share Posted June 30, 2014 The ShellExecute function doesn't have the all the parameters set. To use '@SW_HIDE', which should be the last parameter, one needs to set the three parameters before it. Refer to the Help file to see how to use blank, or no, or empty parameters. ' - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
yousefsamy Posted June 30, 2014 Author Share Posted June 30, 2014 somdcomputerguy really i tried that with no result at the end Link to comment Share on other sites More sharing options...
Solution somdcomputerguy Posted July 1, 2014 Solution Share Posted July 1, 2014 This code worked fine for me. On the computer I'm using right now, Windows Media Player is the default 'player' of MP3 files. ShellExecute("foghorn.mp3", "", "", "open", @SW_HIDE) Note that the path and filename of the MP3 file are different than what you are using, but that should not matter. - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
yousefsamy Posted July 1, 2014 Author Share Posted July 1, 2014 but if i forget open word it cant be hidden why ? Link to comment Share on other sites More sharing options...
somdcomputerguy Posted July 1, 2014 Share Posted July 1, 2014 This is taken from the Help file: When no verb is specified the default verb is used. The default verb is the verb configured in the registry. If no verb is set as default in the registry then the "open" verb is used. If the "open" verb is not present then the first verb listed in the registry is used. I don't know how your computer is configured, so I would recommend that you don't forget to use that verb if that works for you. yousefsamy 1 - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
yousefsamy Posted July 1, 2014 Author Share Posted July 1, 2014 yea i understand thnx alot Link to comment Share on other sites More sharing options...
somdcomputerguy Posted July 1, 2014 Share Posted July 1, 2014 (edited) You know, I was using the SoundPlay function in one of my scripts, and sometimes it just didn't seem to work. I have replaced that line with that ShellExecute line of code that I posted above, and it works a whole lot better. So by trying to help you, I have helped myself! So, thanks! edit: You will probably end up having to use the ProcessClose function afterwords, so the code I'm using is - ShellExecuteWait("foghorn.mp3", "", "", "open", @SW_HIDE) ProcessClose("wmplayer.exe") Refer to the Help file for descriptions of the ShellExecuteWait and ProcessClose functions. Edited July 1, 2014 by somdcomputerguy yousefsamy 1 - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
somdcomputerguy Posted July 1, 2014 Share Posted July 1, 2014 موفق باشید و برنامه نویسی خوب (Good luck and good programming) Is that right? yousefsamy 1 - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
yousefsamy Posted July 1, 2014 Author Share Posted July 1, 2014 no i think u translated it in Persian ,, in Arabic it should be : حظ موفق و برمجة جيدة Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted July 1, 2014 Moderators Share Posted July 1, 2014 somdcomputerguy,And where is the "© Melba23" sign? M23 yousefsamy 1 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: Spoiler 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 Link to comment Share on other sites More sharing options...
yousefsamy Posted July 1, 2014 Author Share Posted July 1, 2014 Melba23 hhhh yea all rights for you Link to comment Share on other sites More sharing options...
somdcomputerguy Posted July 1, 2014 Share Posted July 1, 2014 somdcomputerguy, And where is the "© Melba23" sign? M23 - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
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