|
I have seen several articles on various sites about how to prevent an application from showing on the taskbar. Can anyone point me at some information on how to hide an application from the tasklist as well?
|
|
|
|
|
This is a fragment of VB code I've found on the Internet. It is simple to understand and to port it to VC++. I didn't write this code, but I've tried it, and it works!
The author is Andrew Thomas
This is the original URL :
http://www.visual-statement.com/vb/Tips/dsk16.txt
By: Andrew Thomas
To hide your application from the task list,
you must register your program as a service.
This is done by passing the process ID of
your application to the RegisterService API.
Declarations
Copy the following code into the declarations section of a module:
Public Declare Function GetCurrentProcessId Lib "kernel32" () As Long
Public Declare Function GetCurrentProcess Lib "kernel32" () As Long
Public Declare Function RegisterServiceProcess Lib "kernel32" (ByVal dwProcessID As Long, ByVal dwType As Long) As Long
Public Const RSP_SIMPLE_SERVICE = 1
Public Const RSP_UNREGISTER_SERVICE = 0
Procedures
To remove your program from the Ctrl+Alt+Delete list, call the MakeMeService
procedure:
Public Sub MakeMeService()
Dim pid As Long
Dim reserv As Long
pid = GetCurrentProcessId()
regserv = RegisterServiceProcess(pid, RSP_SIMPLE_SERVICE)
End Sub
To restore your application to the Ctrl+Alt+Delete list, call the
UnMakeMeService procedure:
Public Sub UnMakeMeService()
Dim pid As Long
Dim reserv As Long
pid = GetCurrentProcessId()
regserv = RegisterServiceProcess(pid, RSP_UNREGISTER_SERVICE)
End Sub
Don't forget to unregister your application
as a service before it closes to free up
system resources by calling UnMakeMeService.
|
|
|
|
|
Thank you for your response, but I am sorry I was not clearly describing what I am trying to do in my last post.
I am looking for a way, on Windows NT, to hide an application's icon from the ALT+TAB list. If anyone knows how this can be accomplished, I would appreciate the information.
Ronald L. Russell Jr. (Ron)
rrussell@ygrest.com
|
|
|
|
|
I want to have a background image for the List View Control,this list view control is inside a dialog(which is office 97 wizard - propertysheet).
I have set the background image for the dialog, using the constructor of wizard97 property sheet.
I wanted to have the transparency effect for the list view control, I tried setting the extended style option of transperency for the list view control,but it did not work.
So, I tried using SetBkImage function, so that i can have different bitmap for the list view control. But, the image is applied to the background of the dialog,(which is overriding the bitmap set using the c'tor of wiz97) instead of the list view control.
It would be great to have this working.
Thanks in advance.
Cheers
Kannan
|
|
|
|
|
How can I update resources under Windows 89/Me???
In the Win NT or 2000 it's very easy :
1.BeginUpdateResources
2.Update Resources
3.EndUpdaterResources.
But How can I make the same under Windows 89/Me???
|
|
|
|
|
I want to create a borderless window without title bar,I try
set the CreateWindow's parameter dwStyle to WS_VISIBLE only,but the window be created also have title bar and border.
thanks for any help!
by the way,pardon my poor english.
|
|
|
|
|
Basically, you want WS_VISIBLE | WS_POPUP. Here's some code (taken out of context) that I use. It will create a little rectangular window near the uppper left of your screen that is hard to see unless you throw in a little drawing code. From here, everthings up to you - title, border, menus, whatever.
m_wndSession is a class member derived from a CWnd. It it used to create a kiosk effect by sizing itself to the screen and overriding the ususal drawing fns.
This code just shows creation and makes it black so you can see it. (As I say, this code is out of context).
I register a new class here so I can get ownership of the device context, because this is a greedy and selfish window and definitely not a team player.
CString csWndClass = AfxRegisterWndClass(CS_OWNDC,
0,
0,
0);
if(!(m_wndSession.CreateEx(WS_EX_LEFT,
(LPCTSTR)csWndClass,
"Session Window",
WS_VISIBLE|WS_POPUP,
10,10,100,20,
NULL,
NULL
))) {
AfxMessageBox("Failed to Create Session Window)");
return;
}
CBrush cbr(RGB(0,0,0));
CDC* pDC = m_wndSession.GetDC();
pDC->SelectObject(cbr);
RECT rect = {0,0,1500,1500};
pDC->FillRect(&rect,&cbr);
m_wndSession.Invalidate();
...
|
|
|
|
|
how do i make a dialog hidden *before* it gets shown?
|
|
|
|
|
Is this a modal or modeless dialog? A hidden modal dialog makes no sense. You must therefore mean a hidden modeless dialog, which you can create without the WS_VISIBLE style.
|
|
|
|
|
Hi,
I'd like to to keep a database password inside a text file (similar to an INI file) to be used by my ANSI C++
program on Windows and UNIX. Naturally, I'd like to encrypt the password inside the file.
Do you know of a nice API or set of classes I can use for this?
Thanks a bunch!
Alvaro
|
|
|
|
|
Here is an exerpt from the readme file of Crypto++. There is a newer version too. The link is at the bottom.
--tale
---------------------------------------------------------
Crypto++: a C++ Class Library of Cryptographic Primitives
Version 3.2 3/20/2000
This library includes:
MD2, MD5, SHA-1, HAVAL, Tiger, RIPE-MD160, MD5-MAC, HMAC, XOR-MAC,
CBC-MAC, DMAC, DES, IDEA, WAKE, 3-WAY, TEA, SAFER, Blowfish, SHARK, GOST,
CAST-128, Square, Diamond2, Sapphire, RC2, RC5, RC6, MARS, Rijndael,
Twofish, Serpent SEAL, Luby-Rackoff, MDC, various encryption modes (CFB,
CBC, OFB, counter), DH, DH2, MQV, DSA, NR, ElGamal, LUC, LUCDIF, LUCELG,
Rabin, RW, RSA, BlumGoldwasser, elliptic curve cryptosystems, BBS, DEFLATE
compression, Shamir's secret sharing scheme, Rabin's information dispersal
scheme. There are also various miscellanous modules such as base 64
coding and 32-bit CRC.
You are welcome to use it for any purpose without paying me, but see
license.txt for the fine print.
Crypto++ has been compiled successfully with MSVC 6.0 on Windows 2000
and GCC 2.95.2 on FreeBSD 3.4.
Good luck, and feel free to e-mail me at weidai@eskimo.com if you have
any problems. Also, check http://www.eskimo.com/~weidai/cryptlib.html
for updates and new versions.
|
|
|
|
|
Hello,
I am building a simple program with VC ++ 6
I am using a dialog box to calculate the time it takes to finish a race in ideal time. (type in distance, input speed constant and click CALC then time should apear).
I am having a bit of trouble however converting the base 10 calculated time to real time. I get 1.5 instead if 1 hour 30 minutes. I was wondering if there are routings in VC that do this. Using integers it woul dnto be too bad I could mod 60 everything but I am dealing with floating point numbers and that is why I am stuck.
If you could help I would be greatly appreciated here
Thank you
|
|
|
|
|
Can anyone suggest me a tool to create AVI files for use with CAnimateCtrl, preferably one that allows to create 16 color AVIs?
|
|
|
|
|
Hi,
Can any expert tell me that how can I display the elapsing time once i have started the timer. It's should be something like a swatch watch. I need to know how to code the elapsing timer and to display it on the screen. I have done some coding that starts the timer and stops the timer, but that is in increment order, i need a decrement order timer function. I use the Pc system timer to implement the timer class. In my class i have included the folowing functions:
StartTimer()
EndTimer()
GetDuration()
Thank you for your help.
|
|
|
|
|
In what context.
Be a bit more specific.
Do you:
a. Need drawing code for the watch (swatch)
b. Or just need to know when the timer has elapsed.
Regards
Norm
|
|
|
|
|
I would like to know if there's a way to add checkbox in a CListCtrl view for each column
|
|
|
|
|
I am in the process of developing a custom desktop for Windows NT. In my implementation of this custom desktop, there is a window along the bottom of the screen that emulates the behavior of the Windows NT Taskbar.
This taskbar implementation sets a WH_SHELL hook and a WH_CALLWNDPROC hook to receive notifications concerning window creation, title changes, etc.
During the early portions of development, this custom shell was always ran on top of Explorer.exe. Eventually the custom shell was moved to a test system whose policy file (ntconfig.pol) directs windows to run the custom shell at boot time rather than Explorer.exe.
I have noticed that when this is the case, I no longer receive callbacks from the WH_SHELL hook procedure, although I still receive callbacks from the WH_CALLWNDPROC hook procedure.
I can launch Explorer.exe from the custom shell and I begin to receive callbacks from the WH_SHELL hook. I can even end the Explorer.exe task from the taskmanager, and I still receive shell hooks. It seems that Explorer.exe must at least run once before I receive any callback from the WH_SHELL hook.
I have discovered no information anywhere on MSDN that indicates that this is the case.
Does anyone have any information as to why an application would not receive WH_SHELL hook procedure callbacks unless Explorer.exe has been started at least once on a system?
|
|
|
|
|
When you do receive WH_SHELL callback, what process is the hook DLL in ?
|
|
|
|
|
Where can I find a decent corba IDL compiler for ms vc++ 6 ?
I found a couple of sites on the net but with all of them you need to install tons of junk before it works .... and then it still gives problems !!
|
|
|
|
|
I am wondering how those guys coded file/directory hiding in the "Magic Folders" program at the system level.
Is that some kind of file system driver ?
Any ideas?
|
|
|
|
|
You might check out the docs for the CreateFile api call. Don't let the name fool you, this call also opens objects for reading.
The Shell API also knows all about the special flavored folders. There is a good tutorial on the shell here at codeproject.
Jim
|
|
|
|
|
I use a CWebBrowser2 control to display reports details from my program. I generate the HTML, and display it in the CWebBrowser2 window. I'd like to also display graphs in this window. If I bought the Dundas Chart ActiveX control, does anyone out there know if I could insert it into my CWebBrowser2 control? I can't use the Server Side edition of Dundas Chart as I the computers my app is running on can quite possibly be totally stand-alone.
Thanks for any help at all.
|
|
|
|
|
Hi
Well I'm close to insanity so it's time to ask you, the gurus
I've made a DLL in Visual C++ and can successfully call it from within Visual Basic. However, I can't pass function arguments. For instance, one of my functions is:
SetWindowPosition(LONG handle, float width, float height)
Which is declared in VB as:
SetWindowPosition(ByVal handle As Long, ByVal width As Single, ByVal height As Single)
Strangely the last argument is passed correctly, the rest take on erroneous values such as 9.72*e-39. Why would one argument (eg. height) be passed correctly but width is garbage? Guessing it had something to do with the stack, and misaligned arguments (ie 8 byte long reading 4 byte int), I've tried a simple function with just one argument (Single->float as per VB4DLL.txt) but even this produces garbage. With the above function I've also tried converting from Long to long, unsigned int, int, etc. Any ideas?
Regards
Brendan
(For the record I have done the following:
1/ Using a DEF file
EXPORTS
SetWindowPosition //note I don't have @1 is that a problem?
2/ Using extern "C" __declspec(dllexport) before function
3/ no __stdcall statements but it still runs...
|
|
|
|
|
Well like most problems the solution is simple. I'll post it here to ease the agony on others who might have to trawl through mountains of messages.
In VB a function that returns a variable is declared as 'Function' and a function that doesn't return a variable is declared as 'Sub'. So the correct declaration is
Public Declare Sub DoSomething Lib "DLL.dll" (ByVal dooba As Long)
for a function that doesn't return a value. and,
Public Declare Function DoSomething Lib "DLL.dll" (ByVal dooba As Long)
for a function that does return a value.
Obviously it stuffs the stack up if you don't do it right, and this is what produced the erroneous values.
|
|
|
|
|
Sorry for not being as clear on my last post =(
Is there a way to give focus to your program even when you don't control the program that DOES have focus?
|
|
|
|
|