Kishore_S22

Hi,

I have 2 windows as part of my application running constantly. if i want taskbar to be blocked throughout once this application is lanched and only those 2 windows are available for user interaction. is there any way to do it




Re: Visual C++ General Application windows as Top Most Window & Disabling Taskbar

Ramkrishna Pawar

You can find all other(running in other processes) windows using EnumWindows Function () and may be hide/disable them for the time you need to block access.

ShowWindow Function ()

EnableWindow Function ()

GetWindowThreadProcessId Function () // to identify if the window is running in another process, you dont want to disable/hide your own windows.






Re: Visual C++ General Application windows as Top Most Window & Disabling Taskbar

Simple Samples

It is my understanding that you need to prevent use of any application other than yours when your application is executing. Is that correct






Re: Visual C++ General Application windows as Top Most Window & Disabling Taskbar

Kishore_S22

yes is there any solution




Re: Visual C++ General Application windows as Top Most Window & Disabling Taskbar

Simple Samples

There are probably many possibilities, all of which are actually off-topic for the VC forums. You are likely to get the best answer in a Windows programming forum or newsgroup and this forum is not one of them. I will at least suggest some possibilities. I realize that these possibilities probably don't satisfy requirements but I don't know what the requirements really are.

The simplest solution would be to limit the account (user) to use of your application only. A user could have an additional account if they need to use all other applications they would normally use except yours. This is likely to be the most flexible or among the most flexible. It requires little or no development and therefore is fully manageable by administrators.

Another possibility is to create an additional desktop within an account (user). I am not familiar with all the details but there is a Platform (Windows) SDK sample of creating desktops.

Your application could intercept process creation and/or window activation and/or other uses of other applications and/or windows.




Re: Visual C++ General Application windows as Top Most Window & Disabling Taskbar

Paul Marriott

In win32, you can do this with

HWND hWnd;

hWnd=FindWindow("Shell_TrayWnd",NULL);

if (hWnd)
ShowWindow(hWnd,SW_HIDE);

and do the reverse when your program closes

hWnd=FindWindow("Shell_TrayWnd",NULL);

if (hWnd)
ShowWindow(hWnd,SW_SHOWNORMAL);





Re: Visual C++ General Application windows as Top Most Window & Disabling Taskbar

Kishore_S22

yes that we have done but in Vista task bar and Start buttons are different windows. how to disable start button






Re: Visual C++ General Application windows as Top Most Window & Disabling Taskbar

Paul Marriott

Looking at the Start button with spy++, the class name is Button and Window name is "Start"

So you would use

hWnd=FindWindow("Button","Start");

I dont know if this would work with non english windows as the window text of the "Start" text of the start button may be different.





Re: Visual C++ General Application windows as Top Most Window & Disabling Taskbar

Paul Marriott

This works on english language version of vista:

hWnd=FindWindow("Button","Start");

To hide Start Button.

The other option is to use window policy settings to restrict what the task etc can do, but this is a lot of work to learn and use. The settings are stored in the registry and engaged when the computer is restarted, whereas hiding the taskbar and start button can be done while windows is running and perhaps a password can be used to show them again.





Re: Visual C++ General Application windows as Top Most Window & Disabling Taskbar

Pintu Shukla


No Doubt that it can have different name .Will suggest you not to perform your operation on the name of the window .if you want to get the handle of window simply use it's class name instea of the window name .Because even in case of English version also you can change the name of window by your code.so it is always advisable that instead of putting your logic on label , put it on control id or it's class name .

Thanx