|
Is this possible...?
Spy++ has a neat feature where you drag the bullseye over a window and it returns it's info like class info and process ID and thread and such...
I assume I can get the process ID using GetWindowThreadProcessID() , but once I have a window or application process how can I get the module's ICON...???
Thanx in advance!
Cheers!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
hIcon of the WNDCLASS....?
that would work yeah...?
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Have a look at the function
HICON ExtractIcon(
HINSTANCE hInst,
LPCTSTR lpszExeFileName,
UINT nIconIndex
);
hInst should be AfxGetInstanceHandle(); and lpszExeFileName the path to the executable of the process you want to get the icon from. There is a member "szExeFile" in the PROCESSENTRY32 struct, so this should not be a problem. To get the standard icon, set nIconIndex = 0.
-Dominik
|
|
|
|
|
How can I programmatically figure out that my shared folders are accessed from some user? Is there any event which can trigger me that, and how?
Thank you in advance.
|
|
|
|
|
Hi All,
consider Test.exe which is GUI based,
now in command line
\\directory\test.exe it invokes Test.exe, if user types
\\directory\test.exe help ,particular help should be displayed simillar to c:\help a list of commands with description is displayed
can anyone explain me on how to do this
Thanks
Uday
|
|
|
|
|
Parse the command line parameter of WinMain() , determine if the commandline included help, then print the stuff to screen.
console apps I guess use main() so you have to work with argv and argc
argv is an array (if i remember correctly) of each paramter and argc is a count of the number of array elements...
so argv[0] = test.exe (module name)
and argv[1] would contain the text string help
simple as that really
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
I need to use WriteConsole for that I have to get the Handle
(Handle to the console screen buffer to be written to. The handle must have GENERIC_WRITE access. )
How to get this Handle??
I used ,
HANDLE hnd =GetStdHandle(STD_OUTPUT_HANDLE); buts its not working and also I used GetLastError() its returning 0 which means program executed correctly
So ??
|
|
|
|
|
Are you using WinMain(...) or main(...). If you use WinMain, you have to call the function
AllocConsole();
before calling GetStdHandle(...);
-Dominik
|
|
|
|
|
Hi,
In DataTypes.h , I wrote this
typedef struct _DATASTRUCT
{
LPCTSTR ID;
double value;
SYSTEMTIME time;
}DATASTRUCT,*LPDATASTRUT;
and include this header in several classes *.h or *.cpp files,the compiler hint to me that redefination has happened.
Then how to fix this problem?
Extreme programming. Do the No.1
|
|
|
|
|
|
Are you protecting your file .h>/code> against multiple inclusion? (with <code>#ifndef DATA_TYPE_H s and stuff, you know.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
In data types.h add something like this:
#if !defined DATATYPES
#define DATATYPES
....
#end if
Best regards,
Alexandru Savescu
|
|
|
|
|
Hii all ,
how I can get Information about the space available and the total space in the memory of a Pocket PC or Its aditional card !!
thanks alot
|
|
|
|
|
How to retreive the system font?
|
|
|
|
|
GetStockObject(SYSTEM_FONT)
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
I'm trying to use CImage in an ATL Active X. I only use methods from CImage Load, Draw and Destroy (which is noting strange). The problem is that when the application that uses the control ends, the DLL of the control can be unload. Any idea of what's the matter ?
|
|
|
|
|
I have two List Control boxes in a dialog. and I wish the user can select a few items from the first list and some items from the second list, and then the user can see all the items he just chose are still highlighted in both lists.
now after i selected one or some items in the first list(they'll get highlighted at this time), when i click in the second list and select items there, the first list will lose focus and the highlighted items in the first list will lose highlighting. Anybody can suggest me how to solve it? thx a lot in advance.
|
|
|
|
|
Just a guess, but the list view control has a 'Show selection always' property...
If that doesn't do the trick then you'd have to devise something using owner draw...
Either way only one item can ever have focus so I hope you don't desire the focus rectangle also...?
Cheers!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
hi Hockey?!, ...
thx a lot for ur tips! i tried to use the property of 'Show selection always', it works!
only thing now is that the highlighted color turns from blue to gray once the list losing focus. anyone got any idea about still keep it in blue besides using owner draw?
thx a lot again!;P
|
|
|
|
|
You will have to add a message handler OnCustomDrawList to your listCtrl class
using
ON_NOTIFY(NM_CUSTOMDRAW,IDC_LIST_CTRL,OnCustomdrawList)
Check out an article by Michael Dunn at
http://www.codeproject.com/listctrl/lvcustomdraw.asp
You will also find some similar implementations(of OnCustomDraw) on www.codeguru.com as well.
Happy Coding !!
-Mahesh Shimpi
Ideas multiply by sharing!!
|
|
|
|
|
thx a lot, Mahesh!
seems i got no choice now, ...
but the coding process is really wonderful!
|
|
|
|
|
hi
i like to use combobox for storing items in vc++. but the problem is it
can't store more than 32,735 items because of integer datatype limit is 32735. But in MFC int lenght is around -2 crores to +2crores. even it accepts only 32735 items only.why? please explain how can i add items into combobox more than 32,735. how can i overcome this limit
please help about this
thank you
from
venu
|
|
|
|
|
the comboBox has not the limit 32735,the limit is (int)
|
|
|
|
|
Hi!
I have a C++ class with a callback function. Now I wanna use this class in .NET enviroment. So according the guide, i wrap it in a managed class.
But the problem is the callback. The unmanaged class must have an ability to callback the managed class. How can the callback function in unmanaged class get the pointer of the delegate(or something like that) of the managed class?
any suggestion?
|
|
|
|
|
I am not sure about this, but it may have something to do with delegates. Read about them in the documentation.
Best regards,
Alexandru Savescu
|
|
|
|