Page 1 of 1
					
				Handle of titlebarbuttons
				Posted: Mon Apr 04, 2005 1:44 pm
				by Hroudtwolf
				Hello,
Who knows, how to get the handles of the buttons in the titlebar of a Windows-Window?
			 
			
					
				
				Posted: Mon Apr 04, 2005 7:45 pm
				by Sparkie
				Are you talking about the minimize, maximize, and close buttons? If so, I don't think you can gain access to them other than through SysMenu functions.
			 
			
					
				
				Posted: Mon Apr 04, 2005 10:51 pm
				by Hroudtwolf
				Sorry, but I've no idea , what you want to say me.
Can you explain that more exactly?   

 
			 
			
					
				
				Posted: Mon Apr 04, 2005 11:28 pm
				by Sparkie
				Are you trying to get the handle to these buttons 
 
 
			 
			
					
				
				Posted: Mon Apr 04, 2005 11:32 pm
				by PB
				@Sparkie: Judging by Hroudtwolf's other post, he wants min/max buttons
on a ToolWindow, which simply can't be done.  So I'm guessing he wants
to add simulated buttons or something to the ToolWindow...?  There are
posts here that demonstrate how to put a "pushpin" etc on a window,
so Hroudtwolf will have to do a search for it and see if it works.
			 
			
					
				
				Posted: Mon Apr 04, 2005 11:37 pm
				by Sparkie
				Thanks PB 
ToolWindow with min/max buttons can be done, but you have to draw them yourself. Probably more trouble than it's worth 

 
			 
			
					
				
				Posted: Mon Apr 04, 2005 11:37 pm
				by PB
				@Hroudtwolf: Does the link below help you get started?  It shows how to
get the handle to the "X" (close) button on a normal window (it may also
work on a ToolWindow, but I haven't tried it):
viewtopic.php?t=3712
See also:
viewtopic.php?t=9687 
			 
			
					
				
				Posted: Mon Apr 04, 2005 11:38 pm
				by PB
				> ToolWindow with min/max buttons can be done, but you have to draw them yourself
That's what I meant... they're not natively done like on a normal window.  

 
			 
			
					
				
				Posted: Mon Apr 04, 2005 11:42 pm
				by Sparkie
				@Hroudtwolf - The first link posted by PB ^up there^ is what I was tring to say in my first post. Thanks PB 

 
			 
			
					
				
				Posted: Tue Apr 05, 2005 12:51 am
				by Henrik
				I really don't know if i understand the subject
But i did something like this on skindwind.app
I used the Webdings or the Marlett Font -"dont' recall"- , for min,max and close
This was on win98, i have no idear what it looks like on XP
and it might look diff. depending on if the user uses big or small fonttypes (96 dpi or " 128 I tinhk dpi") 
Code: Select all
 
;
Global FontID1
;FontID1 = LoadFont(1, "Webdings", 10)
FontID1 = LoadFont(1, "Marlett", 10)
 
 If OpenWindow(0, 0, 0, 160, 160, #PB_Window_SystemMenu |#PB_Window_ScreenCentered, "Tool-Bar")
    TBH=CreateToolBar(0, WindowID())
      ToolBarStandardButton(0, #PB_ToolBarIcon_New)
      ToolBarStandardButton(1, #PB_ToolBarIcon_Open)
      ToolBarStandardButton(2, #PB_ToolBarIcon_Save)
      
    If CreateGadgetList(TBH)
      ButtonGadget(0, 70, 3, 16, 16, "0")
      SetGadgetFont(0, FontID1)
      ButtonGadget(1, 85, 3, 16, 16, "1")
      SetGadgetFont(1, FontID1)
      ButtonGadget(2, 100, 3, 16, 16, "2")
      SetGadgetFont(2, FontID1)
      ButtonGadget(3, 115, 3, 16, 16, "r")
      SetGadgetFont(3, FontID1)
 
    EndIf
    Repeat
      EventID = WaitWindowEvent()
      
    Until EventID = #PB_Event_CloseWindow 
  EndIf
 
**Edit** ohe btw you have to use the api for min, max and close of course..
Henrik
 
			 
			
					
				
				Posted: Tue Apr 05, 2005 12:59 am
				by Hroudtwolf
				At first thanks at all.
But this isn't my problem. It is however my guilt.
I explain my problem once again more exactly.  
I want to get the handles of the systembuttons of a window 

 to position this button on an other place in my window.
I want to do this by using "SetParent (Button.l,hwnd.l)". 
With comboboxes, that functions also.
 
			 
			
					
				
				Posted: Tue Apr 05, 2005 1:19 am
				by Henrik
				But it's not a "Normal" Class Button, i dont think you can get the handle for this.
But i don't know enough about this really so i back off..
Henrik..
			 
			
					
				
				Posted: Tue Apr 05, 2005 1:52 am
				by PB
				@Hroudtwolf: I really don't think you can do it.  Even the tip that disables
the X button is just disabling a menu item (which the "button" actually is).
Look at the other link that I have above which shows how to put a pushpin
on the titlebar -- it should teach you how to add other buttons to it.