ToolbarWindow32 open trayed window

Windows specific forum
ehowington
Enthusiast
Enthusiast
Posts: 117
Joined: Sat Sep 12, 2009 3:06 pm

ToolbarWindow32 open trayed window

Post by ehowington »

How would you go about opening a certain trayed application?
rsts
Addict
Addict
Posts: 2736
Joined: Wed Aug 24, 2005 8:39 am
Location: Southwest OH - USA

Re: ToolbarWindow32 open trayed window

Post by rsts »

So it's running but has an icon in the tray area?

Like open with a rightclick menu or via clicking on the icon or via a hotkey or when another instance is attempted to open or ???
ehowington
Enthusiast
Enthusiast
Posts: 117
Joined: Sat Sep 12, 2009 3:06 pm

Re: ToolbarWindow32 open trayed window

Post by ehowington »

like to open via command of the control for ToolbarWindow32 first by locating the text of the command then sending the command to show that window.
RASHAD
PureBasic Expert
PureBasic Expert
Posts: 4997
Joined: Sun Apr 12, 2009 6:27 am

Re: ToolbarWindow32 open trayed window

Post by RASHAD »

Code: Select all

If OpenWindow(0, 100, 200, 195, 260, "ToolBar example", #PB_Window_SystemMenu | #PB_Window_SizeGadget)

  If CreateToolBar(0, WindowID(0))
    ToolBarStandardButton(0, #PB_ToolBarIcon_New)
    ToolBarStandardButton(1, #PB_ToolBarIcon_Open)
    ToolBarStandardButton(2, #PB_ToolBarIcon_Save)
    
    ToolBarSeparator()

    ToolBarStandardButton(3, #PB_ToolBarIcon_Print)
    ToolBarToolTip(0, 3, "Print")
    
    ToolBarStandardButton(4, #PB_ToolBarIcon_Find)
    ToolBarToolTip(0, 4, "Find a document")
    
    ToolBarSeparator()
    
  EndIf


  If CreateMenu(0, WindowID(0))
    MenuTitle("Project")
      MenuItem(0, "New")
      MenuItem(1, "Open")
      MenuItem(2, "Save")
  EndIf
  

  DisableToolBarButton(0, 2, 1) 

  ButtonGadget(1,10,200,60,24,"TEST")
  
  GetWindowRect_(WindowID(0),w.RECT)  
  Repeat
    Event = WaitWindowEvent()

    Select Event
    
      Case #PB_Event_Menu
         Select EventMenu()
            Case 0
            
            Case 1
                Pattern$ = "Text (*.txt)|*.txt;*.bat|PureBasic (*.pb)|*.pb|All files (*.*)|*.*"
                Pattern = 0 
                File$ = OpenFileRequester("Please choose file to load", StandardFile$, Pattern$, Pattern)
            
            Case 2
            
         EndSelect

      
      Case #PB_Event_CloseWindow 
        Quit = 1
        
      Case #PB_Event_Gadget
          Select EventGadget()
           Case 1
              SendMessage_(ToolBarID(0), #TB_GETRECT , 1, r.RECT)               ;Hit Button Index 1
              SetCursorPos_((w\left + r\left + 15),(w\top + r\top+60))
              mouse_event_(#MOUSEEVENTF_LEFTDOWN,0,0,0,0)
              mouse_event_(#MOUSEEVENTF_LEFTUP,0,0,0,0)
                       
          EndSelect
        
        
        
    EndSelect

  Until Quit = 1
  
EndIf

End
Egypt my love
ehowington
Enthusiast
Enthusiast
Posts: 117
Joined: Sat Sep 12, 2009 3:06 pm

Re: ToolbarWindow32 open trayed window

Post by ehowington »

keep in mind this application im wanting to open is not written by me or in purbasic im using autoit etc
Post Reply