Results 1 to 4 of 4

Thread: How do I do these two things? keystroke watch

  1. #1

    Thread Starter
    Member
    Join Date
    Jan 2007
    Posts
    63

    Question How do I do these two things? keystroke watch

    Hail to all,

    Ok what I would like to do is create a program that runs in the task bar next to the time. What I want this to do is listen for the key stroke combo of CTRL-ALT-T no matter what program they are in. When they hit this key stroke I want the program to do is hide the task bar on the bottom of the screen. you know how you can change the hight to two rows one row and so on but you can also drag it down so it has no rows and can't see it. Then when they hit CTRL-ALT-T it will then display the task bar with what ever the hight wa set to. Just don't know what direction to go to do this.

    Thanks in advance for all your help.


    Mythos

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: How do I do these two things? keystroke watch

    To display your app in the "notification area", commonly (but incorrectly) called the "system tray", you simply add a NotifyIcon to your form. You can then set the Visible properties of the icon to True and the form to False.

    To catch that key stroke combination you'll need to use the RegisterHotKey API. If you search the forum you'll find examples. I believe that there's one in the VB.NET CodeBank forum too.

    When you say you want to hide the Task Bar, do you mean you want to auto-hide it, i.e. as if they right-clicked the Task Bar, selected Properties and then checked the "Auto-hide the taskbar" box? If so then I'm quite sure you will have to invoke the Windows API, but I couldn't say which function I'm afarid.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Member
    Join Date
    Jan 2007
    Posts
    63

    Re: How do I do these two things? keystroke watch

    Thanks I will look into what you have suggested.

    For the task bar. Say you unlock the taskbar and you know how you can drag the hight of it up another blocks width or three or four times it normal width but you can also drag it down to nothing. I am trying to set it's hight to nothing not auto hide it. The reason is I do not want it to pop up when the mouse is at the bottom of the screen.

    Thanks again for your help.


    Mythos

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: How do I do these two things? keystroke watch

    I'm guessing that you'd have to set a Registry entry to set the height of the TaskBar but I really couldn't say which. I'm also noy sure how you'd force it to refresh after setting it.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width