|
I want to write a program that can access to the network packets and …
How can I find information and source code about this?
Thanks
|
|
|
|
|
Does anyone have any simple examples for working with DDS images (as used by DirectX)
I've found an assortment of examples in the DirectX SDK, but these assume that the images are loaded as textures for display on a DX device, whereas I just want to get at the pixel data of the image(s) stored within the file.
Can anyone help?
--
Help me! I'm turning into a grapefruit!
|
|
|
|
|
Hi
I experience big troubles when trying to implement IDataObject with support for CFSTR_* formats.
I first enumerate my available formats, like
ASSUME0(celt == 1 && !pceltFetched);
if (nFormatsEnumerated == 0)
{
rgelt->cfFormat = ::RegisterClipboardFormat(CFSTR_FILEDESCRIPTOR);
rgelt->dwAspect = DVASPECT_CONTENT;
rgelt->lindex = -1;
rgelt->ptd = NULL;
rgelt->tymed = TYMED_HGLOBAL;
nFormatsEnumerated++;
return NOERROR;
}
else if (nFormatsEnumerated == 1)
{
rgelt->cfFormat = ::RegisterClipboardFormat(CFSTR_FILECONTENTS);
rgelt->dwAspect = DVASPECT_CONTENT;
rgelt->lindex = -1;
rgelt->ptd = NULL;
rgelt->tymed = TYMED_ISTREAM;
nFormatsEnumerated++;
return NOERROR;
}
else
{
return S_FALSE;
}
But when the data is requested, the lindex member of the FORMATETC structure is set to -1. I thought lindex would be set to the index of the file whose content is requested?
Anyone who has implmented this?
|
|
|
|
|
Hi
I have a HINSTANCE, I want to get HWND from it. Can you help me?
Thanks for your reading.
Tran Hoang Chuong
|
|
|
|
|
HINSTANCE is an instance handle to an application and an application can have many or no windows. I don't see how you would retrieve one HWND from any HINSTANCE.
If your using MFC then CWinThread::m_pMainWnd holds the pointer to the application main window and from here you could use EnumChildWindows() to get the others...
Cheers!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Hi HockeyDude
I forgot to tell more detail about my question. It means I have a HINSTANCE from a command ShellExecute(...) and I want to get CWnd of the application I have just exectuted.
Thanks for your reply.
Tran Hoang Chuong
|
|
|
|
|
I think the CWinThread is no good to you then.
I don't know of any function which would return the window handle associated with an HINSTANCE. Except EnumChildWindows which only returns child windows of a parent.
Can you use FindWindow()...?
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Hi HockeyDude
Thank you very much
Tran Hoang Chuong
|
|
|
|
|
if you figured it out that's all that matters
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Hi,
I would like to make my neat ownerdraw CListBox with underlined text (e.g. on MouseOver). Well, I know how to use CreateFont(), but I would like to use the current selected font and only make it underlined. Is this possible, is GetCurrentFont() the right direction?
My ownerdraw listbox is pretty much like in http://www.codeproject.com/combobox/listboxex.asp
Kinda lost, thx!
Moak
|
|
|
|
|
"Returns a pointer to the currently selected CFont object. This member function may return temporary objects.
" - MSDN
Sounds good to me.
SelectObject() I think would do the trick too, but the above is the better approach.
Cheers!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Okie, I use this code snipped now.
Plz tell me if something is stupid.
<br />
CFont fontUnderline, *pFontOld; <br />
LOGFONT lf;<br />
VERIFY(pDC->GetCurrentFont()->GetLogFont(&lf));<br />
lf.lfUnderline=1;<br />
VERIFY(fontUnderline.CreateFontIndirect(&lf));<br />
<br />
...<br />
<br />
pFontOld = pDC->SelectObject(&fontUnderline);<br />
pDC->DrawText(ptr, nLen, lpRect, nFormat);<br />
pDC->SelectObject(pFontOld);<br />
|
|
|
|
|
I can't see anything wrong...your compiler would do a much better job i'm sure.
Thats how I would do it if that's what you wanted to hear, try it and hopefully things will go as planned.
Cheers!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Hi,
I want to create an enhanced metafile that will show an image with differents types of fonts and line styles..., then pass it to the clipboard.
The problem that I have, comes when I try to use that fonts or styles, if I use standard stuff all works fine, if not when it is pasted on another window, it paste a white rectangle.
I make the metafile from a class that has now window associated ( well AfxGetMainWnd()...).
Thanks in advance,
Braulio
|
|
|
|
|
I have a problem with developers sniffing on the network, so i want to create promiscious scanner, that would log off user who is sniffing on network. I know how to found out which card is in promiscious mode, but i dont know how to send custom made ARP packet... can anyone help me?
|
|
|
|
|
RFC 826 I believe defines the layout of an ARP packet. Or is it the sending part you're unsure of? That depends on your OS.
|
|
|
|
|
I know how ARP works, but i am unable to send it (Windows 2k).
|
|
|
|
|
For W2k, didn't Microsoft add some (Winsock2?) functions that let you compose your own IP packets, including TCP/UDP headers and all?
Have you tried searching MSDN? I'm pretty sure there was a sample there some time ago of how to form and send your own formed IP packet. If I'm wrong, perhaps it was on another site (e.g. codeguru)?
|
|
|
|
|
I have a hard time figuring out where ::HTMLHelp looks for the .chm's specified. Path of caller? current folder? Search path? Further adding to the confusion, there's HKLM\Windows\HTML Help in the registry, which seems to contain filename->full path mappings, but only for MS Office help.
TIA
Peter
the programmers just set it so that when in doubt, the women still think they're involved with you. It's much less frustrating that way - BGII Quest Directory
|
|
|
|
|
Hi!
I'd like to display a WINWORD on a dialog. Can you help me?
Thanks for your reading.
Tran Hoang Chuong
|
|
|
|
|
Hi,
Take a look at
http://www.codeproject.com/com/xoffice.asp
Well, is not right just what you were looking for ( is on a View), but maybe you can somehow fake it or make something..
Good luck !
Braulio
|
|
|
|
|
Hi,
I have 2 threads & 2 events.In one thread i will set one event & 2nd thread will be waiting for that event.
This logic works fine if i put a messagebox in the 2nd thread,otherwise it hangs.
Any idea?
|
|
|
|
|
Could you post some code showing the problem? The explanation sheds little light (to my eyes) about what's going on.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Ok, There is a main thread(application thread) & i have created another thread using _beginthread() function.
Also i have 2 events created as below in the main thread.
CallBackEventHandle= CreateEvent( NULL,TRUE,FALSE,NULL);
ImageEventHandle= CreateEvent( NULL,TRUE,TRUE,NULL);
In my thread function i will be waiting for ImageEventHandle event.there it hangs,but it works fine if i put a messagebox in the thread function.
could you pl help me solve this??
|
|
|
|
|
Sounds like you are trying to send a message to something in the secondary thread but don't have any type of message loop. Adding the message box creates a temporary message loop.
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|