AutoHotkey Community

It is currently May 27th, 2012, 6:31 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 32 posts ]  Go to page Previous  1, 2, 3  Next
Author Message
 Post subject:
PostPosted: May 25th, 2008, 5:55 pm 
Offline
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8776
ladiko wrote:
could i use your work


yes, please. :)

@daonlyfreez: Lexikos has already shown me on how to use the Res protocol here:


My problem is different.. I have to use AddFontMemResourceEx to load a font from resource, which loads as a private font and not visible to any application including AHK. All I have is the hIcon of the font and the only way it seems - is to use WM_SETFONT on AHK control.

:roll:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 25th, 2008, 6:42 pm 
SKAN wrote:
You have already shown how to refer images from HTML .. but how to use an embedded font .. i.e., use it from HTML ?

I did not try, but my best guess is that WM_SETFONT would not work on an IE control.


You can only use the existing (installed) fonts on the computer with the html/css settings of the file you are showing.

However, if you use the css @font-face tag pointing to an eot (font) file, and show the html in Internet Explorer (or the control), you can use font-files that need not be installed on the client's computer. The url value accepts http and file, so maybe it works with res too, if you add the eot file as a resource?

Quote:
<STYLE TYPE="text/css">
<--!
@font-face {
font-family: SomeFontName;
font-style: normal;
font-weight: normal;
src:url(http://www.somesite.com/somefont.eot);
}
-->
</STYLE>


Hope this makes it more clear what I meant to point out... :P


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: May 25th, 2008, 8:17 pm 
Offline
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8776
n-l-i-d wrote:
Hope this makes it more clear what I meant to point out... :P


I do not understand much .. but nice to hear that it would work..
Thanks friend. :)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 25th, 2008, 8:25 pm 
Allrighty, then here it is: Spice up your AutoHotkey GUI with custom fonts in an IE-control.

Use stylish, weird, or specific language fonts like you see fit!

1. Download WEFT (freeware) and install
2. Find yourself some nice (free to use and distribute) font(s), download and install
3. Create a page in Microsoft Office Word in which you use the fonts you intend to use in your project (not everything you want to publish, just some words with the fonts used, the file will be destroyed anyway)
4. Save this page as html (Save As... -> Web page)
5. Run WEFT and follow the instructions, N.B.:
* You should Cancel the "Intended Web Server" dialog
* WEFT has restriction options, make sure you set them correctly.
6. The resulting EOT (Embedded OpenType) font file(s) can now be incorporated into your IE-control!

7. Create an AHK Gui with an IE-COM control.

8. Create html with the following css code in the head of the document

Quote:
<STYLE TYPE="text/css">
<--!
@font-face {
font-family: SomeFontName;
font-style: normal;
font-weight: normal;
src:url(file://fullandforwardslashedpathtoyours ... mefont.eot);
}
-->
</STYLE>


(The IE control probably needs the full path)

9. Now you can use SomeFontName like any font in the css definitions of the rest of your html and show the final html with your custom font in the IE control

10. You can deinstall the fonts again

From here: Hosting Web Pages in Hindi using embedded fonts with WEFT (with screenshots)

Online examples

User ofcourse needs Internet Explorer to be installed (does not work on other browsers).

I myself cannot test this right now, but it should work, and it is a very nice GUI addition.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: May 25th, 2008, 8:31 pm 
Offline
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8776
:shock:

Very Nice .. Many thanks :D


Report this post
Top
 Profile  
Reply with quote  
 Post subject: DllCreateEmpty()
PostPosted: September 5th, 2010, 4:43 am 
Offline
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8776
    DllCreateEmpty()
  • Shorter and Faster than CreateDLL() used in ROD-Ex owing to the 'Apply Patch' technique used.
  • Supports Unicode filename ( use fullpath prefixed with "\\?\" )
  • Places a Creation TimeDateStamp inside DLL
  • Created DLL is more Compact - only 1024 bytes


Code:
DllCreateEmpty( F="empty.dll" ) { ; www.autohotkey.com/forum/viewtopic.php?p=381161#381161
;Creates Empty Resource-Only DLL (1024 bytes)  / CD:05-Sep-2010 | LM:01-Jun-2011 - by SKAN
 IfNotEqual,A_Tab, % TS:=A_NowUTC, EnvSub,TS,1970,S 
 Src := "0X5A4DY3CXC0YC0X4550YC4X1014CYD4X210E00E0YD8XA07010BYE0X200YECX1000YF0X1000YF4X1"
 . "0000YF8X1000YFCX200Y100X4Y108X4Y110X2000Y114X200Y11CX4000003Y120X40000Y124X1000Y128X1"
 . "00000Y12CX1000Y134X10Y148X1000Y14CX10Y1B8X7273722EY1BCX63Y1C0X10Y1C4X1000Y1C8X200Y1CC"
 . "X200Y1DCX40000040"
, VarSetCapacity( Trg,1024,0 ), Numput( TS,Trg,200 ), DA:=0x40000000
 Loop, Parse, Src, XY                                                           
   Mod( A_Index,2 ) ? O := "0x" A_LoopField : NumPut( "0x" A_LoopField, Trg, O )
 If ( hF := DllCall( "CreateFile", Str,F, UInt,DA, UInt,2,Int,0,UInt,2,Int,0,Int,0 ) ) > 0
   B := DllCall( "_lwrite", UInt,hF,Str,Trg,UInt,1024 ),  DllCall( "CloseHandle",UInt,hF )
 Loop %F%
Return B ? A_LoopFileLongPath :
}


Quote:
Note to self:
Exercise #3
Unlike Exercise #2 where AStr is used to force ANSI filename, this function uses CreateFile() to support unicode filename.
Handles obtained with CreateFile() & OpenFile() are not compatible with _lclose().. and so CloseHandle() is being used here.
But _lwrite(), _llseek() and _lread() works properly with any file handle and are shorter/easier to use.



Last edited by SKAN on June 1st, 2011, 2:38 pm, edited 3 times in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 16th, 2010, 12:11 pm 
Offline

Joined: September 10th, 2009, 5:54 pm
Posts: 203
Skan,

I came across a lot of your scripts not working on the new version of Ahk_L

I'm I wrong?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 16th, 2010, 12:23 pm 
Offline
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8776
[size=117]Gauss[/size] wrote:
lot of your scripts not working on the new version of Ahk_L


Could be.. I will re-write them as and when the demand rises. :)


Report this post
Top
 Profile  
Reply with quote  
 Post subject: CreateDLLv2()
PostPosted: March 18th, 2011, 4:11 pm 
Offline
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8776
CreateDLLv2() has been written to replace CreateDLL() in ROD-Ex to avoid AntiVirus false alarms.
For example, you may refer VirusTotal scan results for res.dll bundled with Popcorn Movie Db [v3.1.0].
I will update ROD-Ex with CreateDLLv2() when I make it AHK_L compatible.

Thanks to paulmeister for reporting it.

Code:
CreateDLLv2( F="empty.dll" ) { ;    www.autohotkey.com/forum/viewtopic.php?p=429997#429997
;Creates Empty Resource-Only DLL (1024 bytes)  / CD:05-Sep-2010 | LM:18-Mar-2011 - by SKAN
 IfNotEqual,A_Tab, % TS:=A_NowUTC, EnvSub,TS,1970,S   
 Src := "0X5A4DY3CXB8YB8X4550YBCX2014CYCCX210E00E0YD0XC05010BYD8X6600YE4X1000YE8X1000YECX"
 . "5F990000YF0X1000YF4X200YF8X5YFCX5Y100X4Y108X9000Y10CX200Y114X2Y118X40000Y11CX1000Y120"
 . "X100000Y124X1000Y12CX10Y140X1000Y144X1E4Y158X8000Y15CX8Y1B0X7273722EY1B4X63Y1B8X6340Y"
 . "1BCX1000Y1C0X6400Y1C4X200Y1D4X40000040Y1D8X6C65722EY1DCX636FY1E0XCY1E4X8000Y1E8X200Y1"
 . "ECX6600Y1FCX42000040Y208X4Y20CX10000Y210X10Y214X80000018Y220X4Y224X10000Y228X1Y22CX80"
 . "000030Y238X4Y23CX10000Y240X409Y244X48Y248X1058Y24CX18CY250X4E4Y258X34018CY25CX560000Y"
 . "260X5F0053Y264X450056Y268X530052Y26CX4F0049Y270X5F004EY274X4E0049Y278X4F0046Y27CX3400"
 . "00Y280XFEEF04BDY284X10000Y288X20000Y290X10000Y298X3FY2A0X4Y2A4X2Y2B4XECY2B8X530000Y2B"
 . "CX720074Y2C0X6E0069Y2C4X460067Y2C8X6C0069Y2CCX490065Y2D0X66006EY2D4X6FY2D8XC8Y2DCX300"
 . "000Y2E0X300034Y2E4X300039Y2E8X420034Y2ECX30Y2F0X24004CY2F4X460001Y2F8X6C0069Y2FCX4400"
 . "65Y300X730065Y304X720063Y308X700069Y30CX690074Y310X6E006FY318X650052Y31CX6F0073Y320X7"
 . "20075Y324X650063Y328X4F002DY32CX6C006EY330X200079Y334X4C0044Y338X4CY33CXE0030Y340X460"
 . "001Y344X6C0069Y348X560065Y34CX720065Y350X690073Y354X6E006FY35CX4F0052Y360X200044Y364X"
 . "320076Y36CX100034Y370X500001Y374X6F0072Y378X750064Y37CX740063Y380X650056Y384X730072Y3"
 . "88X6F0069Y38CX6EY390X2E0031Y394X2E0030Y398X2E0030Y39CX30Y3A0X44Y3A4X560000Y3A8X720061"
 . "Y3ACX690046Y3B0X65006CY3B4X6E0049Y3B8X6F0066Y3C0X40024Y3C4X540000Y3C8X610072Y3CCX7300"
 . "6EY3D0X61006CY3D4X690074Y3D8X6E006FY3E0X4B00409"

 VarSetCapacity(Trg,1024,0),  Numput(TS,Trg,192),  AC := 0x40000000
 Loop, Parse, Src, XY
   Mod( A_Index,2 ) ? O := "0x" A_LoopField : NumPut( "0x" A_LoopField, Trg, O )
 If ( hF := DllCall( "CreateFile", Str,F, UInt,AC,UInt,2,Int,0,UInt,2,Int,0,Int,0 ) ) > 0
   B := DllCall( "_lwrite", UInt,hF,Str,Trg,UInt,1024 ),  DllCall( "CloseHandle",UInt,hF )
Return B ? F :
}


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 18th, 2011, 10:53 pm 
great!
i will update Popcorn Movie DB when i have some time to work on the script again :D


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: August 10th, 2011, 1:40 pm 
Offline
User avatar

Joined: January 25th, 2006, 8:08 am
Posts: 225
Location: Froschtümpel
Any news on AHK_L compatibility?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 23rd, 2011, 8:56 am 
Offline

Joined: April 14th, 2011, 2:21 am
Posts: 30
Hi SKAN,
I tried you script (with version 2 dll create), and it created the resource.dll file, but I can't load the image. Could you check it for me?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 24th, 2011, 7:25 am 
Offline
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8776
zeus19 wrote:
Could you check it for me?


What exactly does not work?
Can you please give me a sample DLL that is not working?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 25th, 2011, 2:42 pm 
Offline

Joined: April 14th, 2011, 2:21 am
Posts: 30
SKAN wrote:
zeus19 wrote:
Could you check it for me?


What exactly does not work?
Can you please give me a sample DLL that is not working?


here the dll file, please help! I try to pack the icon files in the dll, and hope that i can convert them all to the exe file without any extended files.
DLL file:http://www.mediafire.com/?p2acj8481i8g6k2

here the folder include your scripts, and my ico file.
http://www.mediafire.com/?mo5e959c9cdry3e


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 21st, 2012, 2:21 pm 
Offline

Joined: April 8th, 2009, 7:49 pm
Posts: 6073
Location: San Diego, California
Hi SKAN,
I came to this thread from your post in this thread
Have a hard time understanding load images from dll
http://www.autohotkey.com/forum/viewtop ... 794#199794

specfically:
Creating a JPEG only DLL and retrieving the images

In that post you have a demo to download ROD-Demo1.zip

The ImageView.ahk file has the number of images hard-coded

Code:
Loop 14  ; number of images in resource.dll,  under RT_RCDATA
  RCD_Ordinals .= ( A_Index=1 ? "" : "|" ) ( 9000+A_Index-1 )


Would it be possible to move the quantity to the resource file?
If so, can you advise how?


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 32 posts ]  Go to page Previous  1, 2, 3  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: Apollo and 24 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