|
I tried searching this up on Google but I couldn't find anything. Is there any way to prevent a process from showing up under the processes tab in Windows Task Manager, or is it possible to not allow the termination of a process? I've tried something like this already:
::SendMessage(hWnd,LVM_DELETEITEM,(WPARAM)23,0);
Where hWnd is the HWND of the Task Manager window, but what happens is that the list refreshes every half second (I think) and deleting a process once won't work. Deleting it multiple times within 500 milliseconds results in process #24, 25, 26, etc. being deleted. And what's worse, there is NO way I can get the location of my app's process in the listbox. I don't know if it's the 1st process displayed or the last one, or somewhere in between.
So, is there ANY way to not allow a user to terminate a process, or to make an "invisible" process?
Thanks in advance.
|
|
|
|
|
I think some times ago some people on this forum have this question and also if you search on the codeproject (I think I saw on the codeproject not sure) you can find an article that it hide process of Task Manager but you can hide your process of Task Manager but if some one use of other programs he/she can sees your process?
|
|
|
|
|
|
"He is the Devil. You've never seen anyone like Keyser Soze in all your miserable life, you idiot.
Keyser Soze. Do you at least understand that? Keyser Soze. The Devil himself.
Or are you American policemen so stupid that you haven't even heard of him?
Keyser Soze, you ridiculous man. KEYSER SOZE."
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi All,
I am using Win32 Application. In that I have created resource as Dialog and also in this Dialog I have added onr ListBox control. Now I want to insert data in to this Dialog.
In this I have added one C++ class in which I am using like below to open Dialog.....
<br />
void CCurrentWnd::Open()<br />
{<br />
DialogBoxParam(hAppInstance,MAKEINTRESOURCE(IDD_CURWND),NULL,(DLGPROC)CurrntWndDlgProc,(LONG)this);<br />
}<br />
As shown in above code my CurrentDlgProc is shown as below....
<br />
<br />
BOOL CCurrentWnd::CurrntWndDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)<br />
{<br />
CCurrentWnd * _this = (CCurrentWnd *)GetWindowLong(hwnd,GWL_USERDATA);<br />
switch(uMsg)<br />
{<br />
<br />
case WM_INITDIALOG:<br />
{<br />
HWND m_list1;<br />
<br />
m_list1 = GetDlgItem(hwnd,IDC_WNDLIST);<br />
<br />
}<br />
<br />
<br />
}<br />
}<br />
<br />
Here IDC_WNDLIST is the ID of the ListBox control.
Is there any method for ListBox control as in Tab control like TabCtrl_InsertItem().?
If you know any other alternative then plz reply me.
Thanks in Advance.
Ashish Bhatt
|
|
|
|
|
You can use of these messages LB_ADDSTRING or LB_INSERTSTRING .
|
|
|
|
|
Ya You are absolutely right. Using these messages I can add String to ListBox.
But my problem is that how to insert string in to ListBox??
Ashish Bhatt
|
|
|
|
|
Sorry,
I tried as you told and I got the solution.
If I will get some problem then I will contact you.
Thank you very much.
Ashish Bhatt
|
|
|
|
|
Hi,,
I got little much problem with same.I am using SendMessage() function to set the value for the ListBox using LB_ADDSTRING message.
But I got not perfect value as pass here in the parameter lParam of Sendmessage() function.
I am passing such like this.
<br />
char *str ="Desktop";<br />
SendMessage(m_list1,LB_ADDSTRING,NULL,(LPARAM)(str));<br />
And I got undefined value in listbox like square rectangles.
If you have any other way to pass then tell me.
Thanks.
Ashish Bhatt
|
|
|
|
|
TCHAR str[120] =_T("Desktop");
::SendMessage(GetDlgItem(IDC_LIST1)->m_hWnd,LB_ADDSTRING,0,(LPARAM)(str));
|
|
|
|
|
Hello all,
i want to make a dialog box in which i want to make a progress bar.....my problem is i want that as soon as exe is clicked dialog box should appear and progress bar should start running(without any click event). How should i do this....
Thanks in advance..
|
|
|
|
|
You can just put a progressbar in dialog through resource editor.
In the OnInitDialog set a timer and in the OnTimer you can call StepIt api of the progressbar.
- NS -
|
|
|
|
|
Hello All,
I am using one variable of type BYTE *
Now i want to allocate memory to it but at runtime.
The problem is that size will not remain fixed after intitalization, it may increase as i want to store element in it.
I had used malloc, GlobalAlloc , but it want work because it require size of memory to me initialize.
but i need when i am inserting an element to the variable then it shuld increase size by one?
Thanks in advance.
Manish Patel.
B.E. - Information Technology.
|
|
|
|
|
Can you use CArray ?
The CArray class supports arrays that are are similar to C arrays, but can dynamically shrink and grow as necessary.
Regards,
Paresh.
|
|
|
|
|
No,
i cant use CArray
because i need to maitain pointers and copy contains directly from memory
Any other Solution?
Manish Patel.
B.E. - Information Technology.
|
|
|
|
|
std::list sounds like a good choice since elements won't move in memory once they're in the list.
|
|
|
|
|
Manish_mnp wrote: i cant use CArray
because i need to maitain pointers and copy contains directly from memory
Sounds like you could use std::vector.
A vector is guaranteed to be in one continouus memory chunk, and you can get the address (which may change when adding items!) as the adress of its first item.
That is for std::vector<BYTE> vec by calling &vec[0] .
Let's think the unthinkable, let's do the undoable, let's prepare to grapple with the ineffable itself, and see if we may not eff it after all. Douglas Adams, "Dirk Gently's Holistic Detective Agency"
|
|
|
|
|
first time use malloc() and from next time use realloc()!!!!!!!!!
|
|
|
|
|
i have to open a file from my server system in my activex program. how to open in my activex. ex: <param name="data" value="http://192.168.168.106/Sapphire/B55.txt" /> is my paramlist for the activex how to open this file b55.txt in my activrx. pls help me
|
|
|
|
|
I am trying to display Japanese characters in a CRichEditView by setting the text using GetRichEditCtrl().ReplaceSel(…) , but it does not work. The correct font is selected, so I know that is not the problem.
DBCS Example:
1) I run the Rich Text (RT) application, written in VC6.
2) Open ‘Accessories->System Tools->Character Map’, select same Font and Language as RT app., select full-width character ‘Z’ and paste it to RT app.
3) No problem!
4) Inside the RT app., programmatically select the DB text, and get a copy of it using GetRichEditCtrl().GetSelText() .
5) Replace the selected text with the copy you just made using GetRichEditCtrl().ReplaceSel(…) .
6) Problem: Instead of displaying a DB character it displays the ‘lead’ and ‘trail’ bytes as individual characters.
The full-width ‘Z’ is stored as “\x82\x79”, but if you pass that string to ReplaceSel(…) , it will display “,y” instead of “Z”.
I have verified that the correct font is specified for the text being displayed (SHIFTJIS_CHARSET, "MS PMincho"), but it is not showing correctly, as stated above.
Do you have any ideas why this happens?
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
I apologize in advance for not posting code, but it would have required the whole "server.cpp" and "clinent.cpp" files, so I reference their URLs at MSDN. I think my question is quite specific; however. Where do I pass the hostname/address parameters? I have tried many locations replacing references, etc with localhost or 127.0.0.1.
Using the MSDN sample client/server code I cannot find where to input the server name/address
argument/parameters. Both the client and the server compile fine.
The server is supposed to receive data from the client and echo it back to the client. In this case both client and server run on the same machine and I believe should use server name or address as localhost or "127.0.0.1".
The Server code can be found at:
http://msdn2.microsoft.com/en-us/library/aa922634.aspx
When I run it I get this message which looks OK, accept I always get odd
characters for type:
"Socket 0x0012f8d8 ready for connection with ╕ ↕ family, öq╜Θê↓╚☺ type, on port"
The Client code can be found at:
http://msdn2.microsoft.com/en-us/library/aa916685.aspx
When I run the client I get this message:
"Server name/address parameter required. Ex: clnt 123.45.67.89
Press any key to continue . . ."
I am not sure (1) where to place the host address
argument, and (2) if it needs to be just passed from the
client side or both.
I have tried placing variations of 127.0.0.1, "127.0.0.1", localhost, "localhost" in various
locations such as "getaddrinfo" area, etc. but I still get the clinet asking for sever parameters or get build errors.
Again, my question is where/how do I tell the client how to reach the server (pass server parameters) and/or do I need to do the same for the server to reach the client for echo returns?
Thanks much
mt
|
|
|
|
|
managetao2 wrote: Where do I pass the hostname/address parameters?
Hmmm. From just looking at the Help-text the clinet emits when called without parameters,
if(argc < 2)
{
Print(TEXT("Server name/address parameter required. Ex: clnt 123.45.67.89"));
goto Cleanup;
}
else
{
...
}
} I think you too will eventually see the light...
Let's think the unthinkable, let's do the undoable, let's prepare to grapple with the ineffable itself, and see if we may not eff it after all. Douglas Adams, "Dirk Gently's Holistic Detective Agency"
|
|
|
|
|
Hi there,
I'm wondering if it is possible to enable n-up pages per sheet printing by just modifying the DEVMODE structure.
I reconned that its possible to query the dmFields member for value DM_NUP (works for my printer, obviously it supports n-up) and I will get all allowed n-up values by asking the DeviceCapabilities function for capability DC_NUP. (i get an array of 6 DWORD values; 1, 2, 4, 6, 9, 16)
The big question now is how to set one of those values to the printer.
I couldn't find a field in DEVMODE structure where to set the number of logical pages per physical page.
The only thing to be set is who is handling the NUP printing (spooler or application), but no hint from Microsoft how to implement application NUP printing ...
Any ideas?
Thx in advance for any glues ...
Chris
P.S.: I moved this post from article 'Printing Architecture', feel free to move it if it isn't the right place here ...
|
|
|
|
|
I am not sure if I am understanding you. For example... in my project I use a self defined CPrintDialog derived class. I give the possibility of choosing what class of info should me printed (All, Graphics, Text_info, ...) and the large of my print job depends on this as follows. Graphics is 1 page; Text_info is 1-4 or 1-2 or 3-8 (depending of which elements info have to be printed and the actual working project)...
So I can print from 1 to 15 pages but the user don't say how many pages he want to print, just check / uncheck some radio buttons selecting what he want to have printed. All the rest is dinamical depending on number of elements in the actual project.
Is something like that what you are asking for??
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
OK, sry for being not accurate in my 1st post, what I'm looking for is:
o) There is 1 physical printer, all printouts (most of them) are printed on that one ...
o) Customer wants to see one product out of lets say 30 to be printed as 2 pages on sheet of paper (to save paper of course; printout can be up to 80 pages long)
By default the printer is set to print 1 page of printout to one physical sheet of paper. (no duplex).
But for this one special product I have to override printersettings and tell the printer not to print 1 page on 1 sheet but print 2 pages on 1 sheet.
The problem now is how to set that, I haven't found anything in DEVMODE structure to set.
The only thing I'm able to do right now is to get the informatin from the printer if it is capable of printing multiple pages on sheet or not and how many pages it is able to print on one sheet.
Hth,
Chris
|
|
|
|