Announcement

Collapse
No announcement yet.

ALT+F Shortcut key not working :(

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • ALT+F Shortcut key not working :(

    Dear all,

    I'm missing something, I'm sure... Could someone please help...

    If I press Alt+F key nothing happens... and I don't know why is it not working?
    Code:
    #COMPILE EXE
    #DIM ALL
    
    %IDM_FILE_EXIT         = 1005
    
    FUNCTION AttachMenu(BYVAL hDlg AS DWORD) AS DWORD
     LOCAL hMenu   AS DWORD
     LOCAL hPopUp  AS DWORD
    
      MENU NEW BAR TO hMenu
    
      MENU NEW POPUP TO hPopUp
      MENU ADD POPUP, hMenu, "&File", hPopUp, %MF_ENABLED
        MENU ADD STRING, hPopUp, "E&xit", %IDM_FILE_EXIT, %MF_ENABLED
    
      MENU ATTACH hMenu, hDlg
      FUNCTION = hMenu
    END FUNCTION
    
    FUNCTION PBMAIN () AS LONG
     LOCAL hDlg AS DWORD
     LOCAL lRes AS LONG
    
      DIALOG NEW 0, "Test",,, 321, 179, _
                    %WS_CAPTION OR %WS_CLIPCHILDREN OR %WS_SYSMENU, 0 TO hDlg
    
      CALL AttachMenu(hDlg)
    
      DIALOG SHOW MODAL hDlg
    
    END FUNCTION
    Thanks
    Last edited by A du Toit; 16 Aug 2009, 09:10 AM.
    JADT

  • #2
    You'll need at least one control on your dialog to crank up keyboard processing.
    Try adding
    Code:
      Control Add Label, hDlg, 101, "&Need at least one control??", 10,10,150,15  'OR
     '  CONTROL ADD BUTTON, hDlg, %IDOK, "OK", 34, 32, 40, 14, %BS_DEFAULT
    Rgds, Dave

    Comment


    • #3
      Thanks Dave, it works! :happy:

      Definitely something I never encountered before...

      Kind regards
      JADT

      Comment

      Working...
      X