|
I need to intercept the GDI ::GetPixel() API. I need to get the screen coordinates before GDI can do it's default processing. I need this capability on Win98/ME/2000/XP. Here is what I have found out so far -
1. The SetDDIHook API seems to be gone. Not sure if it is still available to program as part of VS 6.0 headers/libraries. The API documentation mentions something about 16 bit DLLs, so again not sure if it applies to the 32 bit OSs that I am interested in.
2. Would writing a filter video driver do the job? If so, where would I get the IOCTL codes for GetPixel that needs to be intercepted? I assume there is some IOCTL code for GetPixel which the display video driver would look at.
-- modified at 1:16 Monday 3rd July, 2006
|
|
|
|
|
The dialog window can be resize and it max is full screen. how to fix the min size of the dialog??? Thx.
|
|
|
|
|
Handle 'WM_GETMINMAXINFO' message:
void CMyWindow::OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI)
{
lpMMI->ptMinTrackSize.x = 200;
lpMMI->ptMinTrackSize.y = 150;
}
Ovidiu Cucu
Microsoft MVP - Visual C++
|
|
|
|
|
thz x 100000000000000000000000
|
|
|
|
|
It seems you have to handle the WM_GETMINMAXINFO notification sent to your dialog.
|
|
|
|
|
thx a lot
|
|
|
|
|
<pre>CMixer::CMixer(DWORD ComponentType, DestKind dkKind): m_dwControlID(-1), m_bOK(false), m_dwChannels(0)
{
HMIXER hMixer;
HRESULT hr;
hr = mixerOpen(&hMixer, 0, 0, 0,0);
if (FAILED(hr)) return;
MIXERLINE mxl;
MIXERCONTROL mc;
MIXERLINECONTROLS mxlc;
DWORD kind, count;
if (dkKind == Play)
kind = MIXERLINE_COMPONENTTYPE_SRC_WAVEOUT;
else
kind = MIXERLINE_COMPONENTTYPE_DST_WAVEIN;
mxl.cbStruct = sizeof(mxl);
mxl.dwComponentType = kind;
hr = mixerGetLineInfo((HMIXEROBJ)hMixer, &mxl, MIXER_GETLINEINFOF_COMPONENTTYPE);
if (FAILED(hr))
{
mixerClose(hMixer);
return;
}
count = mxl.dwSource;
for(UINT i = 0; i < count; i++)
{
mxl.dwSource = i;
mixerGetLineInfo((HMIXEROBJ)hMixer, &mxl, MIXER_GETLINEINFOF_SOURCE);
if (mxl.dwComponentType == ComponentType)
{
m_dwChannels = mxl.cChannels;
mc.cbStruct = sizeof(mc);
mxlc.cbStruct = sizeof(mxlc);
mxlc.dwLineID = mxl.dwLineID;
mxlc.dwControlType = MIXERCONTROL_CONTROLTYPE_VOLUME;
mxlc.cControls = 1;
mxlc.cbmxctrl = sizeof(MIXERCONTROL);
mxlc.pamxctrl = &mc;
hr = mixerGetLineControls((HMIXEROBJ)hMixer, &mxlc, MIXER_GETLINECONTROLSF_ONEBYTYPE);
m_dwControlID = mc.dwControlID;
break;
};
}
mixerClose(hMixer);
m_bOK = true;
}</pre>
Could anyone please let me know why is this code not controlling the play volume even if MIXERLINE_COMPONENTTYPE_DST_HEADPHONES,play are passed as parameter to CMixer class. The above code is controlling the record volume perfectly.
Indu
|
|
|
|
|
I have an application that uses a CMyHTMLView derived from CHtmlView. The user can have multiple CHtmlViews open at the same time. Everything seems to work fine until we try to Serialize. In Serialize each CHtmlView gets the HTML from the browser to save by doing this:
MSHTML::IHTMLDocument2Ptr doc = GetHtmlDocument();
IPersistStreamInitPtr stream = doc;
CStreamOnCString sstream;
stream->Save( static_cast<istream*>(&sstream), false );
CString result;
VERIFY(sstream.CopyData( result ));
sstream.Release ();
stream.Release ();
doc.Release ();
The problem is every CHtmlView returns the same HTML as is in the most recently opened CHtmlView, even if they're in different documents. I tried using different methods to get the source (including CHtmlView::GetSource, which doesn't always give me all the HTML) but they all do the same thing.
Then it occurred to me that maybe they all have the same HTML in them, so in my app I used the context menu's view source to check and, sure enough, they all show the same code. If I go to one of the earlier opened views and Refresh, it updates to display the same thing as the most recently opened view.
The views are being controlled from VBScript using an IWebBrowser2 passed by my app, which I get by:
GetApplication ()->QueryInterface (__uuidof(IWebBrowser2),(void**) (&pNewBrowser));
and are usually displaying files from the local machine.
Views are created using CreateView from Stingray's CGXTabWnd, which seems to call CRuntimeClass::CreateObject. The CMyHTMLViewclass does IMPLEMENT_SERIAL but not DECLARE_DYNCREATE.
When, from VBScript, we call Navigate to load pages in, it does display the correct page and doesn't visually modify any other existing browser.
Any idea what I'm doing wrong?
-- modified at 4:45 Friday 30th June, 2006
|
|
|
|
|
The problem is difficult to reproduce.
What happens if you comment some parts of serialization function?
|
|
|
|
|
*Sigh* As usual, I assumed the problem ran deeper than it did. My assumption that my routine to get the HTML from the browser was actually doing that seems to be wrong. It was getting it from, in my case, the file the browser had navigated to.
That is, if I loaded a file in the browser and then deleted the file and tried my GetSource function it wouldn't work...
It's hard work being an idiot.
|
|
|
|
|
Hi,
What API can I use to play a simple avi-file on the window (HWND)?
Please not using DirectX (DirectShow).
thanks in advance,
Ward
Ward
|
|
|
|
|
|
Yes, those functions I already found, but there is no example (or at least I can't see one) that shows the use of these functions to open an avi-file and display it on a window.
I've explored the MCI api (a little higher in the treeview of the link you gave me), but this is also not exactly what I need. MCIWnd gives me a complete window (including a bucn of controls), but that I don't need that.
Ward
|
|
|
|
|
Ward wrote: Yes, those functions I already found, but there is no example (or at least I can't see one) that shows the use of these functions to open an avi-file and display it on a window.
Opening an AVI file
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Final solution.
I'm sorry to say that all you were able to reply on this topic was simply a result of some high level searching the internet.
None of them showed me a nice clean piece of code that actually did it.
Finally I found it on my own using a common control of ICC_ANIMATE_CLASS.
This window class is able to to it by using simple functions like
Animate_Open and Animate_Play.
For those who are really interested, I can post a nice clean example of it.
Just ask for it and I'll post here here.
kind regards,
Ward
-- modified at 8:55 Friday 30th June, 2006
|
|
|
|
|
Ward wrote: None of them showed me a nice clean piece of code that actually did it.
Surely you can't be that lame. Sarath provided you a link to the AVI functions, and you replied to him that you already knew of them but that none of them had an example that showed how to open an AVI file. I provided you with a very succinct example of how to open an AVI file (from the link that Sarath provided).
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
The AVI functions that you brought up where all created with the purpose of editing the AVI file. The application I was looking for was to play an AVI file.
I've searched before in all the information that Sarath gave my a link to and I've also looked at the example that you've (DavidCrow) linked me too. But the functions and the example did not provided a simple solution. The purpose for me was to have a simple solution to play an avi, not the implement a complete engine using the AVI-functions. I'm sure that I would be able to accomplish that, but it had to be implemented in a very short period of time.
I understand your remarks, and I hope you understand mine as well.
kind regards,
Ward
|
|
|
|
|
What do you need?i think MCI functions are good
whitesky
|
|
|
|
|
OK, can you show example code where you can load and show an avi on a HWND, not containing any controls?
Ward
|
|
|
|
|
Well in fact i want to show like this code but its a big for this fourm so i said you can use MCI
whitesky
|
|
|
|
|
hello everybody:
How to open html file like this(http://www.codeproject.com/index.html) in win32 project,Not MFC And Not Use ShellExecute(...),
I want to write a class to show this html file,but I don't know how to write...
please Help me....
thanks....
|
|
|
|
|
Waitting for you Online...
please help me...
|
|
|
|
|
-- TTD --
|
|
|
|
|
|