Jump to content
Sign in to follow this  
piccaso

Nice way of monitoring other Apps

Recommended Posts

Hello,

I use the script "The Modded Calculator" It´s cool :P

I would like to have gladly only the Menuitem (No popup)

It work, but the MsgBox comes 2 times. (MsgBox(0,"","You found me!",3)

Where is the error?

; Gather information...
$iThreadIdTarget = _GetWindowThreadProcessId($hWndTarget)
$hInstTarget = DllCall("user32.dll","long","GetWindowLong","hwnd",$hWndTarget,"int",$GWL_HINSTANCE)
$hInstTarget = $hInstTarget[0]

; Get Handle to Program
$hMenuTarget = DllCall("user32.dll", "hwnd", "GetMenu", "hwnd", $hWndTarget)
$hMenuTarget = $hMenuTarget[0]

; Add our menuitem
$MENUID = 380;Unique ControlID to be created 
DllCall("user32.dll","int","AppendMenu","hwnd",$hMenuTarget,"int",$MFT_STRING,"hwnd",$MENUID,"str","Test")
DllCall("user32.dll","int","DrawMenuBar","hwnd",$hWndTarget); Redraw Menu

How do I get an empty place to the old menu?

e.g.

File Edit View..............MyMenu

THX

Frank

Share this post


Link to post
Share on other sites

The Modded Calculator

Added Button and menu

The Modded Calculator is a _very_ nice way to add a menu item.

Could someone tell me if adding a menu item also possible with ANYGUI.au3 or does that add controls just to the window application area below the title and menubar? Thank you.

Edited by hqprog

Share this post


Link to post
Share on other sites

Really like it :whistle: Would be nice to see it somehow in a GUI (if possible) so I could add stuff more easily...Tried to change some stuff for other programs, but the only thing that worked was the Button (the Menu didn't appear :P )

Greert,

FaNtA

Share this post


Link to post
Share on other sites

see last post

Hi Piccaso,

The hook.dll approach is very nice and I might use it - but it would be nice to use BYPOSITION to create menuitem anywhere rather than just append at end

It appear the dll may support other functions besides "AppendMenu" such as "Insert Menu" and possibly others (?)

Is there some documentation of the dll available? Thanks.

Share this post


Link to post
Share on other sites

Hi Piccaso,

The hook.dll approach is very nice and I might use it - but it would be nice to use BYPOSITION to create menuitem anywhere rather than just append at end

To be more specific, I'm trying to modify the code of ModCalc.au3 as shown below

I changed the DllCall to use the InsertMenu command with $MF_BYPOSITION

Is the DllCall for InsertMenu configured properly? (it appears to work ok)

However I cannot get the submenus to popup - so am not sure the submenu handle is correctly configured

Should the InsertMenu command also be used for DllCall for submenus?

Or something more I am missing in the MSDN documentation on menus

Any suggestions would be much appreciated

Cheers!

; ORIGINAL from ModCalc.au3
; Add new PopupMenu
$hSubMenuTarget = DllCall("user32.dll","hwnd","CreatePopupMenu")
$hSubMenuTarget = $hSubMenuTarget[0]
DllCall("user32.dll","int","AppendMenu","hwnd",$hMenuTarget,"int",$MFT_POPUP,"hwnd",$hSubMenuTarget,"str","&NewMenu")
; Add our menuitem
$MENUID = 380 ;Unique ControlID to be created 
DllCall("user32.dll","int","AppendMenu","hwnd",$hSubMenuTarget,"int",$MFT_STRING,"int",$MENUID,"str","New&Item")
; Add a Separator
DllCall("user32.dll","int","AppendMenu","hwnd",$hSubMenuTarget,"int",$MFT_SEPARATOR,"int",1,"str","")
$MENUID_REMOVE = 382 ;Unique ControlID to be created 
DllCall("user32.dll","int","AppendMenu","hwnd",$hSubMenuTarget,"int",$MFT_STRING,"int",$MENUID_REMOVE,"str","Remove &Modification")
DllCall("user32.dll","int","DrawMenuBar","hwnd",$hWndTarget) ; Redraw Menu

; MODIFIED 
; Add new PopupMenu
$hSubMenuTarget = DllCall("user32.dll","hwnd","CreatePopupMenu")
$hSubMenuTarget = $hSubMenuTarget[0]
DllCall("user32.dll","int","InsertMenu","hwnd",$hMenuTarget,"int",2,"int",$MF_BYPOSITION,"int",$MFT_POPUP,"str","&NewMenu") ; CHANGED to InsertMenu BYPOSITION
; Add our menuitem
$MENUID = 380 ;Unique ControlID to be created 
DllCall("user32.dll","int","AppendMenu","hwnd",$hSubMenuTarget,"int",$MFT_STRING,"int",$MENUID,"str","New&Item")
; Add a Separator
DllCall("user32.dll","int","AppendMenu","hwnd",$hSubMenuTarget,"int",$MFT_SEPARATOR,"int",1,"str","")
$MENUID_REMOVE = 382 ;Unique ControlID to be created 
DllCall("user32.dll","int","AppendMenu","hwnd",$hSubMenuTarget,"int",$MFT_STRING,"int",$MENUID_REMOVE,"str","Remove &Modification")
DllCall("user32.dll","int","DrawMenuBar","hwnd",$hWndTarget) ; Redraw Menu
Edited by hqprog

Share this post


Link to post
Share on other sites

Two things...

1.Can we use hook.dll to create context menu entries on the right click menu of explorer?

2. Can hook.dll be updated so that it can be used with the MemoryDll UDF?

Thanks


What is what? What is what.

Share this post


Link to post
Share on other sites

Do you realize the distance that light travelled since the last post in this thread? You're lost somewhere between Luhman 16 and Wolf 359.


This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...