using code with out dialog
-
Hi all. I'd just like to find out how to use this code on a article someone wrote a while back. I'd like to use it with out having to use a dialog. So it would be console when compiled. Here is the link http://www.codeproject.com/system/Hack\_Windows\_Task\_Manager.asp.I know the part that i'd like to use is in the SendMessage() API. But i dont think thats the only thing i need to do. Im sure the entire BOOL function is what i'll need. If anyone has any suggestions please let me know. Thanx in advance!
-
Hi all. I'd just like to find out how to use this code on a article someone wrote a while back. I'd like to use it with out having to use a dialog. So it would be console when compiled. Here is the link http://www.codeproject.com/system/Hack\_Windows\_Task\_Manager.asp.I know the part that i'd like to use is in the SendMessage() API. But i dont think thats the only thing i need to do. Im sure the entire BOOL function is what i'll need. If anyone has any suggestions please let me know. Thanx in advance!
As both
EnumChildWindows()
andSendMessage()
can be used in a console application, what is it that is troubling you?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
As both
EnumChildWindows()
andSendMessage()
can be used in a console application, what is it that is troubling you?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
Whats bothering me is that im trying to see if i need the entire function of BOOL, the code:
BOOL CALLBACK EnumChildProcedure(HWND hWnd,LPARAM lParam) { char name[256]; GetWindowText(hWnd,name,256); char ClassName[256]; GetClassName(hWnd,ClassName,256); if((strcmp(ClassName,"SysListView32")==0)&&(strcmp(name,"Processes")==0)) { ::SendMessage(hWnd,LVM_DELETECOLUMN,(WPARAM)0,0); } if((strcmp(ClassName,"SysListView32")==0)&&(strcmp(name,"Tasks")==0)) { ::SendMessage(hWnd,LVM_DELETECOLUMN,(WPARAM)0,0); } if(name==NULL) return FALSE; return TRUE; }
-
Whats bothering me is that im trying to see if i need the entire function of BOOL, the code:
BOOL CALLBACK EnumChildProcedure(HWND hWnd,LPARAM lParam) { char name[256]; GetWindowText(hWnd,name,256); char ClassName[256]; GetClassName(hWnd,ClassName,256); if((strcmp(ClassName,"SysListView32")==0)&&(strcmp(name,"Processes")==0)) { ::SendMessage(hWnd,LVM_DELETECOLUMN,(WPARAM)0,0); } if((strcmp(ClassName,"SysListView32")==0)&&(strcmp(name,"Tasks")==0)) { ::SendMessage(hWnd,LVM_DELETECOLUMN,(WPARAM)0,0); } if(name==NULL) return FALSE; return TRUE; }
If you use
EnumChildWindows()
, you will need a callback function. What you put in it is up to you.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
If you use
EnumChildWindows()
, you will need a callback function. What you put in it is up to you.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
How do i declare a bool callback function? I keep getting undeclared variable when i try to compile.
EnumChildWindows(variable, function, NULL); BOOL CALLBACK function(HWND variable, LPARAM lParam){ ...//Some code }
Thanx in advance! -
How do i declare a bool callback function? I keep getting undeclared variable when i try to compile.
EnumChildWindows(variable, function, NULL); BOOL CALLBACK function(HWND variable, LPARAM lParam){ ...//Some code }
Thanx in advance!dellthinker wrote:
I keep getting undeclared variable when i try to compile.
Probably because you are referencing it (i.e.,
function()
) before it has been declared.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne