Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. AppBar focus issue [modified]

AppBar focus issue [modified]

Scheduled Pinned Locked Moved C#
helpcsharpphpcomlinux
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    itcm
    wrote on last edited by
    #1

    I have created an AppBar. The AppBar always stays on top, when it loses focus, then to get back to the AppBar requires two clicks instead of one. I believe the first click activates the form and then with second click I receive the mouse click events (as expected). Can you give any ideas, what can be wrong here? My problem is similar to this one Appbar and focus issues[^]. Unfortunately the OP in that link hasn't posted his solution :(. I created the AppBar following this article from CodeProject C# does Shell, Part 3[^] I looked into it with Spy++ but don't have any idea why this is happening. Here is the Spy++ log which I obtained testing out this scenario (first click doesn't works, second does).

    <00001> 00090CFE S WM_PARENTNOTIFY fwEvent:WM_LBUTTONDOWN xPos:25 yPos:17
    <00002> 00090CFE R WM_PARENTNOTIFY
    <00003> 00090CFE S WM_WINDOWPOSCHANGING lpwp:0418EAE4
    <00004> 00090CFE R WM_WINDOWPOSCHANGING
    <00005> 00090CFE S WM_ACTIVATEAPP fActive:True dwThreadID:00000000
    <00006> 00090CFE R WM_ACTIVATEAPP
    <00007> 00090CFE S WM_NCACTIVATE fActive:True
    <00008> 00090CFE R WM_NCACTIVATE
    <00009> 00090CFE S WM_ACTIVATE fActive:WA_CLICKACTIVE fMinimized:False hwndPrevious:(null)
    <00010> 00090CFE S WM_IME_SETCONTEXT fSet:1 iShow:C000000F
    <00011> 00090CFE S WM_IME_NOTIFY dwCommand:IMN_OPENSTATUSWINDOW dwCommand:00000002 dwData:00000000
    <00012> 00090CFE R WM_IME_NOTIFY
    <00013> 00090CFE R WM_IME_SETCONTEXT
    <00014> 00090CFE S WM_SETFOCUS hwndLoseFocus:(null)
    <00015> 00090CFE R WM_SETFOCUS
    <00016> 00090CFE R WM_ACTIVATE

    Now happens the second click (which works)
    <00017> 00090CFE S WM_PARENTNOTIFY fwEvent:WM_LBUTTONDOWN xPos:25 yPos:17
    <00018> 00090CFE R WM_PARENTNOTIFY
    <00019> 00090CFE S WM_WINDOWPOSCHANGING lpwp:0418E40C
    <00020> 00090CFE R WM_WINDOWPOSCHANGING

    Looking at the Spy++ logs, I believe the problem is with activation, I think that it only receives WM_LBUTTONDOWN event if the window is activated. But how come other windows aren't activated but they still work with one click (i.e. I don't have to click it first). **EDIT:**I think the problem

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups