|
Maybe you guys should answer to the original poster? He'll get email notification, etc.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
We thought you'd like the email!!! personally, i *love* getting mail that i don't care about
Sorry to dissapoint you all with my lack of a witty or poignant signature.
|
|
|
|
|
Jon Hulatt wrote:
We thought you'd like the email!!!
I do I'm just worried about our multi-threaded programmer who can be totally unaware about this discussion
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
I think that I can use SetProcessAffinityMask. For a process I assign it to one CPU and the other to another CPU. The two process can communicate through share memory. That's all what I think but now I try to find a sample to demonstrate the using of SetProcessAffinityMask. I read it a lot in MSDN but nothing is found. If you have the code, please show me. Thanks everybody.
|
|
|
|
|
Don't try to outsmart OS scheduler - your performance will be significantly down if you tie one process to first CPU and the other to second CPU. Just let Windows do its work and stop worrying about that.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
I have tried to find an answer the the question abovee, but the search failed.
Is there a simple way to get a serial number of the newtork card? Maybe an API call?
Thanks!
Ales
|
|
|
|
|
http://www.codeproject.com/useritems/getmac.asp
Should this go in Mike Dunn's C++ FAQ?
Sorry to dissapoint you all with my lack of a witty or poignant signature.
|
|
|
|
|
//
// Link with ws2_32.lib and iphlpapi.lib
//
#include <windows.h>
#include <stdio.h>
#include <tchar.h>
#include <iphlpapi.h>
int __cdecl main()
{
HRESULT hr;
IPAddr ipAddr;
ULONG pulMac[2];
ULONG ulLen;
ipAddr = inet_addr ("216.145.25.31");
memset (pulMac, 0xff, sizeof (pulMac));
ulLen = 6;
hr = SendARP (ipAddr, 0, pulMac, &ulLen);
printf ("Return %08x, length %8d\n", hr, ulLen);
size_t i, j;
char * szMac = new char[ulLen*3];
PBYTE pbHexMac = (PBYTE) pulMac;
//
// Convert the binary MAC address into human-readable
//
for (i = 0, j = 0; i < ulLen - 1; ++i) {
j += sprintf (szMac + j, "%02X:", pbHexMac[i]);
}
sprintf (szMac + j, "%02X", pbHexMac[i]);
printf ("MAC address %s\n", szMac);
delete [] szMac;
return 0;
}
|
|
|
|
|
Hello,
How can I enumerate all handles used by a process?
(I mean files, sockets, mutexes, etc. and also GDI handles)
Which function API do this???
Thanks.
|
|
|
|
|
There is no publicly documented Win32 API to do this.
However there are some functions which will do this in the api for ntdll.dll. The book Windows NT/2000 Native API Reference documents these functions and gives examples of how to use them.
Search for NtQuerySystemInformation() on the web.
You want to query for class SystemHandleInformation, this has a value of 16.
Then to determine the handle type, call NtQueryObject()
Note that these APIs or the data input/returned may change between NT/2000/XP/etc.
There are some classes on CodeGuru that do examples of this work, but they are broken, as the data structures used to query the APIs are incomplete and incorrect - compare with the book and you'll see what I mean.
Cheers
Stephen Kellett
--
C++/Java/Win NT/Unix variants
Memory leaks/corruptions/performance/system problems. UK based.
Problems with RSI/WRULD? Contact me for advice.
|
|
|
|
|
With psapi functions like EnumProcessModules
Best Regards....
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
Hi Carlos,
I look closely to EnumProcessModules,
also try to found some samples on the web,
but it seems this function can help only to
enumerate processes, not handles used by them.
Regards.
|
|
|
|
|
Hello Xperts,
I need to remove application icon from alt+tab list, please post the solution, if you know.
Thanks in advance..
KGS
|
|
|
|
|
|
Great Tomasz Sowinski..
Thanks for quick reply, I have to try..
KGS
|
|
|
|
|
How to realize moving picture using hand-like cursor. just like Imaging For Windows at windows accessory.
|
|
|
|
|
Hi,
can someone give me some information about using Stingray Objective Grid 97 Control? I had read the documentation but it´s very bad! Or has someone a tutorial about it??
thanks
Simon
|
|
|
|
|
|
Hi out there,
I'm working an instrument based on the Windows CE operating system. The applications is now to be translated into Japanese.
I have found a true type font "MS Gothic.ttf" that supports Japanese charactes. That works fine except for titles in dialogs that use the sysytem font.
I don't want to link the font into the OS image but instead load a system font dynamically.
I have tried to modify the registry:
[HKEY_LOCAL_MACHINE\SYSTEM\GDI\SYSFNT\Nm] from Tahoma to MS Gothic
[HKEY_LOCAL_MACHINE\SYSTEM\GWE\Menu\BarFnt\Nm] from Tahoma to MS Gothic
[HKEY_LOCAL_MACHINE\SYSTEM\GWE\Menu\PopFnt\Nm] from Tahoma to MS Gothic
[HKEY_LOCAL_MACHINE\SYSTEM\GWE\OOMFnt\Nm] from Tahoma to MS Gothic
But it doesn't work.
Any ideas??
Jørgen Belfalas
|
|
|
|
|
Hello,
I have a problem with text selection. I want to get the highlighted text that users double click on it (not only in my own application). Do I have to use COleDataObject to implement this? Is this about clipboard?
I'm a beginner. Guide me, please.
|
|
|
|
|
Yes, it's about clipboard. This code places the contents of strClipboardText variable in clipboad. You'll probably use CEdit::GetSel and CEdit::GetSel and CEdit::GetWindowText to get this string.
CString strClipboardText = ...;
if (!OpenClipboard() || !EmptyClipboard())
{
AfxMessageBox("Error: can't open the clipboard.");
return;
}
HGLOBAL hglbText = GlobalAlloc(GMEM_MOVEABLE, 1 + strClipboardText.GetLength());
char *pData = (char *)GlobalLock(hglbText);
lstrcpy(pData, strClipboardText);
GlobalUnlock(hglbText);
SetClipboardData(CF_TEXT, hglbText);
CloseClipboard();
Assuming that you're using CEdit control, there will be a problem with double-clicking - this action highlights the *word* you're clicking on. Previous selection is lost. You may try to override WM_LBUTTONDBLCLK to change this behavior.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Thank you very much.
But there's a problem. I didn't get highlighted text from edit box but i want to get highlighted text from anywhere on screen (ex. in browser, spreadsheet, notepad, etc.). How can I get it? Guide me, please.
|
|
|
|
|
When a string which contains more than 260 characters is inserted in a CListCtrl only the first 260 characters are visible. The string is not truncated cause GetItemText returns the hole string. Any ideas how to show the hole string in the CListCtrl?
Ha dé
Lloyd Cole
|
|
|
|
|
Try to custom-draw the control. There should be some articles about that in the listctrl section of CP.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
hi,
I’m trying to write a plugin or anything else that will do the job to allow me to put an icon onto Internet Explorer and add some functionality to this icon.
Does anybody know how this can be done?
Cheers
Dor
|
|
|
|