Link to home
Start Free TrialLog in
Avatar of ChrisBerry
ChrisBerryFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Hiding Program Manager et al

Hi,

Minor problem using Win95 and NT and programming in Delphi 3. In my program, I wish to hide the Program Manager and the Taskbar while I have a program running, so as to stop the operator invoking another program, then restore them afterwards.

I have no problem hiding and restoring either the Program Manager or the Taskbar but I have noticed that when both are hidden then by double clicking on the blank screen I can get the Start Menu to appear.

My question is how do I stop this happening?

Cheers

Chris
Avatar of Madshi
Madshi

How about stopping the explorer (by sending a WM_QUIT to the "Program Manager" window)?

Regards, Madshi.
would making the form modal stop clicking on desktop
Regards Barry
Hi Barry, would not work, since showModal only disables windows of your own process, not the desktop window.
But your idea brings me to another idea:

Chris, try this one:

  c1:=FindWindowEx(FindWindowEx(FindWindow('Progman','Program Manager'),0,'SHELLDLL_DefView',''),0,'SysListView32','');
  EnableWindow(c1,false);
  MessageBox(0,'Desktop is enabled now...','Info',0);
  EnableWindow(c1,true);

Regards, Madshi.
oh yeh Doh
i been trying a way with getclientrect and not letting mouse leave it but wont bloody work either .if there's to be no double clicking on the desktop maybe make a form to sit in background (Just a thought :-)
Barry
if you don;t won't the mouse to move out of a rectange you do something like this...

var
  r : TRect;
begin
  r := rect(0, 0, 100, 100);
  ClipRect(@r);
  //Now you can only move your mouse withing that region  (the rectangle)... If you want to go  //back and return the control over the mouse you should do this...
  ClipRect(nil);
end;

I hoe this helps Barry :)

¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
¤¤¤¤¤ STARS  ¤¤¤¤¤
¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
cool i never used this rect thing only read a bit about it so thanks for sample :-)
Regards Barry




no problem.....:))

¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
¤¤ MORE AND MORE STARS :)) ¤¤¤
¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
Avatar of ChrisBerry

ASKER

Hi all,

Sorry for the delay, EE had my old e-mail address and I thought no one was responding.

Madshi, I have tried your idea but SyslistView32 is not available to disable before it exists. I can of course disable Progman, but only when it is visible, but my requirement is for it not to be visible.

This is what I have found so far unless I am doing it wrong!.

victornet and Barry,

I cannot use rect clipping or modal as I wish to go between a couple of windows.

Cheers

Chris

Chris,

you said you've hidden both program manager and explorer. So if you've HIDDEN them, they should be still there, right? Why then is there no "SyslistView32"?
And how did you hide these programs? How about stopping them instead of hiding them (see my first comment)?
Hmmm. If I double click on my desktop, nothing happens at all. Ok, I've win98 now...  I remember something like win95 would start "c:\windows\taskman.exe" if you double click on the desktop. Or am I wrong?

Regards, Madshi.
Madshi,

Thanks for your reply,

I used the following to hide the windows

  StrPCopy(@wndClass[0], Window);
  wndHandle := FindWindow(@wndClass[0], nil);
  ShowWindow(wndHandle, SW_HIDE);       // This hides the window

Where Window is the class of the window I am hiding eg Progman or the systray.

I tried to fit your solution around this and only managed to get Progman disabled, which could be a solution to my problem but leaves all the icons on the desktop.

The only thing I can think of is there is another window present, I have a program that will tell me all the windows current (and potential), that I should be able to hide. Basically if I hide the systray then double click on the "wallpaper" the Start Menu come up, regardless of whether Progman is running.

Stopping them causes a task manager dialog box to appear when double clicked, also not desirable.

Hope this helps. BTW I am only trying this on Win95 at the moment.

Regards

Chris

You could stop the explorer (so that a double click on the desktop would bring up the task manager dialog box) and rename (or even delete) the file "c:\windows\taskman.exe" (which IS the task manager dialog box).

Regards, Madshi.
Chris, I was just trying to tell Barry how to clip a rectangle.. I know that it wouldn't help you to use rectangle clipping...
Madshi,

Please lock this so I can give you the points. I am unable to do what I have wanted so I have negotiated that I can disable the Progman window.

Regards

Chris

ASKER CERTIFIED SOLUTION
Avatar of Madshi
Madshi

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hmm. There are more possibilites. You could write a system wide hook, that is called before a window is created. Then in this hook you can look at the window to check if you like it. If not, you can tell Windows to destroy it (even before it is opened). If you like this - tell me - I've some sources for that. But - you'll need a little DLL for that...

Regards, Madshi.