|
himuskanhere wrote: Hinding from TASK bar.
To prevent the window button from being placed on the taskbar, create the unowned window with the WS_EX_TOOLWINDOW extended style. As an alternative, you can create a hidden window and make this hidden window the owner of your visible window.
himuskanhere wrote: and font chang of caption TEXT.
See here[^]
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
modified on Thursday, August 7, 2008 5:24 AM
|
|
|
|
|
hi ,
I have an application where in i need to change the speed of the file ,
am able to change tat using MCIWNDSETSPEED() where in it is changing the pitch of the file along with the
speed,...but i need to change only the speed like in windows media player...where in speeding up the file just changes the frames per second of the file...
and also could anyone help me changing the speed of an wav file...
thanks in advance,
Hari
|
|
|
|
|
This isn't a direct answer to your question, but I've heard of a product called "Seventh String", which changes the speed of music WITHOUT changing the pitch. There was a discussion about the technology used, which involved forrier transforms.
|
|
|
|
|
can you show me a sample ???
|
|
|
|
|
|
Hi all
I need to clarify a point with the usage of mutex locking .
mutexlock(&mutexobj);
Function1(socket &lnk);
mutexunlock(&mutexobj);
In Function1()
{
mutexlock(&mutexobj);
globalvar1= globalvar2;
mutexunlock(&mutexobj);
}
My questions :
-> Is it right/necessary to mutex lock inside Function1()? I understand a global lock/unlock surrounding the call to Function1() will ensure that the whole code / critical resources are thread safe .
I find such occurance of such locking/unlocking in many areas of the code I am working with . Is it not a problem ? .
redindian
|
|
|
|
|
You can re-enter the same mutex twice from the same thread: as you are owning it, you won't block when you try to lock it from the same thread. This prevents deadlock situation (if it you block, then re-entering it would cause a deadlock).
|
|
|
|
|
Thanks . But what I am curious about is - why should there be a lock/unlock inside Function1() when the whole function call is already locked ?.
redindian
|
|
|
|
|
In that particular case it doesn't make any sense. But sometimes, when you have a function with multiple 'paths' and some of them call Function1(), then you would like to still lock the full function. But I agree, it is a bit messy...
|
|
|
|
|
In the case of Mutex, Multiple Lock will not be a problem, but Mutiple unlock creates some problem. The first mutexunlock ( I guess mutexunlock is internally calling ReleaseMutex() ) will release the mutex and so the rest of the code will not be having any effect of the mutex.
|
|
|
|
|
Naveen wrote: The first mutexunlock ( I guess mutexunlock is internally calling ReleaseMutex()) will release the mutex
No, this is not correct. From MSDN[^]:
After a thread obtains ownership of a mutex, it can specify the same mutex in repeated calls to the wait-functions without blocking its execution. This prevents a thread from deadlocking itself while waiting for a mutex that it already owns. To release its ownership under such circumstances, the thread must call ReleaseMutex once for each time that the mutex satisfied the conditions of a wait function.
|
|
|
|
|
Ho ho..
I didn’t know that. Thanks for correcting
|
|
|
|
|
I think its specifically for wait functions called inside a thread . But the code I am listing does not contain any wait functions . There is a second lock/unlock when there is an access to a global variable .
Cedric
I think Naveen's point that the first call to mutexunlock will unlock the mutex object and the rest of the call to Function1() will not be threadsafe . What do you say ?
I am taking an important decision to affect many critical functions which have these occurances..
redindian
|
|
|
|
|
Read the link I provided: there's no such thing as lockmutex and unlock mutex in the Win32 API but it is a WaitForSingleObject and a ReleaseMutex instead. The wait function will have the same effect as a lockmutex when the mutex becomes available.
I don't know how you implemented the lock and unlockmutex functions but they should normally follow those rules.
|
|
|
|
|
During a function call DoEvents is not fired from a timmer, but I want to redraw / refresh the UI during the function call. pls advice
|
|
|
|
|
DoEvents? Do I smell VB?
Steve
|
|
|
|
|
No C++
void DoEvents()
{
MSG oMSG;
while(::PeekMessage(&oMSG, NULL, 0, 0, PM_NOREMOVE))
{
if(::GetMessage(&oMSG, NULL, 0, 0))
{
::TranslateMessage(&oMSG);
::DispatchMessage(&oMSG);
}
else
{
break;
}
Sleep(100); // Try to minimize CPU usage
}
}
|
|
|
|
|
What is the problem exactly ? Just call this DoEvent function in your lenghty function whenever you want to refresh your UI. I would remove the Sleep, because it is not really needed.
Anyway, I think it would have been a bit easier if you would have used a thread.
|
|
|
|
|
Thanks for responce. This DoEvent call itself is from thread
since the UI is almost frized, I am using waitableTimmer from a thread to update the progress bar, it is fine,but if I min & Maximize; the window, progress bar is ok but UI(App main window , Dlg box) in not refreshed/redrawn untill the currentl lengthy operation is done. Can not put the length process in thread. Any wise advice pls
|
|
|
|
|
ptr_Electron wrote: Can not put the length process in thread.
Why is this not possible can you explain??
Regards,
Sandip.
|
|
|
|
|
No no, Techinical possible, but not as per the req, if I need to do that much of the code required changes.
|
|
|
|
|
You have a primary thread that handles the UI and keeps it responsive. You have a secondary thread that does some work. During that work in the secondary thread, simply post a message to the primary thread telling it of the progress. This way, both threads can do what they're designed to do without worrying about the other.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Why the Sleep nonsense? Something like this looks more civilised:
void DoEvents()
{
MSG m;
while (::PeekMessage(&m, NULL, 0, 0, PM_REMOVE))
{
::TranslateMessage(&m);
::DispatchMessage(&m);
}
}
Steve
|
|
|
|
|
Did that but even then no luck
|
|
|
|
|
I didn't say it would fix your problem; I was just pointing that the Sleep is extremely poor programming and is not needed.
Steve
|
|
|
|