Results 1 to 9 of 9

Thread: Notify Icon

  1. #1

    Thread Starter
    Addicted Member Codehammer's Avatar
    Join Date
    Aug 2004
    Posts
    164

    Notify Icon

    Hi,

    The notify icon responds to a Mouse click event. Examples:

    MouseDown
    Mouseup
    Doubleclick
    Click

    If I Want it with a Key Combination, Like [shift] + Doubleclick, how do I do This?
    Curiosity SKILLED the cat
    Google Talk from your Mobile phone

    Chat from your mobile or get an emulator like J2ME Wireless Toolkit 2.2

  2. #2
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    Re: Notify Icon

    That would imply that you have a way to give the icon Focus. To my knowledge this is not possible with the standard NotifyIcon class. If something does not have focus then it will not respond to keyboard events (and this class doesn't have the normal keyboard event handlers anyway).

    You'd have to come up with a way of globally scanning the keyboard states in another process or by using a timer.

    In short, you can't. Unless you go out of your way to modify the NotifyIcon class.
    I don't live here any more.

  3. #3
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Notify Icon

    Couldnt you also use the RegisterHotkey API?
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  4. #4

    Thread Starter
    Addicted Member Codehammer's Avatar
    Join Date
    Aug 2004
    Posts
    164

    Re: Notify Icon

    Quote Originally Posted by wossname
    That would imply that you have a way to give the icon Focus. To my knowledge this is not possible with the standard NotifyIcon class. If something does not have focus then it will not respond to keyboard events (and this class doesn't have the normal keyboard event handlers anyway).

    You'd have to come up with a way of globally scanning the keyboard states in another process or by using a timer.

    In short, you can't. Unless you go out of your way to modify the NotifyIcon class.
    Not Focus, It would be a normal Notify Icon, Responds to Clciks, If one Clicks Once, then it checks if shift is also pressed, then Execute code, else end Sub.

    Something like that should be possible.
    Curiosity SKILLED the cat
    Google Talk from your Mobile phone

    Chat from your mobile or get an emulator like J2ME Wireless Toolkit 2.2

  5. #5
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Notify Icon

    I dont think so since in order to respond to those events, like wossname stated, the notify icon needs to have the focus.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  6. #6

    Thread Starter
    Addicted Member Codehammer's Avatar
    Join Date
    Aug 2004
    Posts
    164

    Re: Notify Icon

    What Was Your Eariler Option On Hotkeys?

    I'm Thinking Like This: Of A Notify Icon Is In The Taskbar, When You Click It, Then It Gets Focus. Thats How Come You Can Say Maxamize A Window Within That Sub For Example.

    So Can One In That Same Sub Do A Check To Check If The Shift Key Is Pressed To Then Make It Exec. Some Code. It Is In Focus Aint It?

    Sorry If I Asked So Many Time, I Still Think Its In Focus If It Goes Through A Sub.

    I Got This Idea From A Program Deepfreeze. It Needs A Double Click With The Shift Key Down To Activate The Program Again. That Or Pressing Shift+alt+ctrl, Then F7.
    Curiosity SKILLED the cat
    Google Talk from your Mobile phone

    Chat from your mobile or get an emulator like J2ME Wireless Toolkit 2.2

  7. #7
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    Re: Notify Icon

    On second thoughts you could always use GetKeyState() API function to find out if either of the shifts are held down. Use API-Guide to find out details of parameters and so on.
    I don't live here any more.

  8. #8

    Thread Starter
    Addicted Member Codehammer's Avatar
    Join Date
    Aug 2004
    Posts
    164

    Re: Notify Icon

    Use API-Guide ....

    Is this a Site or a Manual. What is API, Appplication Programming Instruction is my Guess.
    Curiosity SKILLED the cat
    Google Talk from your Mobile phone

    Chat from your mobile or get an emulator like J2ME Wireless Toolkit 2.2

  9. #9
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    Re: Notify Icon

    API-Guide is a freeware program. Google for "Download API guide".

    The Win32 API is a large number of subs and functions that let you control many different low-level system features, features not accessible though normal code.

    Its a large topic but its straightforward once you get the jist of it. API stand for Application Programming Interface.

    VBF has an API forum too, so you should post your API questions there
    I don't live here any more.

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