Announcement

Collapse
No announcement yet.

Icon in task bar

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

  • Icon in task bar

    Hi, all --
    I didn't investigate this question, but may be somebody already did ...
    Top-level window has no WS_SYSMENU.
    Is it possible to "full" Window to have an icon in task bar and how ?

    PS. It's not a problem for me - I can prevent undesired results in HITTEST.
    But interesting ...

    ------------------
    E-MAIL: [email protected]

    [This message has been edited by Semen Matusovski (edited October 14, 2000).]

  • #2
    Do you mean a maximized window?
    Yes! I th ink anything is possible in the taskbar, I have most of the code....
    Unless I'm missing something...? (Full as in alt-ENter to a dos box for example?)


    Scott

    ------------------
    Scott
    mailto:[email protected]tngb[email protected]</A>
    Scott Turchin
    MCSE, MCP+I
    http://www.tngbbs.com
    ----------------------
    True Karate-do is this: that in daily life, one's mind and body be trained and developed in a spirit of humility; and that in critical times, one be devoted utterly to the cause of justice. -Gichin Funakoshi

    Comment


    • #3
      Hi Semen,
      I'm not sure what the system menu has to do with it, but would this
      work for you? :
      Code:
      #Compile Exe "D:\Icon.EXE"
      #Dim All
      #Register None
      #Include "Win32API.INC"
      Global  nid           As NOTIFYICONDATA
      Function WinMain(ByVal hCurInstance  As Long, _
                       ByVal hPrevInstance As Long, _
                       lpszCmdLine         As Asciiz Ptr, _
                       ByVal nCmdShow      As Long) Export As Long
      'Grab the PBDLL Icon and just use the Desktop's handle:
        nid.cbSize = SizeOf(nid)
      'nid.hwnd would be the handle to your dialog. I just snatched
      'the desktop so I didn't have to create a dialog for this ex.
        nid.hwnd = (GetDesktopWindow)
        nid.uId = 0
        nid.uFlags = %NIF_ICON Or %NIF_TIP' Or %NIF_MESSAGE
        nid.hIcon = ExtractIcon(hCurInstance, "PBEDIT.EXE", 0&)
        nid.szTip = "This Is The PBDLL Icon" & Chr$(0)
      'Insert The Icon Into The Tray:
        Shell_NotifyIcon %NIM_ADD, nid
        MsgBox "Click After Checking Tray"
      'Remove The Icon From The Tray:
        Shell_NotifyICon %NIM_DELETE, nid
      End Function

      ------------------
      [email protected]

      Comment


      • #4
        Wyman --
        Thanks, but I'm about Task Bar, not Tray.
        If window has WS_SYSMENU style, Windows shows in task bar (in buttons) icon and caption name.
        Problem is that without WS_SYSMENU style it shows caption only (not nice).

        Use Dialog New in following form
        Dialog New 0, "Test", , , 150, 20 To hDlg
        and look to taskbar.


        ------------------
        E-MAIL: [email protected]

        Comment


        • #5
          Semen,

          I have not looked into how to get the modeless window to get activated
          on startup.

          Example:
          Code:
          #COMPILE EXE
          #INCLUDE "WIN32API.INC"
           
          GLOBAL ghDlg AS LONG
          GLOBAL ghDlg2 AS LONG
          
          '---
          CALLBACK FUNCTION cancelButton()
             DIALOG END ghDlg
          END FUNCTION
          
          '---
          CALLBACK FUNCTION DlgCallBack2()
          Local rc as RECT
             SELECT CASE CBMSG
               CASE %WM_INITDIALOG
                    Call GetWindowRect(ghDlg2,rc)
                    x&=rc.nLeft
                    y&=rc.nTop
                    Call MoveWindow(ghDlg,x&,y&,0,0,1)         
               CASE %WM_MOVE
                    Call GetWindowRect(ghDlg2,rc)
                    x&=rc.nLeft
                    y&=rc.nTop
                    Call MoveWindow(ghDlg,x&,y&,0,0,1)
               CASE %WM_CLOSE
                    DIALOG END ghDlg
               CASE %WM_DESTROY
               END SELECT
          END FUNCTION
                    
          '---
          CALLBACK FUNCTION DlgCallBack()
          LOCAL hDlg2 AS LONG
             SELECT CASE CBMSG
               CASE %WM_INITDIALOG
                    DIALOG NEW ghDlg,"Title: ",,,300,200,%WS_CAPTION OR %WS_POPUP OR %DS_CENTER, TO hDlg2
                    ghDlg2 = hDlg2
                    CONTROL ADD BUTTON, hDlg2, %IDCANCEL, "E&xit", 140, 130, 40, 14   CALL cancelButton
                    DIALOG SHOW MODELESS hDlg2 CALL DlgCallBack2
                    
               CASE %WM_DESTROY
               END SELECT
          END FUNCTION
          
          '---
          FUNCTION PBMAIN
             'draw this some place off the screen
             DIALOG NEW 0,"Title:",0,0,0,0,%WS_SYSMENU, TO hDlg&
             ghdlg=hDlg&
             DIALOG SHOW MODAL hDlg& CALL DlgCallBack
          END FUNCTION
          Regards, Jules

          [This message has been edited by Jules Marchildon (edited October 16, 2000).]
          Best regards
          Jules
          www.rpmarchildon.com

          Comment

          Working...
          X