Announcement

Collapse
No announcement yet.

Hide the Graphic Window's taskbar button?

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

  • Gary Domantay
    replied
    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

    Leave a comment:


  • Dave Biggs
    replied
    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

    Leave a comment:


  • Michael Mattias
    replied
    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.

    Leave a comment:


  • Michael Mattias
    replied
    ' Want to display the graphic window without showing the graphic window's taskbar button
    Code:
                 GRAPHIC WINDOW "", 110, 110, 100, 70 TO gWdw
    ==>
    Code:
    [COLOR="Red"]REM [/COLOR]           GRAPHIC WINDOW "", 110, 110, 100, 70 TO gWdw
                    [COLOR="Red"] CONTROL ADD GRAPHIC  CBHNDL, .......[/COLOR]
    Same drawing commands are used.

    Leave a comment:


  • Gary Domantay
    replied
    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, 05:19 AM.

    Leave a comment:


  • Michael Mattias
    replied
    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).

    Leave a comment:


  • Rodney Hicks
    replied
    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.

    Leave a comment:


  • Gary Domantay
    started a topic Hide the Graphic Window's taskbar button?

    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, 10:56 PM.
Working...
X
😀
🥰
🤢
😎
😡
👍
👎