Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hiding everything and taking control 1

Status
Not open for further replies.

exodus300

Programmer
Mar 22, 2002
262
0
0
AU
I have two questions:

1. How can I hide everything on the windows desktop so that only the user's background shows (except for my program's form, of course!)?

2. How can I make it that my form is the only one that can be focused, and you can't switch to another window (kinda like a system modal dialog)?

Thanxz. [Thanks in advance|Hope I helped you]
Exodus300
World-Wide Alliance of Evil and Twisted People
[red]"Experimentation by Example is the best learning tool" - Exodus300[/red]
[pc3]
 
//taskbar hide
ShowWindow(FindWindow( "Shell_TrayWnd",NULL), SW_HIDE);
//taskbar show
ShowWindow( FindWindow( "Shell_TrayWnd",NULL), SW_SHOWNA);
------------------------------------------------------------//taskbar icons hide
ShowWindow( FindWindowEx( FindWindow("Shell_TrayWnd", NULL),
HWND(0), "ReBarWindow32", NULL),
Sw_Hide);
//taskbar icons show
ShowWindow( FindWindowEx( FindWindow("Shell_TrayWnd", NULL),
HWND(0), "ReBarWindow32", NULL),
SW_SHOW);
-------------------------------------------------------------------
//disable taskbar exmp
void __fastcall TForm1::Button1Click(TObject *Sender)
{
HWND HTaskbar;
HTaskBar=FindWindow("Shell_TrayWnd",NULL);
EnableWindow(HTaskBar,false);
}
-------------------------------------------------------------
//enable taskbar
void __fastcall TForm1::Button2Click(TObject *Sender)
{
HWND HTaskbar;
HTaskBar=FindWindow("Shell_TrayWnd",NULL);
EnableWindow(HTaskBar,true);
}
------------------------------------------------------------
//desktop icons hide
ShowWindow(FindWindow(NULL,"Program Manager"),SW_HIDE);
-------------------------------------------------------------
//desktop icons show
ShowWindow(FindWindow(NULL,"Program Manager"),SW_SHOW);
-----------------------------------------------------------------
//disable desktop icons
EnableWindow( FindWindowEx( FindWindow("Progman", NULL),
HWND(0), "ShellDll_DefView",NULL),false);
-----------------------------------------------------------------
//enable desktop icons
EnableWindow( FindWindowEx( FindWindow("Progman", NULL),
HWND(0), "ShellDll_DefView", NULL),true);
--------------------------------------------------------------------
//hide start button
ShowWindow (FindWindowEx(FindWindow("Shell_TrayWnd",
NULL),0,"Button",NULL),SW_HIDE);
-------------------------------------------------------------
//show start button
ShowWindow (FindWindowEx(FindWindow("Shell_TrayWnd",
NULL),0,"Button",NULL),SW_SHOWNORMAL);
-------------------------------------------------------------

//disable start button
EnableWindow(FindWindowEx(FindWindow("Shell_TrayWnd",NULL),
0,"Button",NULL),false);
-----------------------------------------------------------------
//enable start button
EnableWindow(FindWindowEx(FindWindow("Shell_TrayWnd", NULL),
0,"Button",NULL),true);
-----------------------------------------------------------------
//open start button
void __fastcall TForm1::Button3Click(TObject *Sender)
{
SendMessage(Form1->handle,WM_SYSCOMMAND,SC_TASKLIST,0);
}
-------------------------------------------------------------------
//right click disable
//right click enable
-----------------------------------------------------------------
//hide quick launch bar
void __fastcall TForm1::Button1Click(TObject *Sender)
{
HWND TopWindow;
TopWindow=FindWindow("Shell_TrayWnd", NULL);
TopWindow=FindWindowEx(TopWindow,0, "ReBarWindow32", NULL);
TopWindow=FindWindowEx(TopWindow,0, "SysPager", NULL);
ShowWindow( TopWindow,SW_HIDE);
}
-----------------------------------------------------------------
//show quick launch bar
void __fastcall TForm1::Button2Click(TObject *Sender)
{
HWND TopWindow;
TopWindow=FindWindow("Shell_TrayWnd", NULL);
TopWindow=FindWindowEx(TopWindow,0, "ReBarWindow32", NULL);
TopWindow=FindWindowEx(TopWindow,0, "SysPager", NULL);
ShowWindow( TopWindow,SW_SHOW);
end;
------------------------------------------------------------------------
//hide tray icons
ShowWindow( FindWindowEx( FindWindow("Shell_TrayWnd", NULL),
HWND(0), "TrayNotifyWnd", NULL),
SW_HIDE);
--------------------------------------------------------------------------
//show tray icons
ShowWindow( FindWindowEx( FindWindow("Shell_TrayWnd", NULL),
HWND(0), "TrayNotifyWnd", NULL),
SW_SHOW);
-------------------------------------------------------------------------------
//hide clock
ShowWindow(
FindWindowEx(FindWindowEx( FindWindow("Shell_TrayWnd", NULL),HWND(0), "TrayNotifyWnd", NULL),
HWND(0), "TrayClockWClass", NULL),
SW_HIDE);
----------------------------------------------------------------------------------
//show clock
ShowWindow(
FindWindowEx(FindWindowEx( FindWindow("Shell_TrayWnd", NULL),HWND(0), "TrayNotifyWnd", NULL),
HWND(0),"TrayClockWClass", NULL),
SW_SHOW);
--------------------------------------------------------------------------------
//eat desktop
TCanvas DeskTopCanvas;

void __fastcall TForm1::FormCreate(TObject *Sender)
{
DeskTopCanvas=new TCanvas();
DeskTopCanvas->Handle:=GetDC(Hwnd_Desktop);
}

void __fastcall TForm1::Timer1Timer(TObject *Sender)
{
DeskTopCanvas->Pen.Width=Pen.Width+5;
DeskTopCanvas->Arc(100,90,80,100,50,80,60,50);
}



----------------------------------------------------------
//remove wallpaper
#include "ComObj.hpp"
#include "ShlObj.hpp"

void __fastcall TForm1::Button1Click(TObject *Sender)
{
IActiveDesktop *ActiveDesktop;
TColor Color;
DWord Element;

Color = clBlack;
Element = COLOR_BACKGROUND;
ActiveDesktop = (IActiveDesktop *)CreateComObject(CLSID_ActiveDesktop)

ActiveDesktop->SetWallpaper("", 0);
ActiveDesktop->ApplyChanges(AD_APPLY_ALL || AD_APPLY_FORCE);
// this code to change the background color
SetSysColors(1,Element,Color);
}
That's all folks!
----------------------------------------------------------------
 
Wow, thanxz!

Any ideas on a system-modal dialog? [Thanks in advance|Hope I helped you]
Exodus300
World-Wide Alliance of Evil and Twisted People
[red]"Experimentation by Example is the best learning tool" - Exodus300[/red]
[pc3]
 
Whoa, this definitely deserves a star!!!

How can I completely disable the start menu so it can't be accessed with Ctrl+ESC or the Windows key? [Thanks in advance|Hope I helped you]
Exodus300
World-Wide Alliance of Evil and Twisted People
[red]"Experimentation by Example is the best learning tool" - Exodus300[/red]
Code:
if (pop_tarts == 0)
{
   tantrum = 1;
}
[pc3]
 
Ok, a certain combination of the above proceedures disables start menu access via the windows key, but I don't exactly know which combination (if I have time I will work it out).

I read on that you can disable Ctrl+Alt+Delete by making the OS think that the screen saver is running, but this does not work on all OS's. Is there a way to make it work on all OS's? And/Or how can I intercept Ctrl+Alt+Del so that my own program shows instead? [Thanks in advance|Hope I helped you]
Exodus300
World-Wide Alliance of Evil and Twisted People
[red]"Experimentation by Example is the best learning tool" - Exodus300[/red]
Code:
if (pop_tarts == 0)
{
   tantrum = 1;
}
[pc3]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top