Hi...

I looking for a way to hide application from the Task bar bottom line and i need to accomplish it by using the application executable name only...
All information that i have it the process name which runs in the task bar

Ive googled for a while but haven't found what i need...

b.t.w it hoas nothing to do with anything nefarious... i don't want to hide the process name from the task bar , only the window... (cause in my case the window is blank, and i cant do anything but hide it- HOW?)

Thx ahead


Daniel.

Recommended Answers

All 10 Replies

[edit]On second thought, I don't think below is what you are looking for[/edit]

Here's how to hide the console window

#include <windows.h>

int main()
{
    HWND hWnd = GetConsoleWindow();
    if(hWnd)
        ShowWindow(hWnd, SW_HIDE);

    Sleep(5000);

}

thx,

but where is the place that i set the name of the program i want to hide, for example "notepad.exe"

?

I think it goes like :

#include <windows.h>

int main()
{
    HWND hWnd = FindWindow(NULL, "The title of the window to hide here");;
    if(hWnd)
        ShowWindow(hWnd, SW_HIDE);

    Sleep(5000);
}

[edit]
I missed the part where you said "by executable name", so my code is probably not what you want, sorry for the trouble..

Now I'm confused about what you are trying to do. I thought you wanted to hide the console window from within the program that is running.

But if you want to write a program that launches another program and hide its window then you can do it with win32 api function CreateProcess(). The lpStartupInfo parameter is a structure and you can set it to disable the console window.

I don't think you can do it by executable name, such as notepad.exe, because the same executable can be running multiple times

Thx niek_e, its almost what i need...

i'm looking for a way to do the same but using the application name, instead of seeking using "Untitled - Notepad"
I'm looking for a way to use "notepad.exe" and in my case the executable wont appear more than once.

any ideas?

I agree with Ancient Dragon, I don't think it can be done that way

commented: Helped me +1

Here's how to hide the console window

You might have to add

#define _WIN32_WINNT 0x0500

before you include the windows library to use the GetConsoleWindow() function.

any ideas?

This is bit vague but an idea anyhow, so here goes ...

Use EnumProcesses() to map process ids to executable names, that
gives you the process id of the target program. Then use EnumWindows() together with GetWindowThreadProcessId() to figure out the window handle you need to operate on.

Note however that EnumProcesses() is part of the process status helper api (psapi.dll) and may or may not be installed on a given system. I don't know whether MS distributes it as regular part of Windows these days. Moreover, if you are running as a restricted user, it may be that the user rights are not sufficient for getting all the data you need.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.