Announcement

Collapse
No announcement yet.

Graphic Inkey$ or WaitKey$

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

  • Graphic Inkey$ or WaitKey$

    I have to manually close this Graphic Window (Red X, Alt Tab) and then End it in Task Mgr as well. It never gets to the Msgbox.

    '
    Code:
    'PBWIN 9.00 - WinApi 05/2008 - XP Pro SP3
    #Compile Exe                                
    #Dim All 
    #Include "WIN32API.INC"
    #Include "COMDLG32.INC"
    %Id_Dial_Graphic = 1000
    Function PBMain             
      ErrClear
        Local hwin As Dword, s$
        Graphic Window "Testing", 100, 200, 200, 100 To hWin
        Graphic Attach hWin, %Id_Dial_Graphic
    g1:
        Graphic inkey$ To s$
        If Len(s$) = 0 Then GoTo g1 'no key pressed
        Graphic Window End
      
       ? "Wait key works" 'Never gets here
    End Function 'Applikation beenden
    '
    It's a pretty day. I hope you enjoy it.

    Gösta

    JWAM: (Quit Smoking): http://www.SwedesDock.com/smoking
    LDN - A Miracle Drug: http://www.SwedesDock.com/LDN/

  • #2
    Use

    Code:
    Graphic Attach hWin, 0
    The Help file can be confusing on what goes in the second position.

    Also, see a post I made "DDT vs Graphic Window". Your problem came up in that post.
    Last edited by Gary Beene; 21 Jan 2009, 12:19 AM.

    Comment


    • #3
      Like Gary said but also..
      To handle the Graphic Window being closed 'manually'..
      Code:
          [COLOR=gray]Graphic inkey$ To s$[/COLOR]
          If IsFalse IsWin(hWin) Then Exit Function   ' exit loop if window closed
          ...
      Rgds, Dave

      Comment


      • #4
        Originally posted by Gary Beene View Post
        Use

        Code:
        Graphic Attach hWin, 0
        Thanks Gary. That did the trick. Just what I was looking for.

        I see now that for it to work the way I had it (Attaching to a specific ID) I would have to trap it in a Callback.
        It's a pretty day. I hope you enjoy it.

        Gösta

        JWAM: (Quit Smoking): http://www.SwedesDock.com/smoking
        LDN - A Miracle Drug: http://www.SwedesDock.com/LDN/

        Comment

        Working...
        X
        😀
        🥰
        🤢
        😎
        😡
        👍
        👎