AutoHotkey Community

It is currently May 27th, 2012, 11:27 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 40 posts ]  Go to page 1, 2, 3  Next
Author Message
PostPosted: August 20th, 2009, 11:05 am 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade


Notes:

_________________
Image


Last edited by majkinetor on December 14th, 2009, 3:08 pm, edited 18 times in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 20th, 2009, 12:30 pm 
Offline
User avatar

Joined: August 30th, 2005, 8:43 pm
Posts: 8667
Location: Salem, MA
Now that's just cool.

Code:
SetTitleMatchMode, Regex
run, Notepad
WinWait, Notepad
var := Win_SetMenu(WinExist("Notepad"))
Msgbox, Now It's gone!`n%var%
var := Win_SetMenu(WinExist("Notepad"), var)
Msgbox, Now It's back!`n%var%


now that I have the handle of the menu, how hard is it to edit?

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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 20th, 2009, 2:23 pm 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
Pretty hard I think. Its not hard to inject the menu item, its hard to get notification as it is different memory space. You basically need to subclass menu procedure in another space AFAIK.


I remember that Sean did something similar, have a look around the forum.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 20th, 2009, 6:09 pm 
Offline

Joined: April 8th, 2009, 8:23 pm
Posts: 3036
Location: Rio de Janeiro - RJ - Brasil
Great work majkinetor, as usual. :)

Just a note about the documentation:
Quote:
hneg
Animates the window from left to right. This flag can be used with roll or slide animation. It is ignored when used with CENTER or BLEND.
hpos
Animates the window from left to right. This flag can be used with roll or slide animation. It is ignored when used with CENTER or BLEND(and missing a period here hehe :))

_________________
"Read the manual. Read it again. Search the forum.
Try something before asking. Show what you've tried.
"
Image
Antonio França
My stuff: Google Profile


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 20th, 2009, 6:17 pm 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
Ty. Fixed.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 21st, 2009, 6:39 pm 
I'm sorry for my lack of knowledge but i just can't seem to get the Win_Animate function to work for me. I pretty sure it's a syntax thing but I've tried the following.

Code:
Gui, Show, x100 y100 h500 w500
Gui, +Lastfound
Gui, +Alwaysontop
Win:=WinExist()
sleep, 2000
Win_Animate(Win, "hide")
Return



Code:
Gui, Show, x100 y100 h500 w500
Gui, +Lastfound
Gui, +Alwaysontop

Win:=ahk_id . WinExist()
sleep, 2000
Win_Animate(Win, "hide")
Return


Code:
Gui, Show, x100 y100 h500 w500
Gui, +Lastfound
Win:=ahk_id . WinExist()
sleep, 2000
Win_Animate(Win, hide)
Return


Like I said it's probably something really stupid but could anyone post a small snippet of code to show how to use this properly. It looks awesome and exactly what I'm looking for... if I could get it to work. Thanks in advance.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: August 21st, 2009, 6:56 pm 
sorry I'm running xp SP2


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: August 21st, 2009, 7:24 pm 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
Code:
   Win_Animate(Win, "hide blend", 1000)

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 23rd, 2009, 9:32 pm 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
v1.0a
- Bugfixes.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 24th, 2009, 11:27 am 
Offline

Joined: November 3rd, 2008, 5:13 am
Posts: 12
It's not posible to use SetIcon to change the icon of an external application isn't?

Would require some sort of remote buffer trick or something?

I would love a little app to dinamically change icons of software around which have really ugly icons on their windows and task switching...


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 24th, 2009, 12:50 pm 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
My findings are that you can change the BIG icon, but not the small icon.
Kinda makes sense, since big icon is not part of the process (but of shell), and small one is. So, I guess icon handle must be valid in the space of the process which AFAIK can't be done with remote buffer but with other injection techniques which require DLL, so its not possible purley in AHK.

Maybe there is other way to inject icon into remote process. I was thinking about CreateRemoteThread with LoadImage as thread function but LoadImage doesn't have right number of arguments for that....

You can't even remove icon as AFAIK null has different memory adress for each process.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 25th, 2009, 9:15 am 
Offline

Joined: November 3rd, 2008, 5:13 am
Posts: 12
Thanks for the detailed info... I thought it wasn't an easy thing to do... well I guess I'll have to live with those ugly icons of Irfanview and Wavosaur...

Irfanview developer even packed the executable with some custom packer so it's even imposible to reshack the icon. My guess is that ugly roadkill icon is a former pet of him, which died in tragic circustances :D


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 25th, 2009, 10:50 am 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
Ye, IrfanView has notoriously bad complete interface.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 26th, 2009, 3:18 am 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7503
Location: Australia
FYI, (most?) GDI objects like icons are represented by handles which are portable between processes. (Edit: I was wrong.) I've no problem setting the small icon of IrfanView:
Code:
; MI_ExtractIcon : http://www.autohotkey.com/forum/topic21991.html
hicon := MI_ExtractIcon(IconPath,1,16)
SendMessage 0x80, 0, hicon,, IrfanView
Sleep 5000
SendMessage 0x80, 0, 0,, IrfanView
DllCall("DeleteObject", "uint", hicon)
ExitApp

majkinetor wrote:
You can't even remove icon as AFAIK null has different memory adress for each process.
:lol:
NULL is always 0, not really a memory address at all. However, WM_SETICON will only allow you to remove an icon which it was used to set. I think normally the icon is defined by the window class.


Last edited by Lexikos on August 26th, 2009, 5:52 am, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 26th, 2009, 4:21 am 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
Read Object Categories. You may test WM_SETFONT to see if GDI objects are portable or not.


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: bowen666, Google Feedfetcher, MSN [Bot], nomissenrojb, nothing and 65 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