Does anyone know if there is a way of setting the window style that has just a close button and the question mark in the top right hand corner?
Im sure i saw it somewhere, but now I can't find it.
Window styles
Started by
Superfraggle
, Jun 12 2007 11:52 AM
7 replies to this topic
#1
-
Posted 12 June 2007 - 11:52 AM
Sorry, should have been more specific, I know the command. I just cannot find the actual style itself.
I must of read through the styles page five times now, and rendomly tried a few too.
As a secondary note, it's a gui window i'm creating so im not using winset
Just
Gui , +/- Style
Ok I found it its
WS_EX_CONTEXTHELP 0x00000400 Includes a question mark in the title bar of the window. Cannot be used with the WS_MAXIMIZEBOX or WS_MINIMIZEBOX
Got it working
#3
-
Posted 12 June 2007 - 01:07 PM
Ah, OK.
The best I could do is:
The best I could do is:
Gui -MaximizeBox -MinimizeBox Gui Add, Text, , Testing GUI Gui Add, Button, gGuiClose, Close Gui Show, w400 h300 Return GuiClose: GuiEscape: ExitAppIf you remove the SysMenu, you remove the Close button as well, I don't know if you can separate them. Windows with only the Close button are dialog boxes, AFAIK, they are different from AHK GUI windows.
#4
-
Posted 12 June 2007 - 01:29 PM
gui -MinimizeBox +E0x00000400
For future reference will create the required looking box.
<!-- m -->http://www.autohotke... ... 3&start=15<!-- m -->
This is docemented here with a working script to monitor the wm_help messages too.
I think it might be worth adding this style to the manual though.
#5
-
Posted 12 June 2007 - 01:45 PM
I missed your update, your main concern was with the Help button, not the sys menu...
Thanks for giving the solution, this sure can be useful.
Chris doesn't provide much advanced styles in the manual, but this one can be useful indeed.
It would be nice to provide a simple full working example of use of the style and the message, if possible.
Thanks for giving the solution, this sure can be useful.
Chris doesn't provide much advanced styles in the manual, but this one can be useful indeed.
It would be nice to provide a simple full working example of use of the style and the message, if possible.
#6
-
Posted 12 June 2007 - 01:57 PM
Thought I would post a working example. Not very elegant, but it paints the rough picture.
I know we can also use the other help of moving the mouse over the control, but sometimes you might want a small tooltip for that, and a more descriptive tooltip for doing it this way. Or you could link directly to your help file.
gui add,button,Hwndok,OK gui add,button,Hwndsad,Sad gui add,button,Hwndclose,Close gui -MinimizeBox +E0x00000400 Gui show, onmessage(0x0053, "displayhelp") %OK%_HELP:="Click this button if you are feeling ok today.`nDon't forget though, only click this button if you are" %SAD%_HELP:="Click this button if you are feeling sad.`nPerhaps you need cheering up.`n Perhaps you are just bored" %CLOSE%_HELP:="Click this button to close this tiny application" return buttonok: Msgbox OK return buttonsad: Msgbox Sad return buttonClose: Exitapp return RemoveToolTip: SetTimer, RemoveToolTip, Off ToolTip return displayhelp() { mousegetpos,,,,name,2 tooltip % %name%_HELP SetTimer, RemoveToolTip, 5000 }
I know we can also use the other help of moving the mouse over the control, but sometimes you might want a small tooltip for that, and a more descriptive tooltip for doing it this way. Or you could link directly to your help file.
#7
-
Posted 12 June 2007 - 02:41 PM
I saw this interesting topic, so I tried to implement it, following the classical way...
Gui -MaximizeBox -MinimizeBox +E0x00000400 Gui Add, Text, Hwndt1, Testing GUI Gui Add, Button, gGuiClose HWndb1, Close Gui Show, w400 h300 OnMessage(0x53, "WM_HELP") Return GuiClose: GuiEscape: ExitApp WM_HELP(_notUsed, _lphi, _msg, _hwndControl) { global iCtrlID := GetInteger(_lphi, 8) hItemHandle := GetInteger(_lphi, 12) dwContextId := GetInteger(_lphi, 16) x := GetInteger(_lphi, 20) y := GetInteger(_lphi, 24) ;~ MsgBox ID: %iCtrlID% h: %hItemHandle% Ctx: %dwContextId% (%x% %y%) If (hItemHandle = t1) ToolTip Plain old label Else If (hItemHandle = b1) ToolTip The Close button, to close the window! Else ToolTip Unknown element SetTimer GoOff, -1500 } GoOff: ToolTip Return GetInteger(_sourceAddr, _offset = 0, _size = 4, _bIsSigned = false) { local result Loop %_size% ; Build the integer by adding up its bytes. { result += *(_sourceAddr + _offset + A_Index-1) << 8*(A_Index-1) } If (!_bIsSigned OR _size > 4 OR result < 0x80000000) Return result ; Signed vs. unsigned doesn't matter in these cases. ; Otherwise, convert the value (now known to be 32-bit & negative) to its signed counterpart: return -(0xFFFFFFFF - result + 1) } /* typedef struct tagHELPINFO { UINT cbSize; 0 int iContextType; 4 int iCtrlId; 8 HANDLE hItemHandle; 12 DWORD dwContextId; 16 POINT MousePos; 20 & 24 } HELPINFO, *LPHELPINFO; */Our codes are close, you just used resources provided by AHK instead of parsing a binary structure...
#8
-
Posted 12 June 2007 - 03:24 PM
vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")