Gui Caption in Windows 7

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
ShubhamM
Posts: 38
Joined: 08 Nov 2017, 21:38

Gui Caption in Windows 7

Post by ShubhamM » 23 Nov 2017, 15:09

Hello,

I have the following code but I'm trying to re-add a Windows 7/8/10 caption into the program but it keeps giving me a Windows XP caption bar and also distorts the GUI with a little white bar added to the top and the left:

Code: Select all

Gosub, Start

Return

Start:
	Total_Width := 660
	Gui, +LastFound
	Gui, Color, 000000
	Gui, Margin, 0, 0
	Gui, Font, s11 cFFFFFF, Arial
	Gui, Add, Progress, % "x-1 y-1 w" (Total_Width+2) " h51 BackgroundA00000 Disabled hwndHPROG"
	Gui, Add, Text, % "x0 y0 w" Total_Width " h50 BackgroundTrans Center 0x220 gGuiMove vCaption", TEST
	Gui, Add, Text, % "y+5 w" (Total_Width-5) "r1 +0x4000 gToggle_Caption vt_Caption", Toggle Caption
	Gui, Add, Text, % "x5 y+51 w" (Total_Width-5) "h5 vP"

	if(Bool_Show_Caption)
		Gui, +Caption
	if(!Bool_Show_Caption)
		Gui, -Caption
	
	GuiControlGet, P, Pos
	H := PY + PH
	WinSet, Region, 0-0 w%Total_Width% h%H% r6-6
	Gui, show, w%Total_Width% x%x_position% y%y_position%, TEST
	Gui, +AlwaysOnTop
return

Toggle_Caption:
	if(Bool_Show_Caption) {
		Bool_Show_Caption := 0
		Gui, Destroy
		GoSub, Start
		Return
	}
	if(!Bool_Show_Caption){
		Bool_Show_Caption := 1
		Gui, Destroy
		GoSub, Start
		Return
	}
Return

GuiMove:
   PostMessage, 0xA1, 2
return
Can you please advise how to get a Windows 7+ caption bar?

Alternatively, when I try to add close and minimize buttons at the top right, the initial "TEST" text covers the buttons, even after the buttons are placed after this add text line. Can someone advise how to layer buttons such that they are on top of the text?

Thanks!!

ShubhamM
Posts: 38
Joined: 08 Nov 2017, 21:38

Re: Gui Caption in Windows 7

Post by ShubhamM » 23 Nov 2017, 15:10

Sorry, I forgot to mention that the following is at the top of the above code:

global Bool_Show_Caption := 0

Post Reply

Return to “Ask for Help (v1)”