AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

[module] CmnDlg 4.03 - Common Dialogs
Goto page Previous  1, 2, 3, 4, 5, 6  Next
 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
n-l-i-d
Guest





PostPosted: Tue Mar 06, 2007 11:30 am    Post subject: Reply with quote

Razz Ok, no COM this time... Thanks.
Back to top
majkinetor



Joined: 24 May 2006
Posts: 3544
Location: Belgrade

PostPosted: Sun Apr 08, 2007 2:06 pm    Post subject: Reply with quote

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

_________________
Back to top
View user's profile Send private message MSN Messenger
Markus M.



Joined: 17 Apr 2007
Posts: 14
Location: Stuttgart (Ger)

PostPosted: Tue Apr 17, 2007 2:10 pm    Post subject: Reply with quote

great stuff, thanx a lot majkinetor Smile
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. Question

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 Laughing
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

Back to top
View user's profile Send private message
BoBo
Guest





PostPosted: Tue Apr 17, 2007 2:23 pm    Post subject: Reply with quote

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. Cool
Back to top
majkinetor



Joined: 24 May 2006
Posts: 3544
Location: Belgrade

PostPosted: Tue Apr 17, 2007 3:10 pm    Post subject: Reply with quote

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.
_________________
Back to top
View user's profile Send private message MSN Messenger
toralf



Joined: 31 Jan 2005
Posts: 3842
Location: Bremen, Germany

PostPosted: Tue Apr 17, 2007 3:40 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Send e-mail Visit poster's website
majkinetor



Joined: 24 May 2006
Posts: 3544
Location: Belgrade

PostPosted: Tue Apr 17, 2007 6:12 pm    Post subject: Reply with quote

You are right.

I created those functions separately over larger time. I just joined the functions on this page.
_________________
Back to top
View user's profile Send private message MSN Messenger
Markus M.



Joined: 17 Apr 2007
Posts: 14
Location: Stuttgart (Ger)

PostPosted: Wed Apr 18, 2007 7:51 pm    Post subject: Reply with quote

@majkinetor:
oh, "MultiByteToWideChar" Rolling Eyes 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 Smile

Back to top
View user's profile Send private message
engunneer



Joined: 30 Aug 2005
Posts: 5957
Location: Pacific Northwest, US

PostPosted: Wed Apr 18, 2007 7:55 pm    Post subject: Reply with quote

Gui +OwnDialogs I thnk will help you make it modal, IIRC.
_________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM
Back to top
View user's profile Send private message Visit poster's website
Markus M.



Joined: 17 Apr 2007
Posts: 14
Location: Stuttgart (Ger)

PostPosted: Wed Apr 18, 2007 8:37 pm    Post subject: Reply with quote

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.

Back to top
View user's profile Send private message
majkinetor



Joined: 24 May 2006
Posts: 3544
Location: Belgrade

PostPosted: Wed Apr 18, 2007 9:04 pm    Post subject: Reply with quote

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.
_________________
Back to top
View user's profile Send private message MSN Messenger
majkinetor



Joined: 24 May 2006
Posts: 3544
Location: Belgrade

PostPosted: Thu Apr 19, 2007 8:22 am    Post subject: Reply with quote

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.
_________________
Back to top
View user's profile Send private message MSN Messenger
Markus M.



Joined: 17 Apr 2007
Posts: 14
Location: Stuttgart (Ger)

PostPosted: Thu Apr 19, 2007 11:07 am    Post subject: Reply with quote

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 Rolling Eyes

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

Back to top
View user's profile Send private message
majkinetor



Joined: 24 May 2006
Posts: 3544
Location: Belgrade

PostPosted: Thu Apr 19, 2007 12:30 pm    Post subject: Reply with quote

Quote:
it is really nice but slow when browsing large dirs like system32.
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.


Quote:
this one works:

You missed the point. Make the ChooseIconEx function block the caller script and then report back.
_________________
Back to top
View user's profile Send private message MSN Messenger
Markus M.



Joined: 17 Apr 2007
Posts: 14
Location: Stuttgart (Ger)

PostPosted: Thu Apr 19, 2007 1:34 pm    Post subject: Reply with quote

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 Mr. Green

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.

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Goto page Previous  1, 2, 3, 4, 5, 6  Next
Page 2 of 6

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group