|
Is there a way to tell when any window is moving, similar to WM_MOVING or WM_WINDOWPOSCHANGING but it works for all windows?
-Raffi Yet another example of my bad programming skills.
|
|
|
|
|
You'll have to install a hook on the external processes to intercept their messages.
Jeremy L. Falcon<nobr>
Homepage : Sonork = 100.16311
"But everybody darlin' sometimes bites the hand that feeds."
"Remember in this game we call life that no one said it's fair."
"Just because you're winnin' don't mean you're the lucky ones."
Song: Breakdown - Album: Use Your Illusion II - Artist: Guns N' Roses
|
|
|
|
|
I have an application where file processing is spread over 3 DLLs (long story...)
The first DLL writes the file and the subsequent DLL read the file.
Occasionally, and on only a few systems, the file cannot be opened by the second DLL. The error is either CFileException::accessDenied or CFileException::sharingViolation. (Both have appeared)
I made sure that the file gets flushed before it is closed (helped somewhat), but the error is still occurring.
Any suggestions?
Thanks
|
|
|
|
|
I wonder if it's some kind of timing issue. What happens if you wait a little while and then try opening the file again?
Even if you win the rat race, you're still a rat.
|
|
|
|
|
If it fails for one of the listed reasons, I Sleep for a second and then try again. It usually works then (I haven't seen it fail yet).
I'd rather fix the real problem though, if possible.
|
|
|
|
|
Are you sure the file is always being closed? If you're running the app without the support of a debugger, this may go unnoticed to you. To make sure, you can write some kind of log file with the openings ans closings to determine if this is what's causing your problem.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
The close function is being called. The OS just doesn't get everything straight before the next call. I've duplicated it on a few system with a regular program.
Open for Write
Close
Flush
Open for Read (fails here)
Close
I've tried it with and without the Flush with similar results (happens less frequently with Flush)
Thanks
|
|
|
|
|
Shouldn't be Flush called before Close ?.
Andres Manggini.
Buenos Aires - Argentina.
|
|
|
|
|
Close supposedly does its own flush. I've had the call before and after the Close. It has worked better after the close.
|
|
|
|
|
Hi all,
I wish to put some images (bmp, jpg, gif) in my application. Is there a way of reducing the sometimes large image file sizes...?
For instance, I have an app that's about 30 kb big without images, but adding 2-3 of them radically changes the exe size... suddenly around 400-500 kb (of course this depends on the image size).
Any ideas?
/T
|
|
|
|
|
Bitmaps compress rather nicely.
Jeremy L. Falcon<nobr>
Homepage : Sonork = 100.16311
"But everybody darlin' sometimes bites the hand that feeds."
"Remember in this game we call life that no one said it's fair."
"Just because you're winnin' don't mean you're the lucky ones."
Song: Breakdown - Album: Use Your Illusion II - Artist: Guns N' Roses
|
|
|
|
|
i try to write a macro, which expands the source. therefore it has to jump to the actual class definition line:
ExecuteCommand "WBGoToClassDefinition"
then it has to go up and write a text - thats no problem.
in the text it should insert the name of the class. in the wizardbar, the class name is mentioned, so vc++ will know it even to "write-the-source-"-time.
do you know how i can fix my problem? suggestions?
i dont want to write a parser on my own.
(the same should work with the function name)
thx ove
|
|
|
|
|
Hi,
when you enter a wrong domain-name or a page cant be found, the ie redirects you to the msn-search page by default. Now I saw some tool (commonname I think) which changes this default behavior.
Anyone knows, how to change the default url the ie jumps to when a page cannot be accessed/found ? (basically to my favourite search engine or my own homepage...)
Thanks,
Corin
|
|
|
|
|
Click on the Search button on the toolbar.
When the search window comes up click on Customize.
Have fun....
|
|
|
|
|
what are the basic steps to make a call from PC to phone anywhare in the world using TAPI 3.0.
There are certain methods which are provided by TAPI but not supported when coded.How to cope with it.
|
|
|
|
|
i want to establish my connection with any phone number through internet using TAPI from PC and to send my voice data to that PC also inform me if any one have information about this topic later i also want to recieve data from phone
thank you
|
|
|
|
|
It all depends on the hardware at the receiving end, PC to IP phone is fairly straight forward but PC to PST requires hardware to translate.
What kind of hardware do you have involved?
Michael
Logic, my dear Zoe, merely enables one to be wrong with authority. - The Doctor
|
|
|
|
|
how can dial number sitting at PC using IP to connect with another phone
|
|
|
|
|
What kind of hardware is at both ends?
What is the exact problem you are having? TAPI 3 is fairly straight forward for making calls (the platform SDK has lots of samples)
Michael
Logic, my dear Zoe, merely enables one to be wrong with authority. - The Doctor
|
|
|
|
|
I have a need of a way to bring one application to the foreground from another application. Application 'A' is either laucnhed by itself or it can be launched from application 'B' upon a button press.
There's no guarantee which app was started first, or if the application to be brought to the foreground (app 'A') is even running at that point in time. If 'A' is not running I am launching it upon a button press in app 'B' - but if 'A' is already running I want to bring it to the foreground to alert the user it's already running (and not spawn a second instance of app 'A').
I'm currently using a mutex to check to see if app 'A' is already running, but I am not sure how to bring it to the foreground when it is.
Any thoughts or ideas on how to proceed?
: Dean 'Karnatos' Michaud
|
|
|
|
|
Try to use SetForegroundWindow() then use ShowWindow() with SW_SHOWNORMAL flag.
Michael Liu
|
|
|
|
|
To set the foreground, I need to either get:
A) hWnd for app 'B' while in app 'A' (not sure how to do that) to use "BOOL SetForegroundWindow(HWND hWnd)"
B) Get a pointer to the CWnd of app 'B' (not sure how to do this either) to use "BOOL CWnd::SetForegroundWindow( )"
: Dean 'Karnatos' Michaud
|
|
|
|
|
Are you running under W2K or XP? If so, SetForegroundWindow no longer works unless you own the process. There is a workaround - you attach your thread to the thread with current foreground thread and then SetForegroundWindow works. Check the link for a good example.
D
http://www.mooremvp.freeserve.co.uk/Win32/framed_tip033.htm
|
|
|
|
|
I need to support Win98 to WinXP... I'd noticed in the MSDN Library that SetForegroundWindow() was not working as it had before in WinXP. Thank you though
: Dean 'Karnatos' Michaud
|
|
|
|
|
Ok, after mucking around with this a little more, seems this is *one* way of getting the job done.
I am calling this code once a button is pressed to bring up an application to the foreground.
1) CWnd::FindWindow() finds the window based on the file name.
2) CWnd::SetWindowPos() shows the found window as on top, without resizing it or moving it.
3) CWnd::ShowWindow() is making sure the application is not minimized/maximized.
BOOL rc;
CWnd* my_wnd = FindWindow(NULL, "Application-Name");
if (my_wnd != NULL)
{
rc = my_wnd->SetWindowPos(&wndTop, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE|SWP_SHOWWINDOW);
rc = my_wnd->ShowWindow(SW_SHOWNORMAL);
}
What I'd like to know is another way of getting the CWnd pointer to the window - I don't like writing code that depends on another applications having the same title (it very-well could change without me knowing, either by the dept. that wrote the code changing it and forgetting to notify me, or someone's changing the title of it for some purpose of their own).
So, now my search moves onto looking for another way of finding a specific window that is running since FindWindow() relies on the window title not changing.
: Dean 'Karnatos' Michaud
|
|
|
|