|
I need to perform the same function that selecting a view under the "Windows" menu does. I have succeeded with minimal results. Does anybody have any suggestions?
Thanks in advance.
Eldon Zacek
Czech-Mate Enterprises, LLC
|
|
|
|
|
CFrameWnd::MDIActivate activates a given MDI child. To enumerate all MDI child windows (which you probably need to dynamically construct the View menu), use EnumChildWindows with CMainFrame::m_hWndMDIClient (not directly with the frame window).
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I want to make a mutli threaded sniffer program that captures network packets in MFC but doe's not know particular threading API's. Plz suggest me whether to use timer or threads as I am a beginner and a weak coder. Plz provide me with relevent websites/codes e.t.c
Reply me soon
|
|
|
|
|
how do you show a file in the machines default text viewer ??
i wont always know that notepad.exe is on the box, so i would rather open for default text viewer associated by o/s than to use a system command to open my file in a static program....
any suggestions ?? thanks in advance.
todo....
:: insert inpirational text here ::
|
|
|
|
|
Just ShellExecute (or whatever you use to start an app) on the text file itself, and the shell will automatically run the correct viewing app
--
Help me! I'm turning into a grapefruit!
|
|
|
|
|
Use ShellExecute() API.
For example:
ShellExecute(::GetDesktopWindow(), NULL, "c:\\myfile.txt", NULL, NULL, SW_SHOWNORMAL);
|
|
|
|
|
thanks ! codeprojects better than google lol
todo....
:: insert inpirational text here ::
|
|
|
|
|
Hello
I'm thinking of using a Excel cheet to present som statistics in my appliation. Is the best way to use a html view for this or ???
Another question that really is not a c++ issue but perhaps some clever person has the awnser.
Can I retrive information from a Cell and use this in a query towards my db if yes. What is the best approach in this matter.
Regards
Henrik
|
|
|
|
|
I have a program which is using Winsock and I would like to put the local IP Address on the title bar of the dialog. Unfortunately all I get for an IP address is 0 and in dotted quad 0.0.0.0
here is some of my code:
<br />
Sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);<br />
...<br />
<br />
sa.sin_family = AF_INET;<br />
sa.sin_addr.S_un.S_addr = INADDR_ANY;<br />
sa.sin_port = htons(2000);<br />
<br />
iError = bind(Sock, (LPSOCKADDR) &sa, sizeof(struct sockaddr));<br />
<br />
SetWindowText(hDlg, inet_ntoa(sa.sin_addr));<br />
I noticed in MSDN that by using getsockname that the IP address might not be available always especially if I/O has not occured. But I thought that when I bind the socket that the sockaddr_in structure gets filled in and that one of the variables should contain the address which it is connected with. What am I missing here?
|
|
|
|
|
Warren Young provides a sample[^] as part of his excellent Winsock Programmer's FAQ.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I have to develop an application in which hardcopies via keystroke are disabled. The keystrokes I know are: ALT+Print, CTRL+Print, SHIFT+Print and Print alone. How can I disable these keys in VC++ ?
Thanks ...
Olaf Rodewald
|
|
|
|
|
I'd recommend using a hook. Install it by use of SetWindowHookEx of type WH_KEYBOARD and react on your requested keys inside the provided hook function.
|
|
|
|
|
Do you have a reference for SetWindowHookEx or better an example ? Thanks, Olaf Rodewald
|
|
|
|
|
In case you need a system wide hook, you need to implement the hook function inside a DLL. The function could look sth. like this:
__declspec(dllexport) LRESULT CALLBACK HookFunction(<br />
int code,<br />
WPARAM wParam,<br />
LPARAM lParam)<br />
{<br />
char szVCode[50];<br />
<br />
sprintf(szVCode, "Virtual Key code: %lx", wParam);<br />
MessageBox(NULL, szVCode,"Key stroke", MB_OK);<br />
}
Installing it in your application is done by calling SetWindowsHookEx:
hHookDll = LoadLibrary("hook");<br />
hHookProc = (HOOKPROC) GetProcAddress(hHookDll, "HookFunction");<br />
<br />
hSystemHook = SetWindowsHookEx(WH_KEYBOARD,hHookProc,hHookDll,0);
Finally, don't forget to unload DLL and unset the hook:
UnhookWindowsHookEx(hSystemHook);<br />
FreeLibrary(hHookDll);
If you need some more detailed information, have a look at MSDN - there's lots of stuff about that topic.
|
|
|
|
|
you have to put your system wide keyboard hook in a .dll
http://www.codeguru.com/system/KBHook.html
that has a good example of a system wide keyboard hook , and an application example that uses the dll.
i was able to build my own keyboard hook after going thru that , and ive used it w/ no major problems. note there is a bug in the code there. u need to get rid of hook = NULL; line from dllmain;
hope this helps
todo....
:: insert inpirational text here ::
|
|
|
|
|
I'll try it ... Thank you ... Olaf
|
|
|
|
|
Hello,
I have a problem: I have two separate applications:
1) an ATL explorer shell extension
2) a MFC application which should display the files
Because of project reasons the files have to be different, the
explorer shell extension must be a DLL and the display application
must be a MFC project as EXE.
How can I pass the selected files from the DLL to the EXE?
I first thought of GlobalAlloc but MSDN says that this function
is only provided for 16-bit support.
What would you suggest? Is there a way to share an array? It is a bit difficult to implement an IPC system in this case...
Thanks
-Dominik
|
|
|
|
|
I'd say GlobalAlloc is just fine. IMHO the docs are a little misleading with respect to the applicability of this function (the proposed alternative, HeapAlloc and company, doesn't add much to this for your particular needs).
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Hi, everyone!
Where is the the precompiler directive __PTHREADS__ defined?
Defined in compiler? What is the meaning and function of
the precompiler directive __PTHREADS__?
Thanks in advance,
George
|
|
|
|
|
pthreads is a unix threading library, and I can only imagine the application you are trying to compile makes use of the Win32 version of this. __PTHREADS__ will be found wherever the pthread include files are, thats about all that can be said.
|
|
|
|
|
Thanks!
I have another, does Windows use pthreads library?
If I am using Windows version of the project, can
I passby the codes has something to do with pthreads?
Cheers,
Geroge
|
|
|
|
|
Nitpicking: Pthreads is a POSIX standard (IEEE POSIX 1003.1c-1995, also known as the ISO/IEC 9945-1:1996) not a "unix" one.
"You can stand all night at a redlight anywhere in town, hailing Marys left and right but none of them slow down. I've seen the best of men go past. I don't wanna be the last..."
|
|
|
|
|
Yep, there is a version of the UNIX pthreads available for Win32 at http://sources.redhat.com/pthreads-win32/ You should be able to compile and run just about any application that uses pthreads, although if it uses other unix system calls you might run into problems.
|
|
|
|
|
|