|
As you mentioned, it is your source code so it is rather intelligent not to look for recovering it .Just make the project once again and it will take very less time for you to develop it again as you alredy have made it previously
Kushagra
|
|
|
|
|
Hiya everyone,
Quick question: Is there any way to add a scheduled task (using windows api) without using COM? I want to make my application start on user logon and UAC on Vista stops me from adding the appropriate registry value. I've done a few quick searches, but google has yet to yield anything.
Thanks. 
|
|
|
|
|
The Windows Task Scheduler is exposed to applications only via COM interfaces.
To add to the run registry keys, you have to be an administrator.
But I'm not sure if you need admin previleges to create a shortcut in the StartUp folder.
The statup folder is at C:\Users\<username>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup .
|
|
|
|
|
Thanks for the reply, but...I don't see to have a C:\Users folder. I've never seen that folder either.
Is there any other way to make an app run on startup without having admin privileges?
|
|
|
|
|
Go to Start -> Programs -> StartUp , right click on it and select Explore .
You will now be able to see the path for the StartUp folder.
You can use the SHGetSpecialFolderLocation[^] API and give the nFolder parameter as CSIDL_STARTUP.
|
|
|
|
|
Okay, I've just realized I don't know how to make a shortcut. Any hints?
Edit: Is there any particular reason why I should use SHGetSpecialFolderLocation instead of SHGetSpecialFolderPath ?
modified on Thursday, November 5, 2009 10:44 PM
|
|
|
|
|
|
And unless I'm very much mistaken, we're back to using COM again.
No problem, thanks for your advice. 
|
|
|
|
|
COM is like alcohol. Good for anything.
|
|
|
|
|
hxhl95 wrote: Edit: Is there any particular reason why I should use SHGetSpecialFolderLocation instead of SHGetSpecialFolderPath?
It all depends on whether you want the folder's PIDL or its path. They are not interchangeable functions.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
A regular user should not be able to force another user to execute some of his code, and Vista has been the first Windows version to enforce this: regular users can't access someone else's private folders (such as StartUp), nor can they modify registry hives with global scope such as LOCAL_MACHINE.
And if you find a way to do it anyway, it is doomed to be a bug, and will be fixed in a service pack or a new release.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
|
|
|
|
That's true, but it sounds like if I use superman's method, I'll be able to get my app to run for the current user (not all users though). That sounds good enough to me. 
|
|
|
|
|
Current user is no problem, there are many ways to do it.
The personal startup folder is Environment.GetFolderPath(Environment.SpecialFolder.StartUp) which returns a different location on different Windows versions.
[EDIT]Sorry, that is .NET stuff...[/EDIT]
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
modified on Friday, November 6, 2009 6:34 PM
|
|
|
|
|
And then we run into the same problem up there (in the other "sub-thread").
It's okay, I'm going to see if I can get COM to work...my copy of the SDK doesn't have it for some reason. Going to download some other copy.
|
|
|
|
|
CP hosts several articles on creating shortcuts, such as this one[^]. Alternatively you can distribute one with your app, and copy it to where ever you want it.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
|
|
|
|
Edit: Ridiculously stupid post was here. Ignore it. Please. I did NOT write something that stupid.
Apparently I fail at reading documentation. Problem solved now, thanks a lot.
modified on Friday, November 6, 2009 8:49 PM
|
|
|
|
|
Menues on right mouse click are "Floating", "Docking", "Tabbed Document", "Auto Hide", "Hide". I have a CDockablePane that I want to remove some or all of these menu options.
Is there a way to do this (if so can you point me to an example or give me a snippet of code to do so)?
I made a class:
class CMyClass : public CDockablePane
I then wrote
IMPLEMENT_DYNAMIC(CMyClass , CDockablePane)
BEGIN_MESSAGE_MAP(CMyClass , CDockablePane)
//{{AFX_MSG_MAP(CPeepOutlookBar)
ON_WM_RBUTTONDOWN()
END_MESSAGE_MAP()
// eliminate RButton Down Menues from Navigation Pane
void
CMyClass ::OnRButtonDown(UINT nFlags, CPoint pt)
{
// don't do anything;
return;
}
but this didn't eliminate the right mouse click menu.
|
|
|
|
|
|
That is weird.
We were typing the same thing at the same time.
Rather, I was echoing what you were typing.
|
|
|
|
|
You would have been first but you wasted at least 2 seconds making your FALSE red.
Best Wishes,
-David Delaune
|
|
|
|
|
HA HA HA....
Damn. I'm never going to paint anything RED anymore.
|
|
|
|
|
|
I'm Using directsound for ogg file playback.
Also using the code I took from this website for it.
http://www.flipcode.com/archives/Ogg_Vorbis_Player_Class.shtml
It works well but I'm trying to play a 2nd music/sound file straight after the 1st finishes.
At the moment i believe the 2nd sound file plays a second just before the first finishes thus creating a rather bad mismash of a sound.
Can anyone tell me from looking at the code why this is?
The only idea I have is that it has to do with the update function and how it returns the boolean "bdone", but since I have trouble trying to understand the complex parts of code I have no idea how to fix it.
What i'm doing now is play first sound.
If the sound is finished playing (bdone=true).
play second sound.
if (flag==0)
{
oggPlayer1.Play();
flag=1;
}
if ((oggPlayer1.IsPlaying() == false) && (flag==1))
{
oggPlayer2.Play();
oggPlayer1.Close();
flag=2;
}
names have been changed from original code but it's still pretty much the same.
Thanks for any help.
|
|
|
|
|
What about:
oggPlayer1.Play();
while (oggPlayer1.IsPlaying());
oggPlayer1.Close();
oggPlayer2.Play();
while (oggPlayer2.IsPlaying());
oggPlayer2.Close();
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
I'm not sure that would work.
I did try but unsuccessfully because of this:
if (flag==1)
{
oggPlayer1.Update();
}
if (flag==2)
{
oggPlayer2.Update();
}
each instance must have it's own update.
I did try usuing brackets round the while loop but it still won't work.
The changed code looks like this.
if (flag==0)
{
oggPlayer1.Play();
flag=1;
while (oggPlayer1.StoppedPlaying()==true)
{
oggPlayer1.Close();
flag=2;
}
}
if (flag==2)
{
oggPlayer2.Play();
while (oggPlayer2.StoppedPlaying()==true);
oggPlayer2.Close();
}
Doesn't even play the second file.
Though, and this is the important part, even if it did work I'm not sure it would help. The problem is not the code for playing it's the code that tells it when it stopped.
oggPlayerX.StoppedPlaying (change of name so it's easier to understand, it is true when music is stopped) returns the value true TOO early.
At least from what I can hear.
Using my old code sound 2 seems to play before sound 1 has actually finished yet obviously sound 2 only plays once the boolean StoppedPlaying returns true.
So in essence:
Sound 1 plays
StoppedPlaying returns true
Sound 2 plays
Sound 1 audibly stops a second after sound 2 starts
|
|
|
|