Examples of Non-Standard GUIs (ActiveX, GDI, etc.)

Post your working scripts, libraries and tools for AHK v1.1 and older
-_+
Posts: 70
Joined: 06 Dec 2014, 12:43

Re: Alternative GUI styles (please contribute)

14 Sep 2015, 09:34

Blackholyman wrote:I made this sometime back but never really used it for anything.
But I liked the idea, so I've kept it as a template for later use.

Image:
Spoiler
Doesn't work for me on latest u32 ahk. :(
User avatar
TheDewd
Posts: 1503
Joined: 19 Dec 2013, 11:16
Location: USA

Re: Examples of Non-Standard GUIs (ActiveX, GDI, etc.)

23 Sep 2015, 08:44

I began working on a Windows 10 styled GUI, but became bored and decided to work on something else... It needs a little polish, but works well so far. I've attached the script and image files to this post. Feel free to use in your own project to apply the look of a Windows 10 application to older versions of Windows, etc...
Windows10_UI.zip
AutoHotkey Script and image files
(19.2 KiB) Downloaded 1045 times
Win10Gui_Settings.png
Settings view
Win10Gui_Settings.png (3.94 KiB) Viewed 11196 times
Win10Gui_Main.png
Main view
Win10Gui_Main.png (2.15 KiB) Viewed 11196 times
Ferry
Posts: 13
Joined: 10 Jul 2014, 15:55

Re: Examples of Non-Standard GUIs (ActiveX, GDI, etc.)

25 Sep 2015, 09:42

Windows 8 Look a like gui's can be created using the following functions:

LinearGradient (http://ahkscript.org/boards/viewtopic.php?f=6&t=3593)
Class_ImageButton (http://ahkscript.org/boards/viewtopic.php?f=6&t=1103)

I am using the "TechSmith SnagIt" setup application as an example.

Image

Code: Select all

#SingleInstance ignore
#NoTrayIcon
#Include %A_ScriptDir%\LinearGradient.ahk
#Include %A_ScriptDir%\Class_ImageButton.ahk
SetWorkingDir %A_ScriptDir% 

BG_Color = 0xFFFFFF
FT_Color = 0x005A8C
FT_Color2 = 0xF9E4C9
TX_Color = 0x333333
TX_Color2 = 0xD6D6D6
ButtonBorderRadius = 0
ButtonBorderThickness = 2

MAIN:
	Gui, MAIN:+0x400000 -Caption +Border
	Gui, MAIN:Margin, 0, 0
	Gui, MAIN:Color, %BG_Color%
	Gui, MAIN:Font, s10 q5 Bold
	Gui, MAIN:Add, Button, gMAINGUICLose vCLOSE x405 y5 h20 w20 hwndCLOSE center, x
	Opt1 := [0, FT_Color,, BG_Color, 0]
	Opt2 := [, BG_Color,, FT_Color]
	Opt4 := [, BG_Color,, FT_Color2]
	Opt5 := [,,, BG_Color]
	If !(ImageButton.Create(CLOSE, Opt1, Opt2,, Opt4, Opt5))
		MsgBox, 0, ImageButton Error CLOSE, % ImageButton.LastError
	Gui, MAIN:Add, Picture, gCaptionClick x0 y0 w460 h63 0x4000000 vPicure hwndHPIC
	Colors := [FT_Color, FT_Color]
	If !LinearGradient(HPIC, Colors)
	   MsgBox, 0, Linear Gradient, Funtion failed:`n%ErrorLevel%
	Gui, MAIN:Add, Picture, x20 y45 0x4000000 w128 h-1 Icon1, %A_ScriptFullPath%
	Gui, MAIN:Add, Text, x150 y70 c%FT_Color%, %Manufacturer%
	Gui, MAIN:Font, s16 q5 Normal, Arial
	Gui, MAIN:Add, Text, x50 y85 R1 c%TX_Color%, Setup Options
	Gui, MAIN:Font, s12 q5 Normal
	Gui, MAIN:Add, Text, x50 y115 R1 c%TX_Color%, Destination Folder
	Gui, MAIN:Add, Text, x50 y247 R1 c%TX_Color%, Features
	Gui, MAIN:Add, Text, x50 y317 R1 c%TX_Color%, Accessories
	Gui, MAIN:Add, Button, gINSTALL vINSTALL x275 y510 w120 h32 hwndINSTALL, Continue
	Opt1 := [0, BG_Color,, FT_Color, ButtonBorderRadius,, FT_Color, ButtonBorderThickness]
	Opt2 := [, FT_Color,, BG_Color]
	Opt4 := [, BG_Color,, FT_Color2]
	Opt5 := [,,, FT_Color]
	If !(ImageButton.Create(INSTALL, Opt1, Opt2,, Opt4, Opt5))
		MsgBox, 0, ImageButton Error INSTALL, % ImageButton.LastError
	Gui, MAIN:Font, s10 q5 Normal
	Gui, MAIN:Add, Edit, x50 y140 w275 h32 c%TX_Color% vILE_FILE hWndILE_FILE border -E0x200, C:\Program Files\Techsmith\Snagit 12
	Gui, MAIN:Add, Text, x335 y140 w35 h32 c%TX_Color% 0x800201 gBrowse, ...
	Gui, MAIN:Add, Checkbox, x50 y185 c%TX_Color% checked, Start Snagit when installation is finished
	Gui, MAIN:Add, Checkbox, x50 y202 c%TX_Color%, Create shortcuts on Desktop
	Gui, MAIN:Add, Checkbox, x50 y219 c%TX_Color% checked, Run Snagit when Windows start
	Gui, MAIN:Add, Checkbox, x50 y272 c%TX_Color% checked, Snagit Printer
	Gui, MAIN:Add, Checkbox, x50 y289 c%TX_Color% checked, Windows Explorer Menu Extension
	Gui, MAIN:Add, Checkbox, x50 y342 c%TX_Color% checked, Microsoft Word
	Gui, MAIN:Add, Checkbox, x50 y359 c%TX_Color% checked, Microsoft Excel
	Gui, MAIN:Add, Checkbox, x50 y376 c%TX_Color% checked, Microsoft Powerpoint
	Gui, MAIN:Add, Checkbox, x50 y393 c%TX_Color% checked, Microsoft One Note 2013
	Gui, MAIN:Add, Checkbox, x50 y410 c%TX_Color% checked, Screencast.com
	Gui, MAIN:Add, Checkbox, x50 y427 c%TX_Color% checked, Camtasia Studio
	Gui, MAIN:Add, Checkbox, x50 y444 c%TX_Color% checked, YouTube
	Gui, MAIN:Add, Checkbox, x50 y461 c%TX_Color% checked, Google Drive
	Gui, MAIN:Add, Checkbox, x50 y478 c%TX_Color% checked, Dropbox
	Gui, MAIN:Font, s22 q5 Bold, Arial Narrow
	Gui, MAIN:Add, Text, x60 y15 R1 BackgroundTrans -Wrap Center c%BG_Color%, TechSmith
	Gui, MAIN:Font, s22 q5 Normal, Arial Narrow
	Gui, MAIN:Add, Text, x190 y15 R1 BackgroundTrans -Wrap Center c%BG_Color%, Snagit™		
	Gui, MAIN:Show, w430 h565, Snagit™
Return

MAINGUICLose:
ExitApp
Return

INSTALL:
Return

Browse:
Return

LicensesTermsAndConditions:
Return

CaptionClick:
	PostMessage, 0xA1, 2,,, A
Return
User avatar
jNizM
Posts: 3183
Joined: 30 Sep 2013, 01:33
Contact:

Re: Examples of Non-Standard GUIs (ActiveX, GDI, etc.)

30 Sep 2015, 02:27

A simple Rainmeter like overview (can be more prettified) :P

Screenshot:
Image

Code:
Rainmeter.ahk

Todo:
Unique Gui

(p.s. error in GPU fan speed is because screenshot is from a fanless graphics card)
[AHK] v2.0.5 | [WIN] 11 Pro (Version 22H2) | [GitHub] Profile
ozzii
Posts: 481
Joined: 30 Oct 2013, 06:04

Re: Examples of Non-Standard GUIs (ActiveX, GDI, etc.)

30 Sep 2015, 03:25

Thanks jNizM.
But where is the code?
User avatar
jNizM
Posts: 3183
Joined: 30 Sep 2013, 01:33
Contact:

Re: Examples of Non-Standard GUIs (ActiveX, GDI, etc.)

30 Sep 2015, 03:36

Post updated
[AHK] v2.0.5 | [WIN] 11 Pro (Version 22H2) | [GitHub] Profile
User avatar
Alguimist
Posts: 428
Joined: 05 Oct 2015, 16:41
Contact:

Re: Examples of Non-Standard GUIs (ActiveX, GDI, etc.)

05 Oct 2015, 17:20

Not exactly an example of non-standard GUI:

Image

Code: Select all

#NoEnv
#Warn
#SingleInstance Force
SetWorkingDir %A_ScriptDir%
SetBatchLines -1

Menu Tray, Icon, shell32.dll, 131

Gui Body: New, LabelBody hWndhBody
Gui Color, White

Gui Add, Edit, x-1 y-1 w0 h0 ; Focus
Gui Font, s8 w700 cBlack, Segoe UI
Gui Add, Text, x10 y46 w187 h16, You're installing these programs.
Gui Font
Gui Font,, Segoe UI
Gui Add, Text, x10 y62 w456 h16 +0x200, As each item finishes, you can start using it while the others continue to install.
Gui Add, Text, x10 y80 w480 h1 0x10 ; Separator

If (FileExist(A_WinDir . "\System32\ieframe.dll")) {
    Gui Add, Picture, x24 y90 w16 h16 Icon40, ieframe.dll
}
Gui Add, Text, x48 y90 w100 h16 +0x200, Installed
Gui Add, Text, x48 y107 w100 h16 +0x200, Installing
Gui Add, Text, x48 y124 w100 h16 +0x200, 100`% downloaded

Gui Font, w700 c0x0080ff, Segoe UI
Gui Add, Text, x164 y90 w100 h16 +0x200, Start Messenger
Gui Font
Gui Font, s8 w700, Segoe UI
Gui Add, Text, x164 y107 w100 h16 +0x200, Writer
Gui Font
Gui Font, w700 cBlack, Segoe UI
Gui Add, Text, x164 y124 w100 h16 +0x200, Sign-in Assistant
Gui Font

Gui Font,, Segoe UI
Gui Add, Text, x336 y90 w120 h16 +0x200, Done
Gui Font
Gui Add, Progress, x335 y108 w120 h16 -Smooth, 5

Gui Font, w700 cBlack, Segoe UI
Gui Add, Text, x10 y224 w480 h16 +0x200, Select any additional products you want to install.
Gui Font
Gui Add, Text, x10 y243 w480 h2 0x10 ; Separator
Gui Font, w700, Segoe UI
Gui Add, CheckBox, x33 y253 w42 h23, Mail
Gui Add, CheckBox, x33 y282 w60 h23, Toolbar
Gui Add, CheckBox, x33 y311 w92 h23, Photo Gallery
Gui Add, CheckBox, x33 y342 w92 h23, Family Safety
Gui Font

Gui Font,, Segoe UI
Gui Add, Text, x78 y253 w410 h23 +0x200, (15 MB) - Access all your e-mail accounts in one place
Gui Add, Text, x95 y282 w393 h23 +0x200, (5 MB) - Search from any Web page
Gui Add, Text, x126 y311 w362 h23 +0x200, (13 MB) - Easily organize, edit, and share your photos and videos
Gui Add, Text, x126 y341 w364 h23 +0x200, (3 MB) - Help keep your family safe online

Gui Add, Button, x14 y376 w110 h23 Disabled, Add to installation
Gui Font, c0x0080ff, Segoe UI
Gui Add, Text, x10 y400 w263 h25 +0x200, Learn more about these products
Gui Font

Gui Add, Progress, x-1 y430 w502 h49 Border, 0
Gui Font,, Segoe UI
Gui Add, Button, x413 y439 w75 h23, Cancel

Gui Show, w499 h471, Windows Live Installer

Gui Header: New, -Caption +Parent%hBody%
Gui Header: Color, 0x008EBC
Gui Header: Add, Picture, x24 y6 w28 h28 Icon131, shell32.dll
Gui Font, s14 c0xF3F8FB, Ms Shell Dlg 2
Gui Header: Add, Text, x54 y1 w394 h38 +0x200 BackgroundTrans, Windows Live
Gui Font
Gui Header: Show, x0 y0 w500 h38

Gui Info: New, -Caption +Parent%hBody%
Gui Info: Color, 0xFFFFE1
Gui Info: Font,, Segoe UI
Gui Info: Add, Picture, x4 y4 w16 h16 Icon222, shell32.dll
Gui Info: Add, Text, x25 y0 w480 h23 +0x200, Installation may take a few minutes. Feel free to do other things while you wait.
Gui Info: Font
Gui Info: Show, x10 y196 w480 h23
Return

BodyEscape:
BodyClose:
    ExitApp
User avatar
jNizM
Posts: 3183
Joined: 30 Sep 2013, 01:33
Contact:

Re: Examples of Non-Standard GUIs (ActiveX, GDI, etc.)

06 Oct 2015, 01:17

@Alguimist Well done =)
[AHK] v2.0.5 | [WIN] 11 Pro (Version 22H2) | [GitHub] Profile
User avatar
Soft
Posts: 174
Joined: 07 Jan 2015, 13:18
Location: Seoul
Contact:

Re: Examples of Non-Standard GUIs (ActiveX, GDI, etc.)

06 Oct 2015, 12:04

based on TheDewd's office style gui, added maximized button and resizing

Code: Select all

; ========================================================================================
; NAME .........: OFFICE 365 GUI STYLE
; DESCRIPTION ..: USE AUTOHOTKEY CONTROLS TO IMITATE OFFICE 365 THEME
; AHK VERSION ..: AHK_L 1.1.19.01 (UNICODE 32-BIT) - JANUARY 5, 2015
; PLATFORM .....: WINDOWS 7 PROFESSIONAL SP1 64-BIT
; LANGUAGE .....: ENGLISH (EN-US)
; AUTHOR .......: THEDEWD
; MODIFIED......: 20150115170730
; ========================================================================================
 
; GLOBAL =================================================================================
#SingleInstance, Force ; ALLOWS ONLY ONE RUNNING INSTANCE OF SCRIPT
#Persistent ; KEEPS SCRIPT PERMANENTLY RUNNING UNTIL TERMINATED
#NoEnv ; AVOIDS CHECKING EMPTY VARIABLES TO SEE If THEY ARE ENVIRONMENT VARIABLES
#Warn ; ENABLES WARNINGS TO ASSIST WITH DETECTING COMMON ERRORS
SendMode, Input ; RECOMMENDED FOR NEW SCRIPTS DUE TO ITS SUPERIOR SPEED AND RELIABILITY
SetWorkingDir, %A_ScriptDir% ; ENSURES A CONSISTENT STARTING DIRECTORY
SetBatchLines, -1 ; RUNS SCRIPT AT MAXIMUM SPEED/NEVER SLEEPS
#NoTrayIcon ; DISABLES THE SHOWING OF A TRAY ICON
 
GuiW := 700 ; GUI WIDTH
GuiH := 400 ; GUI HEIGHT
 
; SCRIPT =================================================================================
Gui, -Caption -Border +Resize +LastFound +hwndhMainWindow  ; GUI OPTIONS
Gui, Margin, 0, 0
Gui, Color, FFFFFF ; GUI COLOR

Gui, Add, Text, % " x" 1 " y" 1 " w" 37 " h" 28 " +BackgroundTrans gGuiIcon" ; GUI ICON TRIGGER
Gui, Add, Text, % " x" GuiW-89 " y" 4 " w" 29 " h" 22 " +BackgroundTrans gGuiMinimize hwndhMinTrig" ; GUI MINIMIZE TRIGGER
Gui, Add, Text, % " x" GuiW-59 " y" 4 " w" 30 " h" 22 " +BackgroundTrans gGuiMaximize hwndhMaxTrig" ; GUI MINIMIZE TRIGGER
Gui, Add, Text, % " x" GuiW-30 " y" 4 " w" 29 " h" 22 " +BackgroundTrans gGuiClose hwndhXTrig" ; GUI CLOSE TRIGGER
Gui, Add, Text, % " x" 1 " y" 1 " w" GuiW-2 " h" 28 " +BackgroundTrans gGuiMove hwndhMoveTrig" ; GUI MOVE TRIGGER
Gui, Add, Progress, % " x" 11 " y" 4 " w" 16 " h" 16 " Background0072C6", 0 ; GUI ICON
 
Gui, Add, Progress, % " x" GuiW-80 " y" 10 " w" 9 " h" 2 " Background777777 hwndhMin", 0 ; GUI MINIMIZE

Gui, Add, Progress, % " x" GuiW-50 " y" 3 " w" 11 " h" 2 " Background777777 hwndhMaxT", 0 ; GUI MAXIMIZE TOP
Gui, Add, Progress, % " x" GuiW-50 " y" 11 " w" 11 " h" 2 " Background777777 hwndhMaxB", 0 ; GUI MAXIMIZE BOTTOM
Gui, Add, Progress, % " x" GuiW-41 " y" 3 " w" 2 " h" 10 " Background777777 hwndhMaxR", 0 ; GUI MAXIMIZE RIGHT
Gui, Add, Progress, % " x" GuiW-50 " y" 3 " w" 2 " h" 10 " Background777777 hwndhMaxL", 0 ; GUI MAXIMIZE LEFT
 
Gui, Add, Progress, % " x" GuiW-20 " y" 4 " w" 1 " h" 1 " Background777777 hwndhXTL1", 0 ; GUI CLOSE TOP-LEFT 01
Gui, Add, Progress, % " x" GuiW-21 " y" 5 " w" 3 " h" 1 " Background777777 hwndhXTL2", 0 ; GUI CLOSE TOP-LEFT 02
Gui, Add, Progress, % " x" GuiW-20 " y" 6 " w" 3 " h" 1 " Background777777 hwndhXTL3", 0 ; GUI CLOSE TOP-LEFT 03
Gui, Add, Progress, % " x" GuiW-13 " y" 4 " w" 1 " h" 1 " Background777777 hwndhXTR1", 0 ; GUI CLOSE TOP-RIGHT 01
Gui, Add, Progress, % " x" GuiW-14 " y" 5 " w" 3 " h" 1 " Background777777 hwndhXTR2", 0 ; GUI CLOSE TOP-RIGHT 02
Gui, Add, Progress, % " x" GuiW-15 " y" 6 " w" 3 " h" 1 " Background777777 hwndhXTR3", 0 ; GUI CLOSE TOP-RIGHT 03
Gui, Add, Progress, % " x" GuiW-19 " y" 7 " w" 6 " h" 1 " Background777777 hwndhXC1", 0 ; GUI CLOSE CENTER 01
Gui, Add, Progress, % " x" GuiW-18 " y" 8 " w" 4 " h" 1 " Background777777 hwndhXC2", 0 ; GUI CLOSE CENTER 02
Gui, Add, Progress, % " x" GuiW-18 " y" 9 " w" 4 " h" 1 " Background777777 hwndhXC3", 0 ; GUI CLOSE CENTER 03
Gui, Add, Progress, % " x" GuiW-19 " y" 10 " w" 6 " h" 1 " Background777777 hwndhXC4", 0 ; GUI CLOSE CENTER 04
Gui, Add, Progress, % " x" GuiW-20 " y" 11 " w" 3 " h" 1 " Background777777 hwndhCBL1", 0 ; GUI CLOSE BOTTOM-LEFT 01
Gui, Add, Progress, % " x" GuiW-21 " y" 12 " w" 3 " h" 1 " Background777777 hwndhCBL2", 0 ; GUI CLOSE BOTTOM-LEFT 02
Gui, Add, Progress, % " x" GuiW-20 " y" 13 " w" 1 " h" 1 " Background777777 hwndhCBL3", 0 ; GUI CLOSE BOTTOM-LEFT 03
Gui, Add, Progress, % " x" GuiW-15 " y" 11 " w" 3 " h" 1 " Background777777 hwndhCBR1", 0 ; GUI CLOSE BOTTOM-RIGHT 01
Gui, Add, Progress, % " x" GuiW-14 " y" 12 " w" 3 " h" 1 " Background777777 hwndhCBR2", 0 ; GUI CLOSE BOTTOM-RIGHT 02
Gui, Add, Progress, % " x" GuiW-13 " y" 13 " w" 1 " h" 1 " Background777777 hwndhCBR3", 0 ; GUI CLOSE BOTTOM-RIGHT 03
 
Gui, Add, Progress, % " x" 1 " y" GuiH-23 " w" GuiW-2 " h" 22 " Background0072C6 hwndhBar", 0 ; GUI STATUSBAR
 
Gui, Font, s9 c444444, Segoe UI ; SET FONT OPTIONS
	Gui, Add, Text, % " x" 37 " y" 2 " w" GuiW-96 " +Center +BackgroundTrans hwndhTitletext", Window Title ; GUI TITLE TEXT
Gui, Font ; RESET FONT OPTIONS
 
Gui, Font, s8 cFFFFFF, Segoe UI ; SET FONT OPTIONS
	Gui, Add, Text, % " x" 8 " y" GuiH-19 " w" GuiW-16 " +BackgroundTrans hwndhBarText", STATUSBAR TEXT ; GUI STATUSBAR TEXT
Gui, Font ; RESET FONT OPTIONS
 
Gui, Show, % " w" GuiW " h" GuiH, Office Style ; SHOW MAIN GUI
 
Return ; END AUTOMATIC EXECUTION
 
; LABELS =================================================================================
GuiIcon:
	Send, !{Space}
Return
 
GuiMinimize:
	WinMinimize
Return

GuiMaximize:
VarSetCapacity(rect, 16, 0)
DllCall("GetClientRect", uint, hMainWindow, uint, &rect )
if NumGet( rect, 8, "int" ) >= A_ScreenWidth - 50
	WinRestore
else
	WinMaximize
return
 
GuiClose:
GuiEscape:
	ExitApp
Return
 
GuiMove:
	PostMessage, 0xA1, 2,,, A
return
 
MenuHandler:
	MsgBox, 48, MenuHandler, Success!
Return

GuiSize:
GuiControl, Move, % hMinTrig, % "x" A_GuiWidth - 89 " y" 4 " w" 29 " h" 22
;Gui, Add, Text, % " x" GuiW-59 " y" 4 " w" 29 " h" 22 " +BackgroundTrans gGuiMinimize hwndhMinTrig" ; GUI MINIMIZE TRIGGER

GuiControl, Move, % hMaxTrig, % "x" A_GuiWidth - 59 " y" 4 " w" 29 " h" 22

GuiControl, Move, % hXTrig, % "x" A_GuiWidth - 30 " y" 4 " w" 29 " h" 22
;Gui, Add, Text, % " x" GuiW-30 " y" 4 " w" 29 " h" 22 " +BackgroundTrans gGuiClose hwndhXTrig" ; GUI CLOSE TRIGGER

GuiControl, Move, % hMoveTrig, % "x" 1 " y" 1 " w" A_GuiWidth - 2 " h" 28
;Gui, Add, Text, % " x" 1 " y" 1 " w" GuiW-2 " h" 28 " +BackgroundTrans gGuiMove hwndhMoveTrig" ; GUI MOVE TRIGGER
 
 /*
GuiControl, Move, % hBT, % "x" 0 " y" 0 " w" A_GuiWidth " h" 1
;Gui, Add, Progress, % " x" 0 " y" 0 " w" GuiW " h" 1 " Background0072C6 hwndhBT", 0 ; GUI BORDER-TOP

GuiControl, Move, % hBB, % "x" 0 " y" A_GuiHeight - 1 " w" A_GuiWidth " h" 1
;Gui, Add, Progress, % " x" 0 " y" GuiH-1 " w" GuiW " h" 1 " Background0072C6 hwndhBB", 0 ; GUI BORDER-BOTTOM

GuiControl, Move, % hBL, % "x" 0 " y" 1 " w" 1 " h" A_GuiHeight - 2
;WinMove, % "ahk_id " hBL,, 0, 1, 1, % A_GuiHeight -2
;Gui, Add, Progress, % " x" 0 " y" 1 " w" 1 " h" GuiH-2 " Background0072C6 hwndhBL", 0 ; GUI BORDER-LEFT

GuiControl, Move, % hBR, % "x" A_GuiWidth - 1 " y" 1 " w" 1 " h" A_GuiHeight - 2
;Gui, Add, Progress, % " x" GuiW-1 " y" 1 " w" 1 " h" GuiH-2 " Background0072C6 hwndhBR", 0 ; GUI BORDER-RIGHT
*/
 
GuiControl, Move, % hMin, % "x" A_GuiWidth - 80 " y" 10 " w" 9 " h" 2
;Gui, Add, Progress, % " x" GuiW-50 " y" 16 " w" 9 " h" 2 " Background777777 hwndhMin", 0 ; GUI MINIMIZE

GuiControl, Move, % hMaxT, % "x" A_GuiWidth - 50 "y" 3 "w" 11 "h" 2
;Gui, Add, Progress, % " x" GuiW-50 " y" 3 " w" 11 " h" 2 " Background777777 hwndhMaxT", 0 ; GUI MAXIMIZE TOP

GuiControl, Move, % hMaxB, % "x" A_GuiWidth - 50 "y" 11 "w" 11 "h" 2
;Gui, Add, Progress, % " x" GuiW-50 " y" 11 " w" 11 " h" 2 " Background777777 hwndhMaxB", 0 ; GUI MAXIMIZE BOTTOM

GuiControl, Move, % hMaxR, % "x" A_GuiWidth - 41 "y" 3 "w" 2 "h" 10
;Gui, Add, Progress, % " x" GuiW-41 " y" 3 " w" 2 " h" 10 " Background777777 hwndhMaxR", 0 ; GUI MAXIMIZE RIGHT

GuiControl, Move, % hMaxL, % "x" A_GuiWidth - 50 "y" 3 "w" 2 "h" 10
;Gui, Add, Progress, % " x" GuiW-50 " y" 3 " w" 2 " h" 10 " Background777777 hwndhMaxL", 0 ; GUI MAXIMIZE LEFT
 
GuiControl, Move, % hXTL1, % "x" A_GuiWidth - 20 " y" 4 " w" 1 " h" 1
;Gui, Add, Progress, % " x" GuiW-20 " y" 10 " w" 1 " h" 1 " Background777777 hwndhXTL1", 0 ; GUI CLOSE TOP-LEFT 01

GuiControl, Move, % hXTL2, % "x" A_GuiWidth - 21 " y" 5 " w" 3 " h" 1
;Gui, Add, Progress, % " x" GuiW-21 " y" 11 " w" 3 " h" 1 " Background777777 hwndhXTL2", 0 ; GUI CLOSE TOP-LEFT 02

GuiControl, Move, % hXTL3, % "x" A_GuiWidth - 20 " y" 6 " w" 3 " h" 1
;Gui, Add, Progress, % " x" GuiW-20 " y" 12 " w" 3 " h" 1 " Background777777 hwndhXTL3", 0 ; GUI CLOSE TOP-LEFT 03

GuiControl, Move, % hXTR1, % "x" A_GuiWidth - 13 " y" 4 " w" 1 " h" 1
;Gui, Add, Progress, % " x" GuiW-13 " y" 10 " w" 1 " h" 1 " Background777777 hwndhXTR1", 0 ; GUI CLOSE TOP-RIGHT 01

GuiControl, Move, % hXTR2, % "x" A_GuiWidth - 14 " y" 5 " w" 3 " h" 1
;Gui, Add, Progress, % " x" GuiW-14 " y" 11 " w" 3 " h" 1 " Background777777 hwndhXTR2", 0 ; GUI CLOSE TOP-RIGHT 02

GuiControl, Move, % hXTR3, % "x" A_GuiWidth - 15 "y" 6 "w" 3 "h" 1
;Gui, Add, Progress, % " x" GuiW-15 " y" 12 " w" 3 " h" 1 " Background777777 hwndhXTR3", 0 ; GUI CLOSE TOP-RIGHT 03

GuiControl, Move, % hXC1, % "x" A_GuiWidth - 19 " y" 7 " w" 6 " h" 1
;Gui, Add, Progress, % " x" GuiW-19 " y" 13 " w" 6 " h" 1 " Background777777 hwndhXC1", 0 ; GUI CLOSE CENTER 01

GuiControl, Move, % hXC2, % "x" A_GuiWidth - 18 " y" 8 " w" 4 " h" 1
;Gui, Add, Progress, % " x" GuiW-18 " y" 14 " w" 4 " h" 1 " Background777777 hwndhXC2", 0 ; GUI CLOSE CENTER 02

GuiControl, Move, % hXC3, % "x" A_GuiWidth - 18 " y" 9 " w" 4 " h" 1
;Gui, Add, Progress, % " x" GuiW-18 " y" 15 " w" 4 " h" 1 " Background777777 hwndhXC3", 0 ; GUI CLOSE CENTER 03

GuiControl, Move, % hXC4, % "x" A_GuiWidth - 19 " y" 10 " w" 6 " h" 1
;Gui, Add, Progress, % " x" GuiW-19 " y" 16 " w" 6 " h" 1 " Background777777 hwndhXC4", 0 ; GUI CLOSE CENTER 04

GuiControl, Move, % hCBL1, % "x" A_GuiWidth - 20 " y" 11 " w" 3 " h" 1
;Gui, Add, Progress, % " x" GuiW-20 " y" 17 " w" 3 " h" 1 " Background777777 hwndhCBL1", 0 ; GUI CLOSE BOTTOM-LEFT 01

GuiControl, Move, % hCBL2, % "x" A_GuiWidth - 21 " y" 12 " w" 3 " h" 1
;Gui, Add, Progress, % " x" GuiW-21 " y" 18 " w" 3 " h" 1 " Background777777 hwndhCBL2", 0 ; GUI CLOSE BOTTOM-LEFT 02

GuiControl, Move, % hCBL3, % "x" A_GuiWidth - 20 " y" 13 " w" 1 " h" 1
;Gui, Add, Progress, % " x" GuiW-20 " y" 19 " w" 1 " h" 1 " Background777777 hwndhCBL3", 0 ; GUI CLOSE BOTTOM-LEFT 03

GuiControl, Move, % hCBR1, % "x" A_GuiWidth - 15 " y" 11 " w" 3 " h" 1
;Gui, Add, Progress, % " x" GuiW-15 " y" 17 " w" 3 " h" 1 " Background777777 hwndhCBR1", 0 ; GUI CLOSE BOTTOM-RIGHT 01

GuiControl, Move, % hCBR2, % "x" A_GuiWidth - 14 " y" 12 " w" 3 " h" 1
;Gui, Add, Progress, % " x" GuiW-14 " y" 18 " w" 3 " h" 1 " Background777777 hwndhCBR2", 0 ; GUI CLOSE BOTTOM-RIGHT 02

GuiControl, Move, % hCBR3, % "x" A_GuiWidth - 13 " y" 13 " w" 1 " h" 1
;Gui, Add, Progress, % " x" GuiW-13 " y" 19 " w" 1 " h" 1 " Background777777 hwndhCBR3", 0 ; GUI CLOSE BOTTOM-RIGHT 03
 
GuiControl, Move, % hBar, % "x" 1 " y" A_GuiHeight - 23 " w" A_GuiWidth - 2 " h" 22
;Gui, Add, Progress, % " x" 1 " y" GuiH-23 " w" GuiW-2 " h" 22 " Background0072C6 hwndhBar", 0 ; GUI STATUSBAR
 
GuiControl, Move, % hTitletext, % "x" 37 " y" 2 " w" A_GuiWidth - 96
;Gui, Add, Text, % " x" 37 " y" 8 " w" GuiW-96 " +Center +BackgroundTrans hwndhTitletext", Window Title ; GUI TITLE TEXT
 
GuiControl, Move, % hBarText, % "x" 8 " y" A_GuiHeight - 19 " w" A_GuiWidth - 16
;Gui, Add, Text, % " x" 8 " y" GuiH-19 " w" GuiW-16 " +BackgroundTrans hwndhBarText", STATUSBAR TEXT ; GUI STATUSBAR TEXT
WinSet, Redraw
return
AutoHotkey & AutoHotkey_H v1.1.22.07
immorrr
Posts: 7
Joined: 07 Sep 2014, 21:23

Re: Examples of Non-Standard GUIs (ActiveX, GDI, etc.)

14 Nov 2015, 05:21


This is the interface for a game trainer/editor/hack/whatever...
Something i am working on for quite some time now.

... the code is super messy :(
User avatar
TheDewd
Posts: 1503
Joined: 19 Dec 2013, 11:16
Location: USA

Re: Examples of Non-Standard GUIs (ActiveX, GDI, etc.)

16 Nov 2015, 15:16

I've made another attempt at creating a "Non-Standard" GUI. This example uses image files, so you'll need to download the attached ZIP file to run the script properly.

Includes a menu, StatusBar, etc.

The code could be optimized better, but for now it seems to be a working example. Let me know what you think, or if you have any suggestions for improving it.

Download:
CustomMenu&PageDisplay.zip
CustomMenu&PageDisplay.ahk, divider-horz.png, menu-hover.png, menu-select.png, sb-background.png, sb-icon.png
(4.75 KiB) Downloaded 523 times
Screenshot:
Screenshot.png
Last edited by TheDewd on 15 Jan 2016, 16:54, edited 4 times in total.
User avatar
TheDewd
Posts: 1503
Joined: 19 Dec 2013, 11:16
Location: USA

Re: Examples of Non-Standard GUIs (ActiveX, GDI, etc.)

15 Jan 2016, 16:57

I have attempted to create a UI similar to the one from my last post in this thread. I'm using less code this time, and there are no external images required.

This Gui is a work in progress. In case you're curious, the design is a reproduction of the PeaZip options screen, with some occasional modifications. If you think you know a better way to code any part of my script, please let me know. I've already went through several revisions of the code to make it respond better to user interaction and make the code less complex, but I'm still willing to hear suggestions for improvement. Thanks!
Screenshot.png
Screenshot.png (4.41 KiB) Viewed 9972 times

Code: Select all

; Globals ======================================================================
#SingleInstance, Force ; Replace with new instance if script is running
#Persistent ; Keep script permanently running until terminated
#NoEnv ; Prevent identifying empty variables as potential environment variables
#Warn ; Enable warnings to assist with detecting errors
;#NoTrayIcon ; Disable the tray icon of the script
SendMode, Input ; Method for sending keystrokes and mouse clicks
SetWorkingDir, %A_ScriptDir% ; The current working directory of the script

Application := {Name: "Menu Interface", Version: "0.1"}
Window := {Width: 600, Height: 400, Title: Application.Name}
Navigation := {Label: ["General", "Advanced", "Language", "Theme", "---", "Help", "About"]}
; ==============================================================================

; Auto-Execute =================================================================
Menu, Tray, Icon, Shell32.dll, 174
Menu, Tray, Tip, % Application.Name
Menu, Tray, NoStandard
Menu, Tray, Add, Exit, ExitSub

Gui, +LastFound -Resize +HwndhGui1
Gui, Color, FFFFFF

Gui, Add, Tab2, % " x" -999999 " y" -999999 " w" 0 " h" 0 " -Wrap +Theme vTabControl", % ""

Gui, Tab ; Exclude future controls from any tab control

Gui, Add, Picture, % "x" -999999 " y" -999999 " w" 4 " h" 32 " vpMenuHover +0x4E +HWNDhMenuHover",
Gui, Add, Picture, % "x" 0 " y" 18 " w" 4 " h" 32 " vpMenuSelect +0x4E +HWNDhMenuSelect",

Gui, Font, s9 c808080, Segoe UI ; Set Font Options
Loop, % Navigation.Label.Length() {
	GuiControl,, TabControl, % Navigation.Label[A_Index] "|"
	If (Navigation.Label[A_Index] = "---") {
		Continue
	}
	Gui, Add, Text, % "x" 18 " y" (32*A_Index)-14 " h" 32 " +0x200 gMenuClick vMenuItem" . A_Index, % Navigation.Label[A_Index]
}
Gui, Font ; Reset font options

Gui, Font, s11 c000000, Segoe UI ; Set Font Options
Gui, Add, Text, % "x" 192 " y" 18 " w" (Window.Width-192)-14 " h" 32 " +0x200 vPageTitle", % ""
Gui, Font ; Reset font options

Gui, Add, Picture, % "x" 192 " y" 50 " w" (Window.Width-192)-14 " h" 1 " +0x4E +HWNDhDividerLine",

Gui, Add, Button, % "x" (Window.Width-170)-10 " y" (Window.Height-24)-10 " w" 80 " h" 24 " vButtonOK", % "OK"
Gui, Add, Button, % "x" (Window.Width-80)-10 " y" (Window.Height-24)-10 " w" 80 " h" 24 " vButtonCancel", % "Cancel"

Gui, Tab, 1 ; Future controls are owned by the specified tab
Gui, Add, Checkbox, % "x" 192 " y" 66 " w" (Window.Width-192)-14, % "Checkbox Example"

Gui, Tab, 2 ; Future controls are owned by the specified tab
Gui, Add, ListView, % "x" 192 " y" 66 " w" (Window.Width-192)-14, % "Col1|Col2"
LV_Add("", "ListView", "Example")
LV_ModifyCol()

Gui, Tab, 3 ; Future controls are owned by the specified tab
Gui, Add, MonthCal, % "x" 192 " y" 66

Gui, Tab, 4 ; Future controls are owned by the specified tab
Gui, Add, DateTime, % "x" 192 " y" 66, LongDate

Gui, Tab, 5 ; Future controls are owned by the specified tab
; Skipped

Gui, Tab, 6 ; Future controls are owned by the specified tab
Gui, Add, GroupBox, % "x" 192 " y" 66 " w" (Window.Width-192)-14, % "GroupBox"

Gui, Tab, 7 ; Future controls are owned by the specified tab
Gui, Add, DateTime, % "x" 192 " y" 66, LongDate

Gui, Show, % " w" Window.Width " h" Window.Height, % Window.Title

GoSub, OnLoad
return ; End automatic execution
; ==============================================================================

; Labels =======================================================================
OnLoad:
	SetPixelColor("CCEEFF", hMenuHover)
	SetPixelColor("3399FF", hMenuSelect)
	SetPixelColor("D8D8D8", hDividerLine)
	SelectMenu("MenuItem1")
	OnMessage(0x200, "WM_MOUSEMOVE")
return

MenuClick:
	SelectMenu(A_GuiControl)
return

GuiEscape:
GuiClose:
ButtonOK:
ButtonCancel:
ExitSub:
	ExitApp ; Terminate the script unconditionally
return
; ==============================================================================

; Functions ====================================================================
SelectMenu(Control) {
	Global

	CurrentMenu := Control

	Loop, % Navigation.Label.Length() {
		SetControlColor("808080", Navigation.Label[A_Index])
	}

	SetControlColor("000000", Control)
	GuiControl, Move, pMenuSelect, % "x" 0 " y" (32*SubStr(Control, 9, 2))-14 " w" 4 " h" 32
	GuiControl, Choose, TabControl, % SubStr(Control, 9, 2)
	GuiControl,, PageTitle, % Navigation.Label[SubStr(Control, 9, 2)]
}

WM_MOUSEMOVE(wParam, lParam, Msg, Hwnd) {
	Global

	If (InStr(A_GuiControl, "MenuItem") = true && A_GuiControl != CurrentMenu) {
		GuiControl, Move, pMenuHover, % "x" 0 " y" (32*SubStr(A_GuiControl, 9, 2))-14 " w" 4 " h" 32
	} Else If (InStr(A_GuiControl, "MenuItem") = false || A_GuiControl = CurrentMenu) {
		GuiControl, Move, pMenuHover, % "x" -999999 " y" -999999 " w" 4 " h" 32
	}
}

SetControlColor(Color, Control) {
	Global

	GuiControl, % "+c" Color, % Control

	; Required due to redrawing issue with Tab2 control
	GuiControlGet, ControlText,, % Control
	GuiControlGet, ControlHandle, Hwnd, % Control
	DllCall("SetWindowText", "Ptr", ControlHandle, "Str", ControlText)
}

SetPixelColor(Color, Handle) {
	VarSetCapacity(BMBITS, 4, 0), Numput("0x" . Color, &BMBITS, 0, "UInt")
	hBM := DllCall("Gdi32.dll\CreateBitmap", Int, 1, Int, 1, UInt, 1, UInt, 24, Ptr, 0)
	hBM := DllCall("User32.dll\CopyImage", Ptr, hBM, UInt, 0, Int, 0, Int, 0, UInt, 0x2008)
	DllCall("Gdi32.dll\SetBitmapBits", Ptr, hBM, UInt, 3, Ptr, &BMBITS)
	return DllCall("User32.dll\SendMessage", Ptr, Handle, UInt, 0x172, Ptr, 0, Ptr, hBM)
}
; ==============================================================================
Last edited by TheDewd on 18 Jan 2016, 22:17, edited 1 time in total.
lexikos
Posts: 9494
Joined: 30 Sep 2013, 04:07
Contact:

Re: Examples of Non-Standard GUIs (ActiveX, GDI, etc.)

15 Jan 2016, 21:48

TheDewd wrote:In case you're curious, the design is a reproduction of the PeaZip options screen, with some occasional modifications.
Do you mean the style is based on PeaZip, or the actual settings/controls? It looks remarkably similar to Chrome's settings page.
User avatar
TheDewd
Posts: 1503
Joined: 19 Dec 2013, 11:16
Location: USA

Re: Examples of Non-Standard GUIs (ActiveX, GDI, etc.)

15 Jan 2016, 21:57

My earlier version is more based on a combination of PeaZip's main interface and options window, borrowing elements from both... My recent iteration does look very similar to Chrome's settings page. I haven't used Chrome in a very long time so I didn't realize the similarities. :-)
PeaZip Options Screenshot.png
User avatar
joedf
Posts: 8937
Joined: 29 Sep 2013, 17:08
Location: Canada
Contact:

Re: Examples of Non-Standard GUIs (ActiveX, GDI, etc.)

15 Jan 2016, 22:41

combine it with this one, and it will be a full-blown win8-themed look-a-like :D
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]

Return to “Scripts and Functions (v1)”

Who is online

Users browsing this forum: Rohwedder and 78 guests