BBC BASIC for Windows
« WM_CONTEXTMENU oddity »

Welcome Guest. Please Login or Register.
Apr 5th, 2018, 11:20pm



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

If you require a dump of the post on your message board, please come to the support board and request it.


Thank you Conforums members.

BBC BASIC for Windows Resources
Online BBC BASIC for Windows documentation
BBC BASIC for Windows Beginners' Tutorial
BBC BASIC Home Page
BBC BASIC on Rosetta Code
BBC BASIC discussion group
BBC BASIC for Windows Programmers' Reference

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: WM_CONTEXTMENU oddity  (Read 794 times)
rtr
Guest
xx WM_CONTEXTMENU oddity
« Thread started on: Mar 18th, 2014, 4:23pm »

Can I ask those of you who have written 'compliant' GUI applications to check what happens if the keyboard shortcut for the context menu (either Shift+F10 or the Menu key - usually to the right of the space bar) is pressed?

What I'm finding here is that under Windows 2000/XP/7 it works as expected and the WM_CONTEXTMENU message is generated (resulting in a popup menu, usually) but under Windows 8.1 the message is not generated!

I don't know if this is a Windows version thing or something specific to my PC, but I've put a workaround on the Wiki in case anybody else is similarly affected:

http://bb4w.wikispaces.com/Right-click+Context+Menu

Richard.
User IP Logged

DDRM
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 321
xx Re: WM_CONTEXTMENU oddity
« Reply #1 on: Mar 19th, 2014, 10:13am »

Hi Richard,

I don't have any such programs, but I wrote this to test:

Code:
      *SYS1
      ON SYS PROCdoSys(@wparam%,@lparam%,@msg%):RETURN

      REPEAT
        WAIT 1
      UNTIL FALSE
      END
      :
      DEFPROCdoSys(w%,l%,m%)
      PRINT w%,l% AND &FFFF,l% >>>16,m%
      ENDPROC
 

and it seems to do the right thing (reports a message of 123 for right-mouse clicks and menu button presses, with coordinates in lparam for mouse clicks and -1 for menu button), in both Windows 7 (64 bit) on my desktop and Windows 8 (not 8.1) on my laptop. The laptop is touchscreen, and touch-and-hold also reports like a mouse right-click.

Hope that's helpful.

D
User IP Logged

rtr
Guest
xx Re: WM_CONTEXTMENU oddity
« Reply #2 on: Mar 19th, 2014, 1:00pm »

on Mar 19th, 2014, 10:13am, DDRM wrote:
it seems to do the right thing (reports a message of 123 for right-mouse clicks and menu button presses

What about Shift+F10? With your code I'm finding that, on my Windows 8.1 machine, the menu key does generate the expected message, but Shift+F10 doesn't! But now (after a reboot) my original program - which previously failed to respond to either Shift+F10 or the menu key, now responds to both!

So basically it's behaving inconsistently. I wonder if there's some 'race hazard' somewhere, but I don't really understand it at all. sad

Richard.
User IP Logged

DDRM
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 321
xx Re: WM_CONTEXTMENU oddity
« Reply #3 on: Mar 19th, 2014, 3:41pm »

SHift-F10 does nothing on either machine - I tried it, and wondered whether the keyboard EITHER has the menu button OR uses shift-F10 as an equivalent, but it sounds like it isn't as simple as that!

Trying it in my PDF viewer (since it is open...), I see that it DOES respond to both the menu key and shift-F10, in the same way (puts the context menu in the top-left of the window), and to a right-click with a context menu at the site of the mouse. That's on the desktop in Win7. On the laptop, it's a horrible full-screen, windows8-ey version which does weird things, but the same for all 3 (bars appear at the top and bottom).

Word is similar (menu key and shift-F10 pop up the menu at the cursor), but right-click gives TWO pop-up menus!

Best wishes,

D
User IP Logged

rtr
Guest
xx Re: WM_CONTEXTMENU oddity
« Reply #4 on: Mar 19th, 2014, 6:58pm »

on Mar 19th, 2014, 3:41pm, DDRM wrote:
SHift-F10 does nothing on either machine

That aspect of the mystery is solved - you won't see the message originating from Shift+F10 if the only window is the 'mainwin' (@hwnd%), which it is in your little test program. The reason I do see it in my application is that there's a child window (an edit control) which is evidently responding to Shift+F10 and sending the WM_CONTEXTMENU message to its parent window.

Richard.
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls