Announcement

Collapse
No announcement yet.

Hide the Graphic Window's taskbar button?

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

  • Hide the Graphic Window's taskbar button?

    Hi Everyone,

    Is there a way to not at all show the Graphic Window's taskbar button? What I did is that I've changed the parent window (Desktop) to a hidden window right after creating the Graphic Window.

    Code:
        ' hDlg - Handle of a hidden DialogBox
        GRAPHIC WINDOW "", 0, 0, 500, 500 TO gWdw
        SetParent gWdw, hDlg
    Problem is that, the button is still flashing in the taskbar right after creating the graphic window and then only gets hidden after changing the parent window.
    Last edited by Gary Domantay; 11 Mar 2009, 11:56 PM.

  • #2
    Perhaps you could locate it off screen and relocate it when it's required?
    If you showed more code, preferably compilable, other ideas might come to mind.
    Rod
    I want not 'not', not Knot, not Knott, not Nott, not knot, not naught, not nought, but aught.

    Comment


    • #3
      Kind of surprising there is no "style" option for the GRAPHIC WINDOW statement. Sounds like a New Feature Suggestion waiting to be submitted.

      Of course, with PB WIN you could use CONTROL ADD GRAPHIC as a control on a DIALOG NEW, and control the styles of both the underlying dialog and the graphic control itself.

      As far as the taskbar thing, you can hide that by using style WS_EX_TOOLWINDOW for the underlying DIALOG, but that also results in a smaller caption which may not be desireable. (CONTROL ADD GRAPHIC creates a child window; child windows do not show on the taskbar).
      Michael Mattias
      Tal Systems (retired)
      Port Washington WI USA
      [email protected]
      http://www.talsystems.com

      Comment


      • #4
        Thanks Guys.

        Below is a compilable source code. Wanted to popup the graphic window without flashing the graphic window's taskbar button.

        Code:
        #COMPILE EXE
        #DIM ALL
        
        #INCLUDE "WIN32API.INC"
        
        CALLBACK FUNCTION DialogCallback
        
        STATIC gWdw AS LONG
        
        SELECT CASE CB.MSG
        CASE %WM_COMMAND
            SELECT CASE CB.CTL
            CASE 100
                IF CB.CTLMSG=%BN_CLICKED THEN
                    ' Want to display the graphic window without showing the graphic window's taskbar button
                    GRAPHIC WINDOW "", 110, 110, 100, 70 TO gWdw
                END IF
            CASE %IDCANCEL
                IF CB.CTLMSG=%BN_CLICKED THEN
                    IF gWdw THEN
                        GRAPHIC ATTACH gWdw, 0
                        GRAPHIC WINDOW END
                    END IF
        
                    DIALOG END CB.HNDL
                END IF
            END SELECT
        END SELECT
        END FUNCTION
        
        FUNCTION PBMAIN () AS LONG
            LOCAL hDlg AS LONG
        
            DIALOG NEW 0, "TEST", 10, 10, 100, 70 TO hDlg
        
            CONTROL ADD BUTTON, hDlg, 100, "Graphic Window", 10, 10, 80, 20
            CONTROL ADD BUTTON, hDlg, %IDCANCEL, "Close", 10, 40, 80, 20
        
            DIALOG SHOW MODAL hDlg CALL DialogCallback
        
        END FUNCTION
        Last edited by Gary Domantay; 16 Mar 2009, 06:19 AM.

        Comment


        • #5
          ' Want to display the graphic window without showing the graphic window's taskbar button
          Code:
                       GRAPHIC WINDOW "", 110, 110, 100, 70 TO gWdw
          ==>
          Code:
          REM            GRAPHIC WINDOW "", 110, 110, 100, 70 TO gWdw
                           CONTROL ADD GRAPHIC  CBHNDL, .......
          Same drawing commands are used.
          Michael Mattias
          Tal Systems (retired)
          Port Washington WI USA
          [email protected]
          http://www.talsystems.com

          Comment


          • #6
            There's obviously some more work to do here...the GRAPHIC control is not going to fit within the boundaries of the owning dialog, so at the point you are at you will have to expand the size of the dialog to accommodate it.

            Or, you can (as suggested above), use a second dialog whose owner (parent) is the current dialog... that second dialog has but one control on it, the GRAPHIC control.

            The point being, if you want no taskbar entry, the GRAPHIC WINDOW is not the right tool for the job.
            Michael Mattias
            Tal Systems (retired)
            Port Washington WI USA
            [email protected]
            http://www.talsystems.com

            Comment


            • #7
              This code might be worth testing..
              Code:
              #Dim All
              #Include "WIN32API.INC"
              Global hHook???
              Function HookGFXWindow(ByVal lMsg As Dword, ByVal wParam As Dword, ByVal lParam As Long) As Long
               
                If lMsg = %HCBT_CREATEWND Then      ' wParam has handle of Window about to be created
                  UnhookWindowsHookEx hHook
                  SetWindowLong wParam, %GWL_EXSTYLE, (GetWindowLong (wParam, %GWL_EXSTYLE) Or %WS_EX_TOOLWINDOW)
                End If
               
               Function = 0
              End Function
              '------------------/HookGFXWindow
               
              Function PBMain()
               Dim gWdw???
               
                hHook = SetWindowsHookEx(%WH_CBT, CodePtr(HookGFXWindow), GetModuleHandle(""), 0)
                Graphic Window "", 0, 0, 500, 500 To gWdw
                Sleep 2000
                MsgBox "done"
               
              End Function
              '------------------/PBMain
              Rgds, Dave

              Comment


              • #8
                Wow Dave! Nice workaround to set the graphic window's style before it gets created.

                Thanks Michael, gone for Dave's code as i'm just so lazy enough to change my codes. I use the graphic window for my drop down menu.

                Cheers

                Gary

                Comment

                Working...
                X