Jump to content

ShellExecute(@TempDir&"\azan.mp3",@SW_HIDE) not in hide mode

Go to solution Solved by somdcomputerguy,

Recommended Posts

my problem in my title ^_^

i want tp play sounds or any thing in hide mode !!

#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Date.au3>



$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")

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
        Case $Combo1
        Case $Quran
        Case $startup
        Case $watch
        Case $Exit
        Case $Visit

    $t = _NowTime(3)
    $alarm = @HOUR&":"&@MIN&":"&@SEC



    If $alarm = "03:16:00" Then ;here is my problem


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 مساءاً")
Edited by yousefsamy
Link to post
Share on other sites

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 post
Share on other sites
  • Solution

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 post
Share on other sites

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. :)

- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Link to post
Share on other sites

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)

Refer to the Help file for descriptions of the ShellExecuteWait and ProcessClose functions.

Edited by somdcomputerguy

- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Link to post
Share on other sites
  • Moderators


And where is the "© Melba23" sign? :whistle:


Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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:


ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...