Click here to Skip to main content
15,914,322 members
Home / Discussions / C#
   

C#

 
GeneralSetting a control focus when form is loaded Pin
Anonymous28-Apr-05 17:47
Anonymous28-Apr-05 17:47 
GeneralRe: Setting a control focus when form is loaded Pin
rudy.net28-Apr-05 19:27
rudy.net28-Apr-05 19:27 
GeneralRe: Setting a control focus when form is loaded Pin
Anonymous29-Apr-05 5:37
Anonymous29-Apr-05 5:37 
GeneralRe: Setting a control focus when form is loaded Pin
Kodanda Pani28-Apr-05 19:33
Kodanda Pani28-Apr-05 19:33 
GeneralRe: Setting a control focus when form is loaded Pin
M.Waseem Chishti28-Apr-05 20:23
M.Waseem Chishti28-Apr-05 20:23 
GeneralHide Taskbar from C#.net Pin
Kyaw Soe Khaing28-Apr-05 16:50
Kyaw Soe Khaing28-Apr-05 16:50 
GeneralRe: Hide Taskbar from C#.net Pin
leppie28-Apr-05 19:18
leppie28-Apr-05 19:18 
GeneralRe: Hide Taskbar from C#.net Pin
Fernando Soto28-Apr-05 19:41
Fernando Soto28-Apr-05 19:41 
Hi kyawsoe;

The only way I know how to do this is by using unmanaged code. The two functions you need to call are FindWindow and SetWindowPos which are found in user32.

Here is some code to do it.
Import the two dll's [DllImport("user32.dll",EntryPoint="FindWindow",CharSet=CharSet.Unicode)]
static extern IntPtr MyFindWindow(string _WindowClassName, string _WindowName);

[DllImport ("user32.dll",EntryPoint="SetWindowPos",CharSet=CharSet.Unicode)]
static extern bool MySetWindowPos (IntPtr hWnd, Int32 hWndInsertAfter,
Int32 X, Int32 Y, Int32 cx, Int32 cy, uint uFlags);

Define some variables
private IntPtr hTaskWindow; // Handle to task window
private const uint TOGGLE_HIDEWINDOW = 0x80;
private const uint TOGGLE_UNHIDEWINDOW = 0x40;

You can place this in form load event or somewhere appropriate. It is the handle to the task bar
hTaskWindow = MyFindWindow("Shell_traywnd", "");

Now when you want to hide the task bar execute this statement
MySetWindowPos(hTaskWindow, 0, 0, 0, 0, 0, TOGGLE_HIDEWINDOW);

Or when you want to un-hide the task bar execute this statement
MySetWindowPos(hTaskWindow, 0, 0, 0, 0, 0, TOGGLE_UNHIDEWINDOW);

That's it.

I hope that is was of some help. Smile | :)

-Fernando Soto

GeneralSending info to another frame Pin
brian5528-Apr-05 15:44
brian5528-Apr-05 15:44 
GeneralRe: Sending info to another frame Pin
MoustafaS28-Apr-05 17:25
MoustafaS28-Apr-05 17:25 
GeneralPop-Up & AxBrowser Pin
Sergio Luix28-Apr-05 14:09
Sergio Luix28-Apr-05 14:09 
GeneralRe: Pop-Up & AxBrowser Pin
leppie28-Apr-05 19:12
leppie28-Apr-05 19:12 
GeneralRe: Pop-Up & AxBrowser Pin
Sergio Luix28-Apr-05 19:15
Sergio Luix28-Apr-05 19:15 
GeneralRe: Pop-Up & AxBrowser Pin
leppie28-Apr-05 19:25
leppie28-Apr-05 19:25 
GeneralRe: Pop-Up & AxBrowser Pin
Moon Boy28-Apr-05 19:31
Moon Boy28-Apr-05 19:31 
GeneralRe: Pop-Up & AxBrowser Pin
Moon Boy28-Apr-05 19:46
Moon Boy28-Apr-05 19:46 
GeneralGeneral object destruction question: Pin
tantiboh28-Apr-05 13:32
tantiboh28-Apr-05 13:32 
GeneralRe: General object destruction question: Pin
Marc Clifton28-Apr-05 15:38
mvaMarc Clifton28-Apr-05 15:38 
QuestionGetting a timer's remaining time? Pin
tantiboh28-Apr-05 12:38
tantiboh28-Apr-05 12:38 
AnswerRe: Getting a timer's remaining time? Pin
Marc Clifton28-Apr-05 15:51
mvaMarc Clifton28-Apr-05 15:51 
GeneralCreating object instances by their name Pin
Anonymous28-Apr-05 12:08
Anonymous28-Apr-05 12:08 
GeneralRe: Creating object instances by their name Pin
Andy Brummer28-Apr-05 12:29
sitebuilderAndy Brummer28-Apr-05 12:29 
QuestionHow do you program with the GAC? Pin
kmaclean28-Apr-05 11:55
kmaclean28-Apr-05 11:55 
AnswerRe: How do you program with the GAC? Pin
Marc Clifton28-Apr-05 16:00
mvaMarc Clifton28-Apr-05 16:00 
GeneralRe: How do you program with the GAC? Pin
kmaclean29-Apr-05 3:19
kmaclean29-Apr-05 3:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.