|
i have two questions infact.
basically i am calling from C# to c++. i am passing the window handle as int32 to c++ code. But GetWindowDC() requires window handle. how do i convert the int32 to window handle??
Second one is how can i get the window size in c++ given an handle?
|
|
|
|
|
veligeti wrote:
GetWindowDC() requires window handle. how do i convert the int32 to window handle??
It is the handle, just cast it to HWND.
veligeti wrote:
Second one is how can i get the window size in c++ given an handle?
GetWindowRect
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi everybody.
When i get the list of processes ids, with the EnumProcess function, how i can get the window asociated with a process? For example, if i have the process id 08937 i want to call a function GetWindow(08937) and it gives me a handle to the asociated window (HWND)
|
|
|
|
|
Processes may not have created windows, and processes may create many windows.
You can loop through all the top level windows using EnumChildWindows() with the desktop window as the parent: GetDesktopWindow().
And use this function:
DWORD GetWindowThreadProcessId(HWND hWnd,LPDWORD lpdwProcessId);
Then compare lpdwProcessId with the list of ProcessIds from EnumProcesses.
If it is in the list, then the HWND from the EnumChildWindows proc is what you need.
Maybe someone else knows of a better approach, maybe one simple api function
to do all this!
this is this.
|
|
|
|
|
Hi ,
I want to compare the text of two html pages and then highlight the changed text.Do you have any idea on how to do this
|
|
|
|
|
Please don't post in multiple forums. If you wanted to choose one, the web development one would have been the logical choice ( I don't think you even hit that one, did you ? )
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
My_Fun()
{
...
pFtpConn = mysession.GetFtpConnection( my_ftpserver, my_user, my_pass );
CFtpFileFind finder(pFtpConn);
BOOL bWorking = finder.FindFile("/My Projectinfo.inf" );
...
}
The Codes can not found file "My Projectinfo.inf", Why?
Are there some way to acces file has filname have space?
Thank!!!
|
|
|
|
|
Try removing space in the filename
[edit] Sorry, I didnt read your question in full the first time. I could not find a way to do it with a space and IMO, a filename with a space is not allowed on FTP Servers (not sure though) [/edit]
Einstein: "Two things are infinite: the universe and human stupidity; and I'm not sure about the the universe."
My Articles
|
|
|
|
|
I am using VC++ version 6.0 Although I can ADD files to a project build database using the menu item "Project\Add to project\Files", I'm darned if I can see how to REMOVE files (from the build database) that I have inadvertantly added (or superceeded, etc). I can obviously remove the files from the project directory easily enough, but I will then get build errors. What am I missing here ?
Doug
|
|
|
|
|
You can remove the file from the project pressing the delete key when you select the item. The other thing that you can do is press the right mouse button one the file you want to exclude and select the settings menu. In the tab general, you see the option 'Exclude file from build.' Select that and...
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
Hi Bob, Many thanks for your prompt response !! Magic ! (Another mystery solved !)
Doug
|
|
|
|
|
Glad that I could help you!
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
Hi,
today i saw a really nice feature. When Install Anywhere crashes (which it does really often; i think it can't handle the 64-Bit) it shows it own error report dialog. Not that stupid common Microsoft Dialog. Know i asked myself how they did it . Any one knows this ?
MFG
RedDragon2kx
|
|
|
|
|
A dialog is a dialog, regardless of what you put in it or who made it. Now if you've got a screen shot of it, we could probably hypothesize as to how it was created.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Maybe it's a predicted crash. This means that they had forseen the error situation and handled guarded the code using structured exception handling. From there they launched the custom dialog..
This would be IMHO the most obvious that they would have done that.
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
Try this
Pssst. You see that little light on your monitor? That's actually a government installed spy camera. Smile and wave to big brother!
|
|
|
|
|
Can som1 plz tell me how to add sound to AVI Files ... I can add frames but cannot audio to generate an AVI movie ... can some1 plz help me on it
|
|
|
|
|
you wont get any help because no one knows what editor your using, duh
IM PROUD TO BE A GMAIL;
|
|
|
|
|
I am using Visual Studio 6 and i also have the same question ... can somebody help me
|
|
|
|
|
I added a response to original Anonymous post in the thread. See if it helps you.
|
|
|
|
|
I have done this using SDK (not MFC, not C++). Is this any use to you?
If so I will clean the code a bit and post it.
|
|
|
|
|
OK, I had a quick look at my code.
This is SDK-based. Why make it easy?
Some background:
The video frames were captured into memory using libraries which came with my frame grabber card, and the audio was captured at the same time, in audio buffers having the same duration as a video frame (40 milliseconds for PAL video.)
Once I have a set of video frames and corresponding audio frames in memory, capture stops and I write an AVI file.
Here is the portion which writes the AVI (including audio stream initialisation but ignoring video stream initialisation):
<br />
uiResult = AVIFileOpen(&pAVIFile, AVIFileNameEtc.lpstrFile, OF_CREATE, NULL);<br />
if (uiResult != AVIERR_OK)<br />
exit;<br />
<br />
memset(&AudioStreamInfo, 0, sizeof(AudioStreamInfo));<br />
<br />
AudioStreamInfo.fccType = streamtypeAUDIO;<br />
AudioStreamInfo.dwScale = 1;
AudioStreamInfo.dwQuality = -1;
AudioStreamInfo.dwRate = 11025;
AudioStreamInfo.dwStart = 0;<br />
<br />
AudioStreamInfo.dwLength = uiLocalNumFramesUsed * uiAudioBufferActualSize;<br />
<br />
AudioStreamInfo.dwSuggestedBufferSize = uiAudioBufferActualSize;<br />
AudioStreamInfo.dwSampleSize = 2;
<br />
uiResult = AVIFileCreateStream(pAVIFile, &pAVIAudioStream, &AudioStreamInfo);<br />
if (uiResult != AVIERR_OK)<br />
exit;<br />
<br />
uiResult = AVIStreamSetFormat(pAVIAudioStream, 0, &AudioFormat, sizeof(AudioFormat));<br />
if (uiResult != AVIERR_OK)<br />
exit;<br />
<br />
for (uiCounter = 0; uiCounter < uiNumFramesUsed; uiCounter++)<br />
{<br />
<br />
uiResult = AVIStreamWrite(pCompressedVideoStream, uiCounter, 1, gpAVIBufBits, bitmapForAVIHeader.biSizeImage, 0, NULL, NULL);<br />
if (uiResult != AVIERR_OK)<br />
exit;<br />
<br />
uiResult = AVIStreamWrite(pAVIAudioStream, uiCounter, <br />
1, pAudioDataBlock[(uiCounter],<br />
uiAudioBufferActualSize, 0, NULL, NULL);<br />
if (uiResult != AVIERR_OK)<br />
exit;<br />
}<br />
|
|
|
|
|
hello,
i searched codeproject, but couldn't find a description of how to support accelerator customization. i'd like users to be able to change accelerator keys at run-time, similar to the one in the Customize... command in visual c++.
thanks,
ed
|
|
|
|
|
Narf! Call CreateAcceleratorTable and make sure you use the handle returned in a call to TranslateAccelerator
|
|
|
|
|
Thanks!
From what I can tell, I'll have to override CFrameWnd::GetDefaultAccelerator() or CDocument::GetDefaultAccelerator(). Strange that these functions aren't documented in the MSVC help file, but it shouldn't be that complicated....
Ed
|
|
|
|