Handle of titlebarbuttons

Windows specific forum
User avatar
Hroudtwolf
Addict
Addict
Posts: 803
Joined: Sat Feb 12, 2005 3:35 am
Location: Germany(Hessen)
Contact:

Handle of titlebarbuttons

Post by Hroudtwolf »

Hello,


Who knows, how to get the handles of the buttons in the titlebar of a Windows-Window?
Sparkie
PureBatMan Forever
PureBatMan Forever
Posts: 2307
Joined: Tue Feb 10, 2004 3:07 am
Location: Ohio, USA

Post 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.
What goes around comes around.

PB 5.21 LTS (x86) - Windows 8.1
User avatar
Hroudtwolf
Addict
Addict
Posts: 803
Joined: Sat Feb 12, 2005 3:35 am
Location: Germany(Hessen)
Contact:

Post by Hroudtwolf »

Sorry, but I've no idea , what you want to say me.
Can you explain that more exactly? :?
Sparkie
PureBatMan Forever
PureBatMan Forever
Posts: 2307
Joined: Tue Feb 10, 2004 3:07 am
Location: Ohio, USA

Post by Sparkie »

Are you trying to get the handle to these buttons :?: Image
What goes around comes around.

PB 5.21 LTS (x86) - Windows 8.1
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post 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.
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
Sparkie
PureBatMan Forever
PureBatMan Forever
Posts: 2307
Joined: Tue Feb 10, 2004 3:07 am
Location: Ohio, USA

Post 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 ;)
What goes around comes around.

PB 5.21 LTS (x86) - Windows 8.1
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post 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
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post 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. :)
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
Sparkie
PureBatMan Forever
PureBatMan Forever
Posts: 2307
Joined: Tue Feb 10, 2004 3:07 am
Location: Ohio, USA

Post by Sparkie »

@Hroudtwolf - The first link posted by PB ^up there^ is what I was tring to say in my first post. Thanks PB :)
What goes around comes around.

PB 5.21 LTS (x86) - Windows 8.1
Henrik
Enthusiast
Enthusiast
Posts: 404
Joined: Sat Apr 26, 2003 5:08 pm
Location: Denmark

Post 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
User avatar
Hroudtwolf
Addict
Addict
Posts: 803
Joined: Sat Feb 12, 2005 3:35 am
Location: Germany(Hessen)
Contact:

Post 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 Image 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.
Henrik
Enthusiast
Enthusiast
Posts: 404
Joined: Sat Apr 26, 2003 5:08 pm
Location: Denmark

Post 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..
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post 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.
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
Post Reply