Here's a custom UI inspired by Microsoft Office 2016 that I made today... I appreciate any feedback
I modified the script so that it would not require the use of external images anymore:
Code: Select all
; Header =======================================================================
; Name .........: Microsoft Office 2016 Inspired UI
; Description ..: A custom UI design based on Microsoft Office 2016
; AHK Version ..: 1.1.23.01 (Unicode 32-bit) - January 24, 2016
; OS Version ...: Windows 2000+
; Language .....: English (en-US)
; Author .......: (TheDewd) Weston Campbell <westoncampbell@gmail.com>
; Filename .....: Office16.ahk
; Link .........: https://autohotkey.com/boards/viewtopic.php?f=6&t=3851&p=70009#p70009
; ==============================================================================
; Globals ======================================================================
#SingleInstance, Force ; Allow only one running instance of the script
#Persistent ; Keep the script permanently running until terminated
#NoEnv ; Avoid checking empty variables for environment variables
#Warn ; Enable warnings to assist with detecting common errors
;#NoTrayIcon ; Disable the tray icon of the script
SendMode, Input ; Method for sending keystrokes and mouse clicks
SetWorkingDir, %A_ScriptDir% ; Set the working directory of the script
SetBatchLines, -1 ; Run the script at maximum speed
SetWinDelay, -1 ; The delay to occur after modifying a window
SetControlDelay, -1 ; The delay to occur after modifying a control
Application := {} ; Create Application Object
Application.Name := "New AutoHotkey Script"
Application.Version := "0.1"
Window := {} ; Create Window Object
Window.Width := 600
Window.Height := 400
Window.Title := Application.Name
; ==============================================================================
; Script =======================================================================
Menu, FileMenu, Add, File (Item 1), MenuHandler
Menu, FileMenu, Add, File (Item 2), MenuHandler
Menu, FileMenu, Add, File (Item 3), MenuHandler
Menu, FileMenu, Add ; Separator
Menu, FileMenu, Add, Exit, ExitSub
Menu, EditMenu, Add, Edit (Item 1), MenuHandler
Menu, EditMenu, Add, Edit (Item 2), MenuHandler
Menu, EditMenu, Add, Edit (Item 3), MenuHandler
Menu, ViewMenu, Add, View (Item 1), MenuHandler
Menu, ViewMenu, Add, View (Item 2), MenuHandler
Menu, ViewMenu, Add, View (Item 3), MenuHandler
Menu, ToolsMenu, Add, Tools (Item 1), MenuHandler
Menu, ToolsMenu, Add, Tools (Item 2), MenuHandler
Menu, ToolsMenu, Add, Tools (Item 3), MenuHandler
Menu, HelpMenu, Add, Help (Item 1), MenuHandler
Menu, HelpMenu, Add, Help (Item 2), MenuHandler
Menu, HelpMenu, Add, Help (Item 3), MenuHandler
Gui, +LastFound -Resize -Caption -Border +HWNDhGui1
Gui, Color, FFFFFF
Gui, Margin, 10, 10
; Window Border
Gui, Add, Text, % " x" 0 " y" 0 " w" 1 " h" Window.Height " +0x4E +HWNDhBorderLeft"
Gui, Add, Text, % " x" Window.Width-1 " y" 0 " w" 1 " h" Window.Height " +0x4E +HWNDhBorderRight"
Gui, Add, Text, % "x" 1 " y" Window.Height-1 " w" Window.Width-2 " h" 1 " +0x4E +HWNDhBorderBottom"
DllCall("SendMessage", "Ptr", hBorderLeft, "UInt", 0x172, "Ptr", 0, "Ptr", CreateDIB("0072C6", 1, 1))
DllCall("SendMessage", "Ptr", hBorderRight, "UInt", 0x172, "Ptr", 0, "Ptr", CreateDIB("0072C6", 1, 1))
DllCall("SendMessage", "Ptr", hBorderBottom, "UInt", 0x172, "Ptr", 0, "Ptr", CreateDIB("0072C6", 1, 1))
; Window Header
Gui, Add, Text, % "x" 1 " y" 0 " w" Window.Width-2 " h" 67 " +0x4E +HWNDhTitleHeader"
DllCall("SendMessage", "Ptr", hTitleHeader, "UInt", 0x172, "Ptr", 0, "Ptr", CreateDIB("0173C7", 1, 1))
; Window Title
Gui, Font, s9 cFFFFFF, Segoe UI ; Set font options
Gui, Add, Text, % " x" 140 " y" 12 " w" Window.Width-280 " +BackgroundTrans +0x101 +HWNDhTitle", % Window.Title
Gui, Font ; Reset font options
; Window StatusBar
Gui, Add, Picture, % " x" 1 " y" Window.Height-23 " w" Window.Width-2 " h" 22 " +0x4E +HWNDhStatusBar"
StatusBar := "#@@@@@@@@@@@@@@@@@@@@@"
StringReplace, StatusBar, StatusBar, #, BFBFBF|, All
StringReplace, StatusBar, StatusBar, @, F1F1F1|, All
StringTrimRight, StatusBar, StatusBar, 1
DllCall("SendMessage", "Ptr", hStatusBar, "UInt", 0x172, "Ptr", 0, "Ptr", CreateDIB(StatusBar, 1, 22))
Gui, Font, s8 c515050, Segoe UI ; Set font options
Gui, Add, Text, % " x" 8 " y" Window.Height-19 " w" Window.Width-16 " +HWNDhStatusBarText +BackgroundTrans", % "Sample Text"
Gui, Font ; Reset font options
; Window Minimize Button
Gui, Add, Picture, % " x" Window.Width-139 " y" 1 " w" 46 " h" 31 " +0x4E +HWNDhButtonMinimizeN Hidden0"
Gui, Add, Picture, % " x" Window.Width-139 " y" 1 " w" 46 " h" 31 " +0x4E +HWNDhButtonMinimizeH Hidden1"
Gui, Add, Picture, % " x" Window.Width-139 " y" 1 " w" 46 " h" 31 " +0x4E +HWNDhButtonMinimizeP Hidden1"
ButtonMinimize := "####################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################@@@@@@@@@@####################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################"
StringReplace, ButtonMinimizeN, ButtonMinimize, #, 0173C7|, All
StringReplace, ButtonMinimizeN, ButtonMinimizeN, @, FFFFFF|, All
StringTrimRight, ButtonMinimizeN, ButtonMinimizeN, 1
StringReplace, ButtonMinimizeH, ButtonMinimize, #, 2A8AD4|, All
StringReplace, ButtonMinimizeH, ButtonMinimizeH, @, FFFFFF|, All
StringTrimRight, ButtonMinimizeH, ButtonMinimizeH, 1
StringReplace, ButtonMinimizeP, ButtonMinimize, #, 015C9F|, All
StringReplace, ButtonMinimizeP, ButtonMinimizeP, @, FFFFFF|, All
StringTrimRight, ButtonMinimizeP, ButtonMinimizeP, 1
DllCall("SendMessage", "Ptr", hButtonMinimizeN, "UInt", 0x172, "Ptr", 0, "Ptr", CreateDIB(ButtonMinimizeN, 46, 31))
DllCall("SendMessage", "Ptr", hButtonMinimizeH, "UInt", 0x172, "Ptr", 0, "Ptr", CreateDIB(ButtonMinimizeH, 46, 31))
DllCall("SendMessage", "Ptr", hButtonMinimizeP, "UInt", 0x172, "Ptr", 0, "Ptr", CreateDIB(ButtonMinimizeP, 46, 31))
; Window Maximize Button
Gui, Add, Picture, % " x" Window.Width-93 " y" 1 " w" 46 " h" 31 " +0x4E +HWNDhButtonMaximizeN Hidden0"
Gui, Add, Picture, % " x" Window.Width-93 " y" 1 " w" 46 " h" 31 " +0x4E +HWNDhButtonMaximizeH Hidden1"
Gui, Add, Picture, % " x" Window.Width-93 " y" 1 " w" 46 " h" 31 " +0x4E +HWNDhButtonMaximizeP Hidden1"
ButtonMaximize := "##############################################################################################################################################################################################################################################################################################################################################################################################################################################################################################@@@@@@@@@@####################################@########@####################################@########@####################################@########@####################################@########@####################################@########@####################################@########@####################################@########@####################################@########@####################################@@@@@@@@@@############################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################"
StringReplace, ButtonMaximizeN, ButtonMaximize, #, 0173C7|, All
StringReplace, ButtonMaximizeN, ButtonMaximizeN, @, FFFFFF|, All
StringTrimRight, ButtonMaximizeN, ButtonMaximizeN, 1
StringReplace, ButtonMaximizeH, ButtonMaximize, #, 2A8AD4|, All
StringReplace, ButtonMaximizeH, ButtonMaximizeH, @, FFFFFF|, All
StringTrimRight, ButtonMaximizeH, ButtonMaximizeH, 1
StringReplace, ButtonMaximizeP, ButtonMaximize, #, 015C9F|, All
StringReplace, ButtonMaximizeP, ButtonMaximizeP, @, FFFFFF|, All
StringTrimRight, ButtonMaximizeP, ButtonMaximizeP, 1
DllCall("SendMessage", "Ptr", hButtonMaximizeN, "UInt", 0x172, "Ptr", 0, "Ptr", CreateDIB(ButtonMaximizeN, 46, 31))
DllCall("SendMessage", "Ptr", hButtonMaximizeH, "UInt", 0x172, "Ptr", 0, "Ptr", CreateDIB(ButtonMaximizeH, 46, 31))
DllCall("SendMessage", "Ptr", hButtonMaximizeP, "UInt", 0x172, "Ptr", 0, "Ptr", CreateDIB(ButtonMaximizeP, 46, 31))
; Window Restore Button
Gui, Add, Picture, % " x" Window.Width-93 " y" 1 " w" 46 " h" 31 " +0x4E +HWNDhButtonRestoreN Hidden1"
Gui, Add, Picture, % " x" Window.Width-93 " y" 1 " w" 46 " h" 31 " +0x4E +HWNDhButtonRestoreH Hidden1"
Gui, Add, Picture, % " x" Window.Width-93 " y" 1 " w" 46 " h" 31 " +0x4E +HWNDhButtonRestoreP Hidden1"
ButtonRestore := "################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################@@@@@@@@######################################@######@####################################@@@@@@@@#@####################################@######@#@####################################@######@#@####################################@######@#@####################################@######@#@####################################@######@@@####################################@######@######################################@@@@@@@@##############################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################"
StringReplace, ButtonRestoreN, ButtonRestore, #, 0173C7|, All
StringReplace, ButtonRestoreN, ButtonRestoreN, @, FFFFFF|, All
StringTrimRight, ButtonRestoreN, ButtonRestoreN, 1
StringReplace, ButtonRestoreH, ButtonRestore, #, 2A8AD4|, All
StringReplace, ButtonRestoreH, ButtonRestoreH, @, FFFFFF|, All
StringTrimRight, ButtonRestoreH, ButtonRestoreH, 1
StringReplace, ButtonRestoreP, ButtonRestore, #, 015C9F|, All
StringReplace, ButtonRestoreP, ButtonRestoreP, @, FFFFFF|, All
StringTrimRight, ButtonRestoreP, ButtonRestoreP, 1
DllCall("SendMessage", "Ptr", hButtonRestoreN, "UInt", 0x172, "Ptr", 0, "Ptr", CreateDIB(ButtonRestoreN, 46, 31))
DllCall("SendMessage", "Ptr", hButtonRestoreH, "UInt", 0x172, "Ptr", 0, "Ptr", CreateDIB(ButtonRestoreH, 46, 31))
DllCall("SendMessage", "Ptr", hButtonRestoreP, "UInt", 0x172, "Ptr", 0, "Ptr", CreateDIB(ButtonRestoreP, 46, 31))
; Window Close Button
Gui, Add, Picture, % " x" Window.Width-47 " y" 1 " w" 46 " h" 31 " +0x4E +HWNDhButtonCloseN Hidden0"
Gui, Add, Picture, % " x" Window.Width-47 " y" 1 " w" 46 " h" 31 " +0x4E +HWNDhButtonCloseH Hidden1"
Gui, Add, Picture, % " x" Window.Width-47 " y" 1 " w" 46 " h" 31 " +0x4E +HWNDhButtonCloseP Hidden1"
ButtonClose := "##############################################################################################################################################################################################################################################################################################################################################################################################################################################################################################-$######$-####################################$-$####$-$#####################################$-$##$-$#######################################$-$$-$#########################################$--$##########################################$--$#########################################$-$$-$#######################################$-$##$-$#####################################$-$####$-$####################################-$######$-############################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################"
StringReplace, ButtonCloseN, ButtonClose, #, 0173C7|, All
StringReplace, ButtonCloseN, ButtonCloseN, $, 4096D5|, All
StringReplace, ButtonCloseN, ButtonCloseN, -, FFFFFF|, All
StringTrimRight, ButtonCloseN, ButtonCloseN, 1
StringReplace, ButtonCloseH, ButtonClose, #, E81123|, All
StringReplace, ButtonCloseH, ButtonCloseH, $, EE4C59|, All
StringReplace, ButtonCloseH, ButtonCloseH, -, FFFFFF|, All
StringTrimRight, ButtonCloseH, ButtonCloseH, 1
StringReplace, ButtonCloseP, ButtonClose, #, F1707A|, All
StringReplace, ButtonCloseP, ButtonCloseP, $, F4939B|, All
StringReplace, ButtonCloseP, ButtonCloseP, -, FFFFFF|, All
StringTrimRight, ButtonCloseP, ButtonCloseP, 1
DllCall("SendMessage", "Ptr", hButtonCloseN, "UInt", 0x172, "Ptr", 0, "Ptr", CreateDIB(ButtonCloseN, 46, 31))
DllCall("SendMessage", "Ptr", hButtonCloseH, "UInt", 0x172, "Ptr", 0, "Ptr", CreateDIB(ButtonCloseH, 46, 31))
DllCall("SendMessage", "Ptr", hButtonCloseP, "UInt", 0x172, "Ptr", 0, "Ptr", CreateDIB(ButtonCloseP, 46, 31))
; Window Menu Button
Gui, Font, s9 cFFFFFF, Segoe UI ; Set font options
Gui, Add, Picture, % " x" 2 " y" 36 " w" 60 " h" 24 " +0x4E +HWNDhButtonMenuFileN Hidden0"
Gui, Add, Picture, % " xp" 0 " yp" 0 " wp" 0 " hp" 0 " +0x4E +HWNDhButtonMenuFileH Hidden1"
Gui, Add, Text, % " xp" 0 " yp" 0 " wp" 0 " hp" 0 " +HWNDhButtonMenuFileText +BackgroundTrans +0x201", % "File"
DllCall("SendMessage", "Ptr", hButtonMenuFileN, "UInt", 0x172, "Ptr", 0, "Ptr", CreateDIB("0173C7", 1, 1))
DllCall("SendMessage", "Ptr", hButtonMenuFileH, "UInt", 0x172, "Ptr", 0, "Ptr", CreateDIB("2A8AD4", 1, 1))
Gui, Add, Picture, % " x+" 2 " yp" 0 " w" 60 " h" 24 " +0x4E +HWNDhButtonMenuEditN Hidden0"
Gui, Add, Picture, % " xp" 0 " yp" 0 " wp" 0 " hp" 0 " +0x4E +HWNDhButtonMenuEditH Hidden1"
Gui, Add, Text, % " xp" 0 " yp" 0 " wp" 0 " hp" 0 " +HWNDhButtonMenuEditText +BackgroundTrans +0x201", % "Edit"
DllCall("SendMessage", "Ptr", hButtonMenuEditN, "UInt", 0x172, "Ptr", 0, "Ptr", CreateDIB("0173C7", 1, 1))
DllCall("SendMessage", "Ptr", hButtonMenuEditH, "UInt", 0x172, "Ptr", 0, "Ptr", CreateDIB("2A8AD4", 1, 1))
Gui, Add, Picture, % " x+" 2 " yp" 0 " w" 60 " h" 24 " +0x4E +HWNDhButtonMenuViewN Hidden0"
Gui, Add, Picture, % " xp" 0 " yp" 0 " wp" 0 " hp" 0 " +0x4E +HWNDhButtonMenuViewH Hidden1"
Gui, Add, Text, % " xp" 0 " yp" 0 " wp" 0 " hp" 0 " +HWNDhButtonMenuViewText +BackgroundTrans +0x201", % "View"
DllCall("SendMessage", "Ptr", hButtonMenuViewN, "UInt", 0x172, "Ptr", 0, "Ptr", CreateDIB("0173C7", 1, 1))
DllCall("SendMessage", "Ptr", hButtonMenuViewH, "UInt", 0x172, "Ptr", 0, "Ptr", CreateDIB("2A8AD4", 1, 1))
Gui, Add, Picture, % " x+" 2 " yp" 0 " w" 60 " h" 24 " +0x4E +HWNDhButtonMenuToolsN Hidden0"
Gui, Add, Picture, % " xp" 0 " yp" 0 " wp" 0 " hp" 0 " +0x4E +HWNDhButtonMenuToolsH Hidden1"
Gui, Add, Text, % " xp" 0 " yp" 0 " wp" 0 " hp" 0 " +HWNDhButtonMenuToolsText +BackgroundTrans +0x201", % "Tools"
DllCall("SendMessage", "Ptr", hButtonMenuToolsN, "UInt", 0x172, "Ptr", 0, "Ptr", CreateDIB("0173C7", 1, 1))
DllCall("SendMessage", "Ptr", hButtonMenuToolsH, "UInt", 0x172, "Ptr", 0, "Ptr", CreateDIB("2A8AD4", 1, 1))
Gui, Add, Picture, % " x+" 2 " yp" 0 " w" 60 " h" 24 " +0x4E +HWNDhButtonMenuHelpN Hidden0"
Gui, Add, Picture, % " xp" 0 " yp" 0 " wp" 0 " hp" 0 " +0x4E +HWNDhButtonMenuHelpH Hidden1"
Gui, Add, Text, % " xp" 0 " yp" 0 " wp" 0 " hp" 0 " +HWNDhButtonMenuHelpText +BackgroundTrans +0x201", % "Help"
DllCall("SendMessage", "Ptr", hButtonMenuHelpN, "UInt", 0x172, "Ptr", 0, "Ptr", CreateDIB("0173C7", 1, 1))
DllCall("SendMessage", "Ptr", hButtonMenuHelpH, "UInt", 0x172, "Ptr", 0, "Ptr", CreateDIB("2A8AD4", 1, 1))
Gui, Font ; Reset font options
Gui, Show, % " w" Window.Width " h" Window.Height, % Window.Title
OnMessage(0x200, "WM_MOUSEMOVE")
OnMessage(0x201, "WM_LBUTTONDOWN")
OnMessage(0x202, "WM_LBUTTONUP")
OnMessage(0x2A3, "WM_MOUSELEAVE")
VarSetCapacity(TME, 16, 0), NumPut(16, TME, 0), NumPut(2, TME, 4), NumPut(hGui1, TME, 8)
return ; End automatic execution
; ==============================================================================
; Labels =======================================================================
GuiSize:
If (ErrorLevel = 1) {
return ; The window has been minimized. No action needed.
}
GuiControl, MoveDraw, % hTitleHeader, % " w" A_GuiWidth-2
GuiControl, MoveDraw, % hBorderLeft, % " h" A_GuiHeight
GuiControl, MoveDraw, % hBorderRight, % " x" A_GuiWidth-1 " h" A_GuiHeight
GuiControl, MoveDraw, % hBorderBottom, % " y" A_GuiHeight-1 " w" A_GuiWidth-2
GuiControl, MoveDraw, % hTitle, % " w" A_GuiWidth-280
GuiControl, MoveDraw, % hStatusBar, % " w" A_GuiWidth-2 " y" A_GuiHeight-23
GuiControl, MoveDraw, % hStatusBarText, % " w" A_GuiWidth-16 " y" A_GuiHeight-19
GuiControl, MoveDraw, % hButtonMinimizeN, % " x" A_GuiWidth-139
GuiControl, MoveDraw, % hButtonMinimizeH, % " x" A_GuiWidth-139
GuiControl, MoveDraw, % hButtonMinimizeP, % " x" A_GuiWidth-139
GuiControl, MoveDraw, % hButtonMaximizeN, % " x" A_GuiWidth-93
GuiControl, MoveDraw, % hButtonMaximizeH, % " x" A_GuiWidth-93
GuiControl, MoveDraw, % hButtonMaximizeP, % " x" A_GuiWidth-93
GuiControl, MoveDraw, % hButtonRestoreN, % " x" A_GuiWidth-93
GuiControl, MoveDraw, % hButtonRestoreH, % " x" A_GuiWidth-93
GuiControl, MoveDraw, % hButtonRestoreP, % " x" A_GuiWidth-93
GuiControl, MoveDraw, % hButtonCloseN, % " x" A_GuiWidth-47
GuiControl, MoveDraw, % hButtonCloseH, % " x" A_GuiWidth-47
GuiControl, MoveDraw, % hButtonCloseP, % " x" A_GuiWidth-47
return
MenuHandler:
MsgBox,, MenuHandler, % "Menu Item: " A_ThisMenuItem "`nMenu: " A_ThisMenu
return
GuiEscape:
GuiClose:
ExitSub:
ExitApp ; Terminate the script unconditionally
return
; ==============================================================================
; Functions ====================================================================
WM_MOUSEMOVE(wParam, lParam, Msg, Hwnd) {
Global
DllCall("TrackMouseEvent", "UInt", &TME)
MouseGetPos,,,, MouseCtrl, 2
GuiControl, % (MouseCtrl = hButtonMinimizeN || MouseCtrl = hButtonMinimizeH) ? "Show" : "Hide", % hButtonMinimizeH
GuiControl, % (MouseCtrl = hButtonMaximizeN || MouseCtrl = hButtonMaximizeH) ? "Show" : "Hide", % hButtonMaximizeH
GuiControl, % (MouseCtrl = hButtonRestoreN || MouseCtrl = hButtonRestoreH) ? "Show" : "Hide", % hButtonRestoreH
GuiControl, % (MouseCtrl = hButtonCloseN || MouseCtrl = hButtonCloseH) ? "Show" : "Hide", % hButtonCloseH
GuiControl, % (MouseCtrl = hButtonMenuFileText) ? "Show" : "Hide", % hButtonMenuFileH
GuiControl, % (MouseCtrl = hButtonMenuEditText) ? "Show" : "Hide", % hButtonMenuEditH
GuiControl, % (MouseCtrl = hButtonMenuViewText) ? "Show" : "Hide", % hButtonMenuViewH
GuiControl, % (MouseCtrl = hButtonMenuToolsText) ? "Show" : "Hide", % hButtonMenuToolsH
GuiControl, % (MouseCtrl = hButtonMenuHelpText) ? "Show" : "Hide", % hButtonMenuHelpH
}
WM_LBUTTONDOWN(wParam, lParam, Msg, Hwnd) {
Global
If (MouseCtrl = hTitleHeader || MouseCtrl = hTitle) {
PostMessage, 0xA1, 2
}
GuiControl, % (MouseCtrl = hButtonMinimizeH) ? "Show" : "Hide", % hButtonMinimizeP
GuiControl, % (MouseCtrl = hButtonMaximizeH) ? "Show" : "Hide", % hButtonMaximizeP
GuiControl, % (MouseCtrl = hButtonRestoreH) ? "Show" : "Hide", % hButtonRestoreP
GuiControl, % (MouseCtrl = hButtonCloseH) ? "Show" : "Hide", % hButtonCloseP
}
WM_LBUTTONUP(wParam, lParam, Msg, Hwnd) {
Global
If (MouseCtrl = hButtonMinimizeP) {
WinMinimize
} Else If (MouseCtrl = hButtonMaximizeP || MouseCtrl = hButtonRestoreP) {
WinGet, MinMaxStatus, MinMax
If (MinMaxStatus = 1) {
WinRestore
GuiControl, Hide, % hButtonRestoreN
} Else {
WinMaximize
GuiControl, Show, % hButtonRestoreN
}
} Else If (MouseCtrl = hButtonCloseP) {
ExitApp
} Else If (MouseCtrl = hButtonMenuFileText) {
ControlGetPos, ctlX, ctlY, ctlW, ctlH, , ahk_id %hButtonMenuFileText%
Menu, FileMenu, Show, %ctlX%, % ctlY + ctlH
} Else If (MouseCtrl = hButtonMenuEditText) {
ControlGetPos, ctlX, ctlY, ctlW, ctlH, , ahk_id %hButtonMenuEditText%
Menu, EditMenu, Show, %ctlX%, % ctlY + ctlH
} Else If (MouseCtrl = hButtonMenuViewText) {
ControlGetPos, ctlX, ctlY, ctlW, ctlH, , ahk_id %hButtonMenuViewText%
Menu, ViewMenu, Show, %ctlX%, % ctlY + ctlH
} Else If (MouseCtrl = hButtonMenuToolsText) {
ControlGetPos, ctlX, ctlY, ctlW, ctlH, , ahk_id %hButtonMenuToolsText%
Menu, ToolsMenu, Show, %ctlX%, % ctlY + ctlH
} Else If (MouseCtrl = hButtonMenuHelpText) {
ControlGetPos, ctlX, ctlY, ctlW, ctlH, , ahk_id %hButtonMenuHelpText%
Menu, HelpMenu, Show, %ctlX%, % ctlY + ctlH
}
GuiControl, Hide, % hButtonMinimizeP
GuiControl, Hide, % hButtonMaximizeP
GuiControl, Hide, % hButtonRestoreP
GuiControl, Hide, % hButtonCloseP
GuiControl, Hide, % hButtonMenuFileH
GuiControl, Hide, % hButtonMenuEditH
GuiControl, Hide, % hButtonMenuViewH
GuiControl, Hide, % hButtonMenuToolsH
GuiControl, Hide, % hButtonMenuHelpH
}
WM_MOUSELEAVE(wParam, lParam, Msg, Hwnd) {
Global
GuiControl, Hide, % hButtonMinimizeH
GuiControl, Hide, % hButtonMaximizeH
GuiControl, Hide, % hButtonRestoreH
GuiControl, Hide, % hButtonCloseH
GuiControl, Hide, % hButtonMinimizeP
GuiControl, Hide, % hButtonMaximizeP
GuiControl, Hide, % hButtonRestoreP
GuiControl, Hide, % hButtonCloseP
GuiControl, Hide, % hButtonMenuFileH
GuiControl, Hide, % hButtonMenuEditH
GuiControl, Hide, % hButtonMenuViewH
GuiControl, Hide, % hButtonMenuToolsH
GuiControl, Hide, % hButtonMenuHelpH
}
CreateDIB(Input, W, H, ResizeW := 0, ResizeH := 0, Gradient := 1 ) {
WB := Ceil((W * 3) / 2) * 2, VarSetCapacity(BMBITS, (WB * H) + 1, 0), P := &BMBITS
Loop, Parse, Input, |
{
P := Numput("0x" . A_LoopField, P + 0, 0, "UInt") - (W & 1 && Mod(A_Index * 3, W * 3) = 0 ? 0 : 1)
}
hBM := DllCall("CreateBitmap", "Int", W, "Int", H, "UInt", 1, "UInt", 24, "Ptr", 0, "Ptr")
hBM := DllCall("CopyImage", "Ptr", hBM, "UInt", 0, "Int", 0, "Int", 0, "UInt", 0x2008, "Ptr")
DllCall("SetBitmapBits", "Ptr", hBM, "UInt", WB * H, "Ptr", &BMBITS)
If (Gradient != 1) {
hBM := DllCall("CopyImage", "Ptr", hBM, "UInt", 0, "Int", 0, "Int", 0, "UInt", 0x0008, "Ptr")
}
return DllCall("CopyImage", "Ptr", hBM, "Int", 0, "Int", ResizeW, "Int", ResizeH, "Int", 0x200C, "UPtr")
}
; ==============================================================================