473,802 Members | 2,015 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Armin - Start sound problem revived in new thread

Armin,
Renewing my request for help to have a different Windows Start Sound for
each day of the week.

I have started again completely. Opened a new project called Windows
Application 1 and immediately selected the menu View/Code and entered the
text amended as suggested so that
Form 1.vb* now reads:
Public Class Form1

Private Declare Function sndPlaySound Lib

"winmm.dll" Alias _

"sndPlaySou ndA" (ByVal FileName As String, _

ByVal Flags As Integer) As Boolean

Private Sub Form1_Load( _

ByVal sender As System.Object, _

ByVal e As System.EventArg s) _

Handles MyBase.Load

Dim day As Integer

Dim filename As String

day = Weekday(Now, FirstDayOfWeek. System)

filename = "C:\start sound\day" & day & ".wav"

Msgbox(sndPlayS ound(filename, 1))

End Sub

End Class

At the foot now there is an error list with 2 errors. The first at line 2
Col 41 reads "String constant expected" and the second at line4 col 1 reads
"Syntax error".

The section at the right headed Data Sources records that my project
currently has no data sources associated and invites me to add New Data
Source and "data bind items etc"
I really feel out of my depth. I'm happy to press on but will be totally
reliant on help if you remain happy to assist.
--
Regards, Jack Sadie
ja************@ yahooREMOVE.co. uk
Jan 3 '06
11 1179
"Jack Sadie" <ja*******@btin ternet.com> schrieb
Armin, Back again and thanks for your good wishes.
I hope you feel better now. :-)
During my sickness I did a lot of thinking about what I'm trying to
achieve and believe there may be a MUCH better approach if you
remain interested. In order to get the timing right, it makes sense
to use the Windows control panel to set the start sound.
Therefore what I'd like to design is a routine which can be set in
the start up folder and which will:-

1. Delete FilenameX in Filepath\Folder B
2. If the day is Monday, copy File1 from Filepath\Folder A to
Filepath\Folder B with the new name FilenameX, or
3. If the day is Tuesday, copy File2 from Filepath\Folder A to
Filepath\Folder B with the new name FilenameX, or..........
4. ........etc for each day of the week.

In that way the file will be changed daily, ready for the next day's
startup, and it does not matter at what stage in the boot sequence
it is executed. I expect it will execute after that day's sound has
been invoked, but it would not really matter if it executed earlier.

Does that make sense ?
Not to me. Sorry. :-) You are saying "next day's startup" - what if it's
started 3 days later? Wrong sound. I think the way you did it before is much
more straightforward : Play the sound for the day when it's started.

TIA =:>)~ (~ is because I have a beard!)


From today I don't have one anymore. :) (but I do have a nose ;o)
Armin

Jan 11 '06 #11
Ok., Armin.

Well thanks to you that works now already, except I need to delete the Form.
And
hopefully I should be able to achieve that by myself now.
Thanks for having stayed with me. {:>)~
--
Regards, Jack Sadie
ja************@ yahooREMOVE.co. uk
"Armin Zingler" <az*******@free net.de> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
"Jack Sadie" <ja*******@btin ternet.com> schrieb
Armin, Back again and thanks for your good wishes.


I hope you feel better now. :-)
During my sickness I did a lot of thinking about what I'm trying to
achieve and believe there may be a MUCH better approach if you
remain interested. In order to get the timing right, it makes sense
to use the Windows control panel to set the start sound.
Therefore what I'd like to design is a routine which can be set in
the start up folder and which will:-

1. Delete FilenameX in Filepath\Folder B
2. If the day is Monday, copy File1 from Filepath\Folder A to
Filepath\Folder B with the new name FilenameX, or
3. If the day is Tuesday, copy File2 from Filepath\Folder A to
Filepath\Folder B with the new name FilenameX, or..........
4. ........etc for each day of the week.

In that way the file will be changed daily, ready for the next day's
startup, and it does not matter at what stage in the boot sequence
it is executed. I expect it will execute after that day's sound has
been invoked, but it would not really matter if it executed earlier.

Does that make sense ?


Not to me. Sorry. :-) You are saying "next day's startup" - what if it's
started 3 days later? Wrong sound. I think the way you did it before is
much more straightforward : Play the sound for the day when it's started.

TIA =:>)~ (~ is because I have a beard!)


From today I don't have one anymore. :) (but I do have a nose ;o)
Armin

Jan 11 '06 #12

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
4059
by: Andrew Poulos | last post by:
As a follow on to the 'fun' I had with IE I'm now trying to play sounds using an Object tag (no Embed) in MZ. Sadly whenever 'playButton' gets clicked MZ says that "audObj.Play is not a function": window.onload = function() { var audObj = document.createElement("object"); audObj.setAttribute("id", "objmedia"); audObj.setAttribute("type","audio/x-aiff"); audObj.setAttribute("data","media/aif_sample.aif");
10
1207
by: Jack Sadie | last post by:
I am using Windows XP and I have found out how to substitute my own wav sound for the Microsoft default sound when my computer starts, but now I want to go a step further. I have created 7 different wave files (C:\Start sound\day1.wav to C:\Start sound\day7.wav respectively) and want to have a different one open according to the day of the week - the "day1.wav" opening on Mondays and the "day2.wav" on Tuesdays and so on. I have...
37
8911
by: ales | last post by:
Hello, I have a problem with creation of new thread. The method .Start() of newly created thread delays current thread for 0 - 1 second. Cpu while delay occurs is about 5%. Any idea? Here is code used for measuring:
17
6448
by: UJ | last post by:
Is there any way for a windows service to start a windows program ? I have a service that will need to restart a windows app if it needs to. TIA - Jeff.
4
1693
by: gazza67 | last post by:
Hi, Does anyone know how to check for when a sound has finished playing? I am currently using the SoundPlayer, there doesnt seem to be any event for this - am I missing something? Gary
0
1532
by: Yue Fei | last post by:
I have a multi thread python code, threads can start immediately if I run on command line, but I can get them started right the way if I call the same code from C/C++. test code like this: from threading import Thread import thread class testThread(Thread): def __init__ (self, id): Thread.__init__(self) self.id = id def run(self):
3
7841
by: Jack | last post by:
Hi, I'm writing a simple wav player (like winamp) and using the SoundPlayer class in c# 2005. Using winform buttons, I can begin playing the sound and stop half-way through the sound using: myPlayer.Play() and myPlayer.Stop() methods which works great, but i want to know when the sound actually stops playing (so I can change my button's picture). If I raise a custom event after the myPlayer.Play()
9
1428
by: =?Utf-8?B?anVhbg==?= | last post by:
How can I do to start a thread. I tried everything... but it had no work. Any solution? It is a Sub working with a Timer control. I want to do two tasks at the same time (more or less for a minute). Visual Basic 2005. Thanks.
1
2480
by: desturrr | last post by:
Hello all, I have small sized mp3 files that i can play via Java using JLayerPlayer that takes the address of mp3 files , JLayerPlayer objects can be played creating threads and starting. The problem is when i have for example 9 sounds and i want it them to play in consecutively , so i put them in for loop like: for(int i=1;i<mainNotaList.size()+1;i++) { neyBox1.arrangeNeyImage(mainNotaList.get(i-1)); ...
0
9699
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9562
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10305
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10285
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10063
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7598
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5622
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4270
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3792
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.