AutoHotkey Community

It is currently May 26th, 2012, 10:39 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 111 posts ]  Go to page Previous  1 ... 3, 4, 5, 6, 7, 8  Next
Author Message
 Post subject:
PostPosted: August 15th, 2008, 11:23 am 
Offline

Joined: April 19th, 2005, 10:26 am
Posts: 2249
Location: switzerland
sorry Phischi, I didn't tried the program, you're waiting yet for answer ....


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 23rd, 2008, 3:28 am 
Offline

Joined: August 1st, 2008, 6:23 pm
Posts: 4
These graphical buttons look great in the demo, but when I tried to do a 16x16 icon it couldn't seem to leave it alone and insists on resizing it to not fit in button.

Finally, using an icon editor, I copied my 16x16 icon image into a 32x32 icon leaving tons of empty space around it. I saved the icon and added it to my compiled ahk script with Resource Hacker.

It now looks the way I expect it to except the dotted line square inside the button when it has focus.

How can I change the icons in a compiled autohotkey script from the command line so I don't have to click around in Resource hacker after every time I recompile a script?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 23rd, 2008, 8:55 pm 
Offline
User avatar

Joined: December 29th, 2004, 1:28 pm
Posts: 2542
ManualLukeWarmkey wrote:
How can I change the icons in a compiled autohotkey script from the command line so I don't have to click around in Resource hacker after every time I recompile a script?
I currently add the images to the dll file (in the first post) instead of messing around with adding/changing resources in a compiled script each time a script is compiled/updated. The dll also includes the function(s) necessary for loading the image(s).


Last edited by corrupt on November 23rd, 2008, 9:48 pm, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 23rd, 2008, 9:30 pm 
Offline
User avatar

Joined: December 29th, 2004, 1:28 pm
Posts: 2542
Phischi wrote:
This button should not have any text in it, but Icon 166 from SYSTEM32.DLL
That could be difficult since SYSTEM32.DLL doesn't typically exist... ;)

Does this example help? If not, please try to clarify. Sorry for the delayed response (if you're still around to read this...).

Image

Code:
; ********************************
; Demo Script
; ********************************

; Load an icon instead for SampleButton2
AGB_LoadIconDll(sb1, "shell32.dll", 166)

; Create the buttons
AddGraphicButton("SampleButton1", sb1, "h36 w36 gMyButton")

; Show the window
Gui, Show, , Bitmap Buttons

; Image rollover for SampleButton1
 OnMessage(0x200, "MouseMove")
 OnMessage(0x2A3, "MouseLeave")
 OnMessage(0x202, "MouseLeave") ; Restore image on LBUTTONUP
Return

MouseLeave(wParam, lParam, msg, hwnd)
{
  Global
;   If (hwnd = SampleButton1_hwnd)
;     Do something
  Return
}
MouseMove(wParam, lParam, msg, hwnd)
{
  Global
  Static _LastButtonData1 = true

;  If (hwnd = SampleButton1_hwnd)
;    If (_LastButtonData1 != SampleButton1_hwnd)
      ; do something
;   _LastButtonData1 := hwnd

  Return
}

MyButton:
MsgBox, Graphic button clicked :)
return

GuiClose:
ExitApp


; from the library file AGB.ahk (included in the zip file in the download)

; *******************************************************************
; Preload icons from a dll for use with the AddGraphicButton() function
; Version: 2.21 Updated: June 22, 2008
; by corrupt
; *******************************************************************
; VariableName = variable name for the loaded image resource
; dllfile = Path to the dll file that contains the image(s)
; nindex = the index of the icon to load
; *******************************************************************
AGB_LoadIconDll(ByRef VariableName, dllfile, nindex) {
Global
Local spid
spid := DllCall("GetCurrentProcessId")
If (%VariableName%_img != "")
  DllCall("DeleteObject", "UInt", %VariableName%_img)
VariableName := "1." . DllCall("shell32.dll\ExtractIconA", "UInt", spid, "Str", dllfile, "UInt", nindex)
Return ErrorLevel
}


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 1st, 2009, 6:57 pm 
Offline

Joined: May 15th, 2009, 7:02 pm
Posts: 4
I'm a little confused. I have downloaded/copied corrupt's scripts and everytime it gives me this error. I'm still kinda new at this so any help would be appreciated.

Error at line 30.

Line Text: =
Error: this variable of function name contains an illegal character.

The program will exit.


This is line 30:
Static _LastButtonData1 = true


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 20th, 2009, 2:03 pm 
Offline
User avatar

Joined: December 29th, 2004, 1:28 pm
Posts: 2542
JASON031 wrote:
I'm a little confused. I have downloaded/copied corrupt's scripts and everytime it gives me this error. I'm still kinda new at this so any help would be appreciated.

Error at line 30.

Line Text: =
Error: this variable of function name contains an illegal character.

The program will exit.


This is line 30:
Static _LastButtonData1 = true
Which version of AutoHotkey and version of Windows are you running?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 20th, 2009, 8:49 pm 
Offline

Joined: May 15th, 2009, 7:02 pm
Posts: 4
AutoHotKey Version 1.0.37.04

Microsoft Windows XP Professional 2002 Service Pack 2


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 26th, 2009, 5:12 am 
Offline
User avatar

Joined: December 29th, 2004, 1:28 pm
Posts: 2542
JASON031, Could you please provide a bit more detail? I'm not currently able to reproduce this error, however, I have not attempted to install AutoHotKey Version 1.0.37.04 and XP SP2. Do you still have this issue if you update to the latest version of AutoHotkey? Are you trying to use the test script(s) "as is" or have you changed the function and/or file names? Have you copied the script from the forum using the "Copy" function in the code box? If so, then do you get the same results if you highlight the text, then copy and paste instead?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 5th, 2010, 6:33 pm 
Quote:
added support for image types: .bmp, .gif, .jpg, .wmf, .emf, .ico when loaded from a custom dll file


also png files from dll?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: January 5th, 2010, 7:01 pm 
i laoded the newest arhive but he gives me in each script errors. whatz up?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: January 15th, 2010, 9:31 am 
Offline

Joined: April 19th, 2005, 10:26 am
Posts: 2249
Location: switzerland
added just an example from denick
Code:
;-------- saved at Freitag, 15. Januar 2010 08:55:21 ----------------
;-------- http://de.autohotkey.com/forum/topic6105-15.html denick ---
;-------- http://www.autohotkey.com/forum/topic4047.html  ---
;-------- TAG= COLOR BUTTONS GRAPHIC ------------------------
;-------- DATE=20100115 -------------------------------------
#NoEnv
SetWorkingDir, %A_ScriptDir%
NAME=Test

PB1C := "Red"        ; Backgroundcolor "Button1"
PB2C := "Lime"       ; Backgroundcolor "Button2"
;PB3C := "Black"      ; Backgroundcolor "Button3"   ; example with picture

TX1C := "Yellow"     ; TextColor "Button1"
Tx2C := "000040"     ; TextColor "Button2"
Tx3C := "White"      ; TextColor "Button3"

;Gui, 2:-Theme
Gui, 2:Margin, 10, 10

Gui, 2:Add, Progress, x10 y10 h25 w90 Disabled vPB1 +E0x1 Background%PB1C%
Gui, 2:Add, Text, xp yp wp hp c%TX1C% BackgroundTrans Center 0x200 vTX1 gPrinter1, ----Printer----

Gui, 2:Add, Progress, x110 y10 h25 w90 Disabled vPB2 +E0x1 Background%PB2C%
Gui, 2:Add, Text, xp yp wp hp c%TX2C% BackgroundTrans Center 0x200 vTX2 gSNDVOL,VOLUME

;----- this 3rd example needs a small red picture or just a picture-----------
Gui,2:Add,Picture,x210 y10  h25 w90 gCALC,red.bmp
;Gui,2:Add,text,cWhite BackgroundTrans x240 y15 h25 w90 ,CALC
Gui, 2:Add, Text, xp yp wp hp c%TX3C% BackgroundTrans Center 0x200 ,CALC

Gui, 2:Show, x200 y0, %NAME%
Return

2Guiclose:
ExitApp

PRINTER1:
 run,shell:PrintersFolder
Return

SNDVOL:
 run,sndvol32
Return

CALC:
 run,calc
return


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 3rd, 2010, 7:15 pm 
Offline

Joined: August 14th, 2007, 12:11 pm
Posts: 86
is it possible to use an image storred in memory from skan's AxC_UnPackToMem??


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 10th, 2010, 8:16 am 
Offline

Joined: November 11th, 2005, 3:13 am
Posts: 202
thanks to corrupt for this wonderful script. the buttons are now more easy on the eyes..

i'm not sure if this script being actively updated but i'd like to know if it's possible to show a tooltip when the mouse hovers over the graphic buttons?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 11th, 2010, 8:17 pm 
Offline
User avatar

Joined: December 29th, 2004, 1:28 pm
Posts: 2542
badmojo wrote:
thanks to corrupt for this wonderful script. the buttons are now more easy on the eyes..

i'm not sure if this script being actively updated but i'd like to know if it's possible to show a tooltip when the mouse hovers over the graphic buttons?
Thanks :) . I haven't been around or updated many scripts lately... It's possible to show tooltips with the current code. Here's an example:
Code:
; ********************************
; Demo Script
; ********************************

; Load an icon instead for SampleButton2
AGB_LoadIconDll(sb1, "shell32.dll", 166)

; Create the buttons
AddGraphicButton("SampleButton1", sb1, "h36 w36 gMyButton")

; Show the window
Gui, Show, , Bitmap Buttons

; Image rollover for SampleButton1
 OnMessage(0x200, "MouseMove")
 OnMessage(0x2A3, "MouseLeave")
 OnMessage(0x202, "MouseLeave") ; Restore image on LBUTTONUP
Return

MouseLeave(wParam, lParam, msg, hwnd)
{
  Global
  If (hwnd = SampleButton1_hwnd)
    ToolTip
  Return
}
MouseMove(wParam, lParam, msg, hwnd)
{
  Global
  Static _LastButtonData1 = true

  If (hwnd = SampleButton1_hwnd)
    If (_LastButtonData1 != SampleButton1_hwnd)
      ToolTip, Timed ToolTip`nThis will be displayed for 5 seconds.
      SetTimer, RemoveToolTip, 5000
  _LastButtonData1 := hwnd

  Return
}

MyButton:
MsgBox, Graphic button clicked :)
return

RemoveToolTip:
SetTimer, RemoveToolTip, Off
ToolTip
return

GuiClose:
ExitApp


; from the library file AGB.ahk (included in the zip file in the download)

; *******************************************************************
; Preload icons from a dll for use with the AddGraphicButton() function
; Version: 2.21 Updated: June 22, 2008
; by corrupt
; *******************************************************************
; VariableName = variable name for the loaded image resource
; dllfile = Path to the dll file that contains the image(s)
; nindex = the index of the icon to load
; *******************************************************************
AGB_LoadIconDll(ByRef VariableName, dllfile, nindex) {
Global
Local spid
spid := DllCall("GetCurrentProcessId")
If (%VariableName%_img != "")
  DllCall("DeleteObject", "UInt", %VariableName%_img)
VariableName := "1." . DllCall("shell32.dll\ExtractIconA", "UInt", spid, "Str", dllfile, "UInt", nindex)
Return ErrorLevel
}


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 11th, 2010, 8:18 pm 
Offline
User avatar

Joined: December 29th, 2004, 1:28 pm
Posts: 2542
WankaUSR wrote:
is it possible to use an image storred in memory from skan's AxC_UnPackToMem??
I'm not too familiar with AxC_UnPackToMem but I'll have a look.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 111 posts ]  Go to page Previous  1 ... 3, 4, 5, 6, 7, 8  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: Google [Bot], Stigg, toddintr and 8 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group