AutoHotkey Community

It is currently May 25th, 2012, 1:33 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 157 posts ]  Go to page Previous  1, 2, 3, 4, 5 ... 11  Next
Author Message
 Post subject:
PostPosted: March 6th, 2007, 11:30 am 
:P Ok, no COM this time... Thanks.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: April 8th, 2007, 2:06 pm 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
I updated ChooseFont.

You are now allowed to set initial color, and bug about default font height is corrected based on the knowledge I get with GetTextSize func.


Quote:
pFace - initial font, output
pStyle - initial style, output (AHK font syntax)
pColor - initial text color, output
hGui - parent gui, affects modality and position

Returns : false on cancel

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 17th, 2007, 2:10 pm 
Offline

Joined: April 17th, 2007, 1:49 pm
Posts: 14
Location: Stuttgart (Ger)
great stuff, thanx a lot majkinetor :-)
it is very usefull for my current script, where i need the pick icon dialog.

i had some probs with win 2000, as the function is not exported by name, but by ordinal.
after a little research i found a solution to solve this prob.

changing line 28 in chooseicon.ahk to:
Code:
r := DllCall(DllCall("GetProcAddress", "Uint", DllCall("LoadLibrary", "str", "shell32.dll"), "Uint", 62), "uint", hGui, "uint", &wIcon, "uint", 1025, "intp", idx)

it works also in xp. have not tested it yet in other versions like win-me or 9x.
but just a thing i'm curious about: when i searched the web for PickIconDlg and win2000, i've read something about the strings must be converted to unicode to work properly with w2k. i did not played around with the unicode thing as it seems to work fine, even if using german special chars. :?:

one little other thing in dialogs.ahk. when changing the line 13 to:
Code:
   Gui, add, picture,% "x10 icon"idx+1, %icon%

it displays the correct icon.

as i'm new to ahk and this forum just let me say it's a great treasure chest of knowledge in here, and it seems to be a nice community :lol:
and after beeing away from windows programming for years, it is great to start again with ahk. can't remember having so much fun with coding :wink:

Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 17th, 2007, 2:23 pm 
Quote:
and after beeing away from windows programming for years, it is great to start again with ahk.
@ Markus
und sollte es dich mal gelüsten AHK auf Deutsch zu diskutieren - das Deutsche AutoHotkey-Forum. Have fun. 8)


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: April 17th, 2007, 3:10 pm 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
Quote:
changing line 28 in chooseicon.ahk to:

Nice solution. When I created those functions, this command wasn't possible in AHK and I don't care much about systems prior to XP. I will see to find time to update the code with your changes as it is win2k, but I don't support dead systems in my programming, like Win9x.


Code:
but just a thing i'm curious about: when i searched the web for PickIconDlg and win2000, i've read something about the strings must be converted to unicode to work properly with w2k.

I convert it to unicode using:
Code:
 DllCall("MultiByteToWideChar" ....

AHK doesn't support unicode, but this is binary thing.

Quote:
when changing the line 13 to: ... it displays the correct icon.
The bug.


BTW, I don't use this dialog as it is stupid. I provided it here for the sake of compliteness. U should use ChooseIconEx for more advanced icon control

BoBo wrote:
das Deutsche AutoHotkey-Forum.|

2 Markus

Welcom to the AHK forum. You will have good time here if you don't listen what BoBo speaks. Limit yourself to his regular "resource & utilities" posts to get the best out of it. Joining German forum is certanly not a good idea, as of knowledge split.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 17th, 2007, 3:40 pm 
Offline

Joined: January 31st, 2005, 9:50 am
Posts: 3910
Location: Bremen, Germany
Dear majkinetor,

Thanks for these functions.

Looking at the describtion:
Quote:
Returns : false on cancel
RETURNS: -1 on cancel, RGB value on OK
Returns: positive number on error, 1 on cancel
It seems confusing that one returns -1 on cancel, the other 0 and the third 1. Would it make sense to make them behave more identical? E.g. positive value for a result, negative value for Error and -1 for cancel.

Just my two cents

_________________
Ciao
toralf
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 17th, 2007, 6:12 pm 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
You are right.

I created those functions separately over larger time. I just joined the functions on this page.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 18th, 2007, 7:51 pm 
Offline

Joined: April 17th, 2007, 1:49 pm
Posts: 14
Location: Stuttgart (Ger)
@majkinetor:
oh, "MultiByteToWideChar" :roll: i've been totally focused about the pickicondialog, so i've completely overseen it.
your ChooseIconEx looks very nice and comfortable, gonna test it now.
seems to to be the better solution, as the pickicondialog is not modal (or i dunno how to make it modal)
i don't think it is about splitting knowledge joining the german forum, as some ppl are not capable of the english language.

@BoBo: danke für die einladung werde dort mal vorbeisehen :-)

Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 18th, 2007, 7:55 pm 
Offline
User avatar

Joined: August 30th, 2005, 8:43 pm
Posts: 8647
Location: Salem, MA
Gui +OwnDialogs I thnk will help you make it modal, IIRC.

_________________
Image
(Common Answers) - New Tutorials Forum - Humongous FAQ


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 18th, 2007, 8:37 pm 
Offline

Joined: April 17th, 2007, 1:49 pm
Posts: 14
Location: Stuttgart (Ger)
engunneer wrote:
Gui +OwnDialogs I thnk will help you make it modal, IIRC.


seems only to work with ahk dialogs, but not with dialogs invoked by dll calls. thanks anway for your help.

Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 18th, 2007, 9:04 pm 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
There is, sadly, no method to show modal windows in AHK. You can make only dialogs modal.

That is the reason why ChooseIconEx uses modality loop at the end of its function main function.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 19th, 2007, 8:22 am 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
Quote:
i don't think it is about splitting knowledge joining the german forum, as some ppl are not capable of the english language.

You are obviously not one one of them, so in your case it would be.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 19th, 2007, 11:07 am 
Offline

Joined: April 17th, 2007, 1:49 pm
Posts: 14
Location: Stuttgart (Ger)
majkinetor wrote:
There is, sadly, no method to show modal windows in AHK. You can make only dialogs modal.

That is the reason why ChooseIconEx uses modality loop at the end of its function main function.


this one works:
Code:
gui, +disabled
ChooseIcon(IconFile, IconIndex, hGui)
gui, -disabled
gui, show

a lot off stuff i've got to learn about ahk and windoze coding :roll:

i've tested your iconex. it is really nice but slow when browsing large dirs like system32.

Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 19th, 2007, 12:30 pm 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
Quote:
it is really nice but slow when browsing large dirs like system32.
Yes. Its not made for browsing system32 but icon packs ;)
Pick icon can't even see a dir.
BTW, i will give you a medal if you improve its speed. Its just the fact, again, that ahk is made for different kind of things in mind.


Quote:
this one works:

You missed the point. Make the ChooseIconEx function block the caller script and then report back.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 19th, 2007, 1:34 pm 
Offline

Joined: April 17th, 2007, 1:49 pm
Posts: 14
Location: Stuttgart (Ger)
majkinetor wrote:
Quote:
this one works:

You missed the point. Make the ChooseIconEx function block the caller script and then report back.


not really. i was concerning the dll call, not ChooseIconEx.
sorry for this confusion :mrgreen:

Quote:
Yes. Its not made for browsing system32 but icon packs :Wink:
Pick icon can't even see a dir.
BTW, i will give you a medal if you improve its speed. Its just the fact, again, that ahk is made for different kind of things in mind.


even if i'm new to ahk, i noticed is limitations. but it still covers my needs. i've got VB express and delphi personal. but it takes too much time to getting used to it. apart from the fact that the VB express is totally useless for small tools, concerning the fact to deploy a huge .net redistributable.

Image


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 21 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